Author: greatlrd
Date: Wed Aug 30 14:13:01 2006
New Revision: 23799
URL: http://svn.reactos.org/svn/reactos?rev=23799&view=rev
Log:
Implement RtlRandomEx by copy RtlRandom code.
ms have two different implement, One random is faster that other, (in some doc I read (maybe from osr) some year ago), the RtlRandomEx is not document in the free ddk/sdk, but it is include in ddk/ifs kit, according the doc.
Modified:
trunk/reactos/lib/rtl/random.c
Modified: trunk/reactos/lib/rtl/random.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/random.c?rev=23799…
==============================================================================
--- trunk/reactos/lib/rtl/random.c (original)
+++ trunk/reactos/lib/rtl/random.c Wed Aug 30 14:13:01 2006
@@ -83,16 +83,26 @@
}
/*
-* @unimplemented
+* @implemented
*/
ULONG
NTAPI
-RtlRandomEx(
- PULONG Seed
+RtlRandomEx( IN OUT PULONG Seed
)
{
- UNIMPLEMENTED;
- return 0;
+ ULONG Rand;
+ int Pos;
+ ULONG Result;
+
+ PAGED_CODE_RTL();
+
+ Rand = (*Seed * 0x7fffffed + 0x7fffffc3) % 0x7fffffff;
+ *Seed = (Rand * 0x7fffffed + 0x7fffffc3) % 0x7fffffff;
+ Pos = *Seed & 0x7f;
+ Result = SavedValue[Pos];
+ SavedValue[Pos] = Rand;
+
+ return Result;
}
Author: ion
Date: Wed Aug 30 10:56:06 2006
New Revision: 23796
URL: http://svn.reactos.org/svn/reactos?rev=23796&view=rev
Log:
- Update kernel fun.
Modified:
trunk/reactos/ntoskrnl/KrnlFun.c
Modified: trunk/reactos/ntoskrnl/KrnlFun.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/KrnlFun.c?rev=237…
==============================================================================
--- trunk/reactos/ntoskrnl/KrnlFun.c (original)
+++ trunk/reactos/ntoskrnl/KrnlFun.c Wed Aug 30 10:56:06 2006
@@ -25,14 +25,14 @@
// - Use Object Type Mutex/Lock.
//
// Ke:
-// - Sanitize some context fields during conversions
// - Add PSEH handler when an exception occurs in an exception (KiCopyExceptionRecord).
+// - Get rid of KiRosPrintAddress and use KiDumpParameterImages instead.
// - Forward exceptions to user-mode debugger.
+// - Sanitize some context fields during conversions.
// - Implement stack fault and segment fault handlers.
// - Implement kernel-mode GPF handler, possibly fixing below:
// - Figure out why ES/DS gets messed up in VMWare, when doing KiServiceExit only,
// and only when called from user-mode, and returning to user-mode.
-// - Figure out what the DEBUGEIP hack is for and how it can be moved away.
// - Add DR macro/save and VM macro/save.
// - Implement KiCallbackReturn, KiGetTickCount, KiRaiseAssertion.
//
Author: ion
Date: Wed Aug 30 05:22:41 2006
New Revision: 23793
URL: http://svn.reactos.org/svn/reactos?rev=23793&view=rev
Log:
- Jesus Christ... will Hell freeze over before someone finally listens and implements a proper PE loader in Freeloader?
Modified:
trunk/reactos/ntoskrnl/ke/main.c
Modified: trunk/reactos/ntoskrnl/ke/main.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/main.c?rev=237…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/main.c (original)
+++ trunk/reactos/ntoskrnl/ke/main.c Wed Aug 30 05:22:41 2006
@@ -71,6 +71,8 @@
#if defined (ALLOC_PRAGMA)
#pragma alloc_text(INIT, _main)
#endif
+
+extern LDR_DATA_TABLE_ENTRY HalModuleObject;
/* FUNCTIONS ****************************************************************/
@@ -240,6 +242,17 @@
(PVOID)KERNEL_BASE,
&DriverSize);
+ //
+ //
+ // HACK HACK HACK WHEN WILL YOU PEOPLE FIX FREELDR?!?!?!
+ // FREELDR SENDS US AN ***INVALID*** HAL PE HEADER!!!
+ // WE READ IT IN LdrInitModuleManagement ABOVE!!!
+ // WE SET .SizeOfImage TO A *GARBAGE* VALUE!!!
+ //
+ // This dirty hack fixes it, and should make symbol lookup work too.
+ //
+ HalModuleObject.SizeOfImage = RtlImageNtHeader((PVOID)HalModuleObject.DllBase)->OptionalHeader.SizeOfImage;
+
/* Increase the last kernel address with the size of HAL */
LastKernelAddress += PAGE_ROUND_UP(DriverSize);