> For the complete documentation index, see [llms.txt](https://malwaresourcecode.com/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://malwaresourcecode.com/home/markdown/random-integer/rtluniform.md).

# RtlUniform

```cpp
#include <Windows.h>

ULONG CreatePseudoRandomIntegerFromNtdll(_In_ ULONG Seed)
{
	typedef ULONG(NTAPI* RTLUNIFORM)(PULONG);
	RTLUNIFORM RtlUniform = NULL;
	HMODULE hModule = NULL;

	hModule = GetModuleHandleW(L"ntdll.dll");
	if (hModule == NULL)
		return 0;

	RtlUniform = (RTLUNIFORM)GetProcAddress(hModule, "RtlUniform");
	if (!RtlUniform)
		return 0;

	return RtlUniform(&Seed);
}

INT main(VOID)
{
	ULONG RandomValue = 0;

	RandomValue = CreatePseudoRandomIntegerFromNtdll(1);

  return ERROR_SUCCESS;
}
```
