1
0
mirror of https://github.com/winfsp/winfsp.git synced 2025-12-20 11:02:48 -06:00

sys: DEBUGRANDTEST()

This commit is contained in:
Bill Zissimopoulos
2016-01-27 15:26:44 -08:00
parent f491d6015f
commit dde82a1081
3 changed files with 28 additions and 2 deletions

View File

@@ -261,4 +261,22 @@ const char *FsInformationClassSym(FS_INFORMATION_CLASS FsInformationClass)
return "FS_INFORMATION_CLASS:Unknown";
}
}
ULONG DebugRandom(VOID)
{
static KSPIN_LOCK SpinLock = 0;
static ULONG Seed = 1;
KIRQL Irql;
ULONG Result;
KeAcquireSpinLock(&SpinLock, &Irql);
/* see ucrt sources */
Seed = Seed * 214013 + 2531011;
Result = (Seed >> 16) & 0x7fff;
KeReleaseSpinLock(&SpinLock, Irql);
return Result;
}
#endif