History

windows: RtlGenRandom cannot always be statically linked

aiju committed 8 years ago

Commit ee260881 parent 19fc2211 file · +6 −2Browse files

Unified · Split

kern/win32.c+6−2
@@ -126,12 +126,16 @@ procwakeup(Proc *p) · 125 unmodified lines
126 ReleaseSemaphore(op->sema, 1, 0);126 ReleaseSemaphore(op->sema, 1, 0);
127}127}
128 128
129#define RtlGenRandom SystemFunction036129BOOLEAN WINAPI (*RtlGenRandom)(PVOID, ULONG);
130BOOLEAN WINAPI RtlGenRandom(PVOID, ULONG);
131 130
132void131void
133randominit(void)132randominit(void)
134{133{
134 HMODULE mod;
135
136 mod = LoadLibraryW(L"ADVAPI32.DLL");
137 if(mod != NULL)
138 RtlGenRandom = (void *) GetProcAddress(mod, "SystemFunction036");
135}139}
136 140
137ulong141ulong

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t