SiGetDeviceNumberInformation
INT64 __stdcall SiGetDeviceNumberInformation(WCHAR *DeviceName, UINT64 *DiskId, UINT64 *PartitionId){
NTSTATUS v5;
HANDLE FileHandle;
struct _IO_STATUS_BLOCK IoStatusBlock;
__int64 OutputBuffer;
int v10;
FileHandle = 0i64;
OutputBuffer = 0i64;
IoStatusBlock = 0i64;
v10 = 0;
v5 = SiOpenDevice(DeviceName, &FileHandle);
if( v5 >= 0 )
{
v5 = ZwDeviceIoControlFile(FileHandle, 0i64, 0i64, 0i64, &IoStatusBlock, 0x2D1080u, 0i64, 0, &OutputBuffer, 0xCu);
if( v5 >= 0 )
{
if( (_DWORD)OutputBuffer == 7 )
{
*(_DWORD *)DiskId = HIDWORD(OutputBuffer);
*(_DWORD *)PartitionId = v10;
}
else
{
v5 = -1073741637;
}
}
}
if( FileHandle )
ZwClose(FileHandle);
return(unsigned int)v5;
}Referenced by:
No references.