C
C#2y ago
JimmahDean

❔ Connecting to the system resource usage monitor database

Hello! 👋 I am attempting to read and parse the SRU db found at C:\Windows\System32\sru\srudb.dat - From what I'm found, it's an Extensible Storage Engine database, however I haven't been able to find code that actually works to connect to it. The OleDb answers all except saying I don't have the right provider installed, so maybe I just need to change the connection string to something more current, and the Isam answers I've found all fail because the page size does not match the page size of the database for all legal page sizes. I'm hoping someone more knowledgeable than I can point me in the right direction on how I might parse this. Here's the most recent failed attempt
JET_INSTANCE instance;
JET_SESID sesid;

SystemParameters.DatabasePageSize = 8192;

Api.JetCreateInstance(out instance, Guid.NewGuid().ToString());
Api.JetInit(ref instance);

JET_DBID dbid;
JET_COLUMNID columnid;
JET_TABLEID tableid;
JET_COLUMNDEF columndef = new JET_COLUMNDEF();

Api.JetBeginSession(instance, out sesid, null, null);

Api.JetAttachDatabase(sesid, @"C:\Windows\System32\sru\srudb.dat", AttachDatabaseGrbit.None);

Api.OpenDatabase(sesid, @"C:\Windows\System32\sru\srudb.dat", out dbid, OpenDatabaseGrbit.None);
JET_INSTANCE instance;
JET_SESID sesid;

SystemParameters.DatabasePageSize = 8192;

Api.JetCreateInstance(out instance, Guid.NewGuid().ToString());
Api.JetInit(ref instance);

JET_DBID dbid;
JET_COLUMNID columnid;
JET_TABLEID tableid;
JET_COLUMNDEF columndef = new JET_COLUMNDEF();

Api.JetBeginSession(instance, out sesid, null, null);

Api.JetAttachDatabase(sesid, @"C:\Windows\System32\sru\srudb.dat", AttachDatabaseGrbit.None);

Api.OpenDatabase(sesid, @"C:\Windows\System32\sru\srudb.dat", out dbid, OpenDatabaseGrbit.None);
2 Replies
JimmahDean
JimmahDeanOP2y ago
bump
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server