Hi Peter,
Thank you for replying to my inquiry. Here is the piece of code:
DWORD dwSize = 0;
HRESULT hRslt = S_OK;
…
// allocate initial buffer size 1M
PVOID pBuffer = LocalAlloc(LMEM_FIXED | LMEM_ZEROINIT, 1024*1024);
//pBuffer = malloc(1024*1024);
if (!pBuffer){
strDebug.Format(“Error allocating mem 0x%X”,
GetLastError());
logfile.WriteString(strDebug);
hRslt = S_FALSE;
goto Cleanup;
}
// get the data
hRslt = fNtQuerySystemInformation(SystemObjectInformation, pBuffer,
1024*1024, &dwSize);
if(hRslt != S_OK){
…
The errors I get are 0xC0000004 - STATUS_INFO_LENGTH_MISMATCH (if I specify
a buffer of length less than 56 bytes - instead of 1024*1024) and 0xC0000001
- STATUS_UNSUCCESSFUL (if I specify buffer a buffer size larger than 55
bytes); in both cases the last param (dwSize) which should hold the required
buffer size remains 0.
fNtQuerySystemInformation is a pointer to NtQuerySystemInformation function
from ntdll.dll which is loaded at run time via LoadLibrary. I remind you
that the call succeeds with other values of the first param like
SystemHandleInformation, SystemBasicInformation, etc…
For your information, I’m using an XP Pro machine with SP 1 and the code is
part of a MFC application.
BTW: I’ve also seen an example of app which retrieves handle information
from the system. It uses the same call but with SystemHandleInformation as
first param. It also sets SeDebugPrivilege before getting the data. I’ve
tried that on my application but it didn’t work.
If you need more info please let me know. Thank you.
Best regards,
Lucian Mocanasu
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of PeterGV
Sent: Wednesday, July 28, 2004 6:40 PM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] NtQuerySystemInformation - SystemObjectInformation
always fails
Lucian Mocanasu wrote:
I’m trying to make a call to NtQuerySystemInformation with the
SystemObjectInformation class from an user mode application and it
always fails.
>
Sorry, my ESP is broken today. Perhaps you can tell us the status
that’s being returned by NtQuerySystemInformation.
You also might wanna post the BRIEFEST POSSIBLE code segment, showing
your call.
Peter
OSR
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@gfitemasoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com