#include <windows.h>
#include "CroquetPlugin.h"

static int loaded = 0;
static HMODULE hAdvApi32 = NULL;
static BOOLEAN (*RtlGenRandom)(PVOID, ULONG) = NULL;

int ioGatherEntropy(char *bufPtr, int bufSize) {
  if(!loaded) {
    loaded = 1;
    hAdvApi32 = LoadLibrary("advapi32.dll");
    (void*)RtlGenRandom = GetProcAddress(hAdvApi32, "SystemFunction036");
  }
  if(!RtlGenRandom) return 0;
  return RtlGenRandom(bufPtr, bufSize);
}

Add Win32 specific code for CroquetPlugin.
Add Win32 specific code for CroquetPlugin.

git-svn-id: f18ccec24f938f15aa42574278fe0cc52f637e81@1398 fa1542d4-bde8-0310-ad64-8ed1123d492a
