11#define WIN32_NO_STATUS
24#define SEED_BUFFER_SIZE 6
43 PDWORD NodeBegin, NodeMiddle;
58 CurrentChar = &ComputerName[0];
61 NodeId[
Size] ^= *CurrentChar;
73 NodeBegin = (
DWORD *)&NodeId[0];
74 NodeMiddle = (
DWORD *)&NodeId[2];
79 *NodeMiddle = *NodeMiddle ^ PerformanceCount.
u.HighPart ^ PerformanceCount.
u.LowPart;
81 dwValue = PerformanceCount.
u.HighPart ^ PerformanceCount.
u.LowPart ^ *NodeBegin;
88 *NodeBegin = *NodeBegin ^ dwValue;
89 *NodeMiddle = *NodeMiddle ^ *NodeBegin;
92 MemoryStatus.
dwLength =
sizeof(MemoryStatus);
96 *NodeMiddle = *NodeMiddle ^ MemoryStatus.
dwTotalPhys;
104 *NodeBegin = *NodeBegin ^ Luid.
LowPart;
105 *NodeMiddle = *NodeMiddle ^ Luid.
HighPart;
136 DPRINT1(
"Failed finding a proper MAC address, will generate seed\n");
static VOID CookupNodeId(UCHAR *NodeId)
static BOOLEAN getMacAddress(UCHAR *MacAddress)
VOID DealWithDeviceEvent()
#define NT_SUCCESS(StatCode)
BOOL WINAPI AllocateLocallyUniqueId(PLUID Luid)
BOOL WINAPI GetDiskFreeSpaceExW(IN LPCWSTR lpDirectoryName OPTIONAL, OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller, OUT PULARGE_INTEGER lpTotalNumberOfBytes, OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
BOOL WINAPI QueryPerformanceCounter(OUT PLARGE_INTEGER lpPerformanceCount)
VOID NTAPI GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
NTSTATUS NTAPI NtSetUuidSeed(IN PUCHAR Seed)
BOOL WINAPI SHIM_OBJ_NAME() GetComputerNameA(LPSTR lpBuffer, LPDWORD lpnSize)
struct _LARGE_INTEGER::@2309 u
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
#define MAX_COMPUTERNAME_LENGTH
_Must_inspect_result_ _In_ PHYSICAL_ADDRESS _In_ PHYSICAL_ADDRESS _In_ SIZE_T TotalBytes