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