/* INCLUDES *******************************************************************/
#include "ksecdd.h"
-#include <ndk/exfuncs.h>
-#include <ndk/kefuncs.h>
-#include <pseh/pseh2.h>
-#include <md4.h>
#define NDEBUG
#include <debug.h>
PVOID Buffer,
SIZE_T Length)
{
+ LARGE_INTEGER TickCount;
ULONG i, RandomValue;
PULONG P;
/* Try to generate a more random seed */
- KsecRandomSeed ^= _rotl(KeTickCount.LowPart, (KsecRandomSeed % 23));
+ KeQueryTickCount(&TickCount);
+ KsecRandomSeed ^= _rotl(TickCount.LowPart, (KsecRandomSeed % 23));
P = Buffer;
for (i = 0; i < Length / sizeof(ULONG); i++)
/* Read the TSC value */
MachineSpecificCounters->Tsc = __rdtsc();
}
-
+#if 0 // FIXME: investigate what the requirements are for these
/* Read the CPU event counter MSRs */
- MachineSpecificCounters->Ctr0 = __readmsr(0x12);
- MachineSpecificCounters->Ctr1 = __readmsr(0x13);
+ //MachineSpecificCounters->Ctr0 = __readmsr(0x12);
+ //MachineSpecificCounters->Ctr1 = __readmsr(0x13);
/* Check if this is an MMX capable CPU */
if (ExIsProcessorFeaturePresent(PF_MMX_INSTRUCTIONS_AVAILABLE))
MachineSpecificCounters->Pmc0 = __readpmc(0);
MachineSpecificCounters->Pmc1 = __readpmc(1);
}
+#endif
#else
#error Implement me!
#endif
PTEB Teb;
PPEB Peb;
PWSTR String;
- ULONG ReturnLength;
+ SIZE_T ReturnLength;
NTSTATUS Status;
/* Query some generic values */
/* Update the MD4 context from the environment data */
MD4Update(&Md4Context,
(PUCHAR)Peb->ProcessParameters->Environment,
- (PUCHAR)String - (PUCHAR)Peb->ProcessParameters->Environment);
+ (ULONG)((PUCHAR)String - (PUCHAR)Peb->ProcessParameters->Environment));
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{