mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
parent
e246b9947e
commit
fe9838f578
1 changed files with 10 additions and 4 deletions
|
@ -44,7 +44,8 @@ CookupNodeId(UCHAR * NodeId)
|
|||
DWORD dwValue;
|
||||
MEMORYSTATUS MemoryStatus;
|
||||
LUID Luid;
|
||||
DWORD SectorsPerCluster, BytesPerSector, NumberOfFreeClusters, TotalNumberOfClusters;
|
||||
WCHAR szSystem[MAX_PATH];
|
||||
ULARGE_INTEGER FreeBytesToCaller, TotalBytes, TotalFreeBytes;
|
||||
|
||||
/* Initialize node id */
|
||||
memset(NodeId, 0x11, SEED_BUFFER_SIZE * sizeof(UCHAR));
|
||||
|
@ -104,11 +105,16 @@ CookupNodeId(UCHAR * NodeId)
|
|||
*NodeMiddle = *NodeMiddle ^ Luid.HighPart;
|
||||
}
|
||||
|
||||
/* Get system directory */
|
||||
GetSystemDirectoryW(szSystem, ARRAYSIZE(szSystem));
|
||||
|
||||
/* And finally with free disk space */
|
||||
if (GetDiskFreeSpaceA("c:\\", &SectorsPerCluster, &BytesPerSector, &NumberOfFreeClusters, &TotalNumberOfClusters))
|
||||
if (GetDiskFreeSpaceExW(szSystem, &FreeBytesToCaller, &TotalBytes, &TotalFreeBytes))
|
||||
{
|
||||
*NodeMiddle = *NodeMiddle ^ TotalNumberOfClusters * BytesPerSector * SectorsPerCluster;
|
||||
*NodeBegin = *NodeBegin ^ NumberOfFreeClusters * BytesPerSector * SectorsPerCluster;
|
||||
*NodeMiddle ^= FreeBytesToCaller.LowPart ^ TotalFreeBytes.HighPart;
|
||||
*NodeMiddle ^= FreeBytesToCaller.HighPart ^ TotalFreeBytes.LowPart;
|
||||
*NodeBegin ^= TotalBytes.LowPart ^ TotalFreeBytes.LowPart;
|
||||
*NodeBegin ^= TotalBytes.HighPart ^ TotalFreeBytes.HighPart;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue