[ros-diffs] [ion] 54166: [KERNEL32]: Move some definitions to header file. [KERNEL32]: MoveBasepLocateExeLdrEntry to utils.c.

ion at svn.reactos.org ion at svn.reactos.org
Sun Oct 16 17:05:17 UTC 2011


Author: ion
Date: Sun Oct 16 17:05:16 2011
New Revision: 54166

URL: http://svn.reactos.org/svn/reactos?rev=54166&view=rev
Log:
[KERNEL32]: Move some definitions to header file.
[KERNEL32]: MoveBasepLocateExeLdrEntry to utils.c.

Modified:
    trunk/reactos/dll/win32/kernel32/client/loader.c
    trunk/reactos/dll/win32/kernel32/client/proc.c
    trunk/reactos/dll/win32/kernel32/client/utils.c
    trunk/reactos/dll/win32/kernel32/include/kernel32.h

Modified: trunk/reactos/dll/win32/kernel32/client/loader.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/loader.c?rev=54166&r1=54165&r2=54166&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/loader.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/loader.c [iso-8859-1] Sun Oct 16 17:05:16 2011
@@ -10,27 +10,6 @@
 
 #define NDEBUG
 #include <debug.h>
-
-typedef struct tagLOADPARMS32 {
-  LPSTR lpEnvAddress;
-  LPSTR lpCmdLine;
-  WORD  wMagicValue;
-  WORD  wCmdShow;
-  DWORD dwReserved;
-} LOADPARMS32;
-
-extern BOOLEAN InWindows;
-extern WaitForInputIdleType lpfnGlobalRegisterWaitForInputIdle;
-
-#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_ERROR    1
-#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_SUCCESS  2
-#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_CONTINUE 3
-
-VOID
-NTAPI
-BasepLocateExeLdrEntry(IN PLDR_DATA_TABLE_ENTRY Entry,
-                       IN PVOID Context,
-                       OUT BOOLEAN *StopEnumeration);
 
 /* FUNCTIONS ****************************************************************/
 

Modified: trunk/reactos/dll/win32/kernel32/client/proc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/proc.c?rev=54166&r1=54165&r2=54166&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] Sun Oct 16 17:05:16 2011
@@ -371,37 +371,6 @@
                              &DuplicatedHandle,
                              sizeof(HANDLE),
                              &Dummy);
-    }
-}
-
-VOID
-NTAPI
-BasepLocateExeLdrEntry(IN PLDR_DATA_TABLE_ENTRY Entry,
-                       IN PVOID Context,
-                       OUT BOOLEAN *StopEnumeration)
-{
-    /* Make sure we get Entry, Context and valid StopEnumeration pointer */
-    ASSERT(Entry);
-    ASSERT(Context);
-    ASSERT(StopEnumeration);
-
-    /* If entry is already found - signal to stop */
-    if (BasepExeLdrEntry)
-    {
-        /* Signal to stop enumeration and return */
-        *StopEnumeration = TRUE;
-        return;
-    }
-
-    /* We don't have a exe ldr entry, so try to see if this one is ours
-       by matching base address */
-    if (Entry->DllBase == Context)
-    {
-        /* It matches, so remember the ldr entry */
-        BasepExeLdrEntry = Entry;
-
-        /* And stop enumeration */
-        *StopEnumeration = TRUE;
     }
 }
 

Modified: trunk/reactos/dll/win32/kernel32/client/utils.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/utils.c?rev=54166&r1=54165&r2=54166&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/utils.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/utils.c [iso-8859-1] Sun Oct 16 17:05:16 2011
@@ -25,6 +25,34 @@
 
 /* FUNCTIONS ****************************************************************/
 
+VOID
+NTAPI
+BasepLocateExeLdrEntry(IN PLDR_DATA_TABLE_ENTRY Entry,
+                       IN PVOID Context,
+                       OUT BOOLEAN *StopEnumeration)
+{
+    /* Make sure we get Entry, Context and valid StopEnumeration pointer */
+    ASSERT(Entry);
+    ASSERT(Context);
+    ASSERT(StopEnumeration);
+
+    /* If entry is already found - signal to stop */
+    if (BasepExeLdrEntry)
+    {
+        *StopEnumeration = TRUE;
+        return;
+    }
+
+    /* Otherwise keep enumerating until we find a match */
+    if (Entry->DllBase == Context)
+    {
+        /* It matches, so remember the ldr entry */
+        BasepExeLdrEntry = Entry;
+
+        /* And stop enumeration */
+        *StopEnumeration = TRUE;
+    }
+}
 
 /*
  * Converts an ANSI or OEM String to the TEB StaticUnicodeString

Modified: trunk/reactos/dll/win32/kernel32/include/kernel32.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/include/kernel32.h?rev=54166&r1=54165&r2=54166&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] Sun Oct 16 17:05:16 2011
@@ -80,6 +80,20 @@
    CPTABLEINFO CodePageTable;
 } CODEPAGE_ENTRY, *PCODEPAGE_ENTRY;
 
+typedef struct tagLOADPARMS32 {
+  LPSTR lpEnvAddress;
+  LPSTR lpCmdLine;
+  WORD  wMagicValue;
+  WORD  wCmdShow;
+  DWORD dwReserved;
+} LOADPARMS32;
+
+
+#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_ERROR    1
+#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_SUCCESS  2
+#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_CONTINUE 3
+
+
 extern PBASE_STATIC_SERVER_DATA BaseStaticServerData;
 
 typedef
@@ -87,6 +101,10 @@
 (*WaitForInputIdleType)(
     HANDLE hProcess,
     DWORD dwMilliseconds);
+
+
+extern BOOLEAN InWindows;
+extern WaitForInputIdleType lpfnGlobalRegisterWaitForInputIdle;
 
 /* GLOBAL VARIABLES **********************************************************/
 
@@ -260,3 +278,9 @@
                        BOOL	bInheritHandle,
                        DWORD dwOptions);
 
+VOID
+NTAPI
+BasepLocateExeLdrEntry(IN PLDR_DATA_TABLE_ENTRY Entry,
+                       IN PVOID Context,
+                       OUT BOOLEAN *StopEnumeration);
+




More information about the Ros-diffs mailing list