Search code examples
c++windowskerneldriver

How to call ntoskrnl.exe srand function?


With dumpbin.exe, we can see that ntoskrnl.exe exports the srand function.

With the Windows Driver Kit, how to call this function ?

I have already tested with stdlib.h, but I would like to call ntoskrnl.exe directly.

Thank you


Solution

  • #include <stdlib.h>
    
    EXTERN_C NTSTATUS DriverEntry(DRIVER_OBJECT *pDriverObject, UNICODE_STRING *pRegistryPath)
    {
        srand(100);
        return STATUS_UNSUCCESSFUL;
    }