Alexandre Julliard : ntdll: Move fixup_imports to avoid forward declarations.

Alexandre Julliard julliard at winehq.org
Mon Feb 17 13:45:15 CST 2014


Module: wine
Branch: master
Commit: f5fc925f0e97bd80b244c0efe453b329c7dd7d5d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f5fc925f0e97bd80b244c0efe453b329c7dd7d5d

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Feb 17 17:32:37 2014 +0100

ntdll: Move fixup_imports to avoid forward declarations.

---

 dlls/ntdll/loader.c |  102 +++++++++++++++++++++++++--------------------------
 1 file changed, 51 insertions(+), 51 deletions(-)

diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 7f36ddd..8414ec5 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -705,57 +705,6 @@ static NTSTATUS create_module_activation_context( LDR_MODULE *module )
 }
 
 
-/****************************************************************
- *       fixup_imports
- *
- * Fixup all imports of a given module.
- * The loader_section must be locked while calling this function.
- */
-static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path )
-{
-    int i, nb_imports;
-    const IMAGE_IMPORT_DESCRIPTOR *imports;
-    WINE_MODREF *prev;
-    DWORD size;
-    NTSTATUS status;
-    ULONG_PTR cookie;
-
-    if (!(wm->ldr.Flags & LDR_DONT_RESOLVE_REFS)) return STATUS_SUCCESS;  /* already done */
-    wm->ldr.Flags &= ~LDR_DONT_RESOLVE_REFS;
-
-    if (!(imports = RtlImageDirectoryEntryToData( wm->ldr.BaseAddress, TRUE,
-                                                  IMAGE_DIRECTORY_ENTRY_IMPORT, &size )))
-        return STATUS_SUCCESS;
-
-    nb_imports = 0;
-    while (imports[nb_imports].Name && imports[nb_imports].FirstThunk) nb_imports++;
-
-    if (!nb_imports) return STATUS_SUCCESS;  /* no imports */
-
-    if (!create_module_activation_context( &wm->ldr ))
-        RtlActivateActivationContext( 0, wm->ldr.ActivationContext, &cookie );
-
-    /* Allocate module dependency list */
-    wm->nDeps = nb_imports;
-    wm->deps  = RtlAllocateHeap( GetProcessHeap(), 0, nb_imports*sizeof(WINE_MODREF *) );
-
-    /* load the imported modules. They are automatically
-     * added to the modref list of the process.
-     */
-    prev = current_modref;
-    current_modref = wm;
-    status = STATUS_SUCCESS;
-    for (i = 0; i < nb_imports; i++)
-    {
-        if (!(wm->deps[i] = import_dll( wm->ldr.BaseAddress, &imports[i], load_path )))
-            status = STATUS_DLL_NOT_FOUND;
-    }
-    current_modref = prev;
-    if (wm->ldr.ActivationContext) RtlDeactivateActivationContext( 0, cookie );
-    return status;
-}
-
-
 /*************************************************************************
  *		is_dll_native_subsystem
  *
@@ -885,6 +834,57 @@ static void free_tls_slot( LDR_MODULE *mod )
 }
 
 
+/****************************************************************
+ *       fixup_imports
+ *
+ * Fixup all imports of a given module.
+ * The loader_section must be locked while calling this function.
+ */
+static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path )
+{
+    int i, nb_imports;
+    const IMAGE_IMPORT_DESCRIPTOR *imports;
+    WINE_MODREF *prev;
+    DWORD size;
+    NTSTATUS status;
+    ULONG_PTR cookie;
+
+    if (!(wm->ldr.Flags & LDR_DONT_RESOLVE_REFS)) return STATUS_SUCCESS;  /* already done */
+    wm->ldr.Flags &= ~LDR_DONT_RESOLVE_REFS;
+
+    if (!(imports = RtlImageDirectoryEntryToData( wm->ldr.BaseAddress, TRUE,
+                                                  IMAGE_DIRECTORY_ENTRY_IMPORT, &size )))
+        return STATUS_SUCCESS;
+
+    nb_imports = 0;
+    while (imports[nb_imports].Name && imports[nb_imports].FirstThunk) nb_imports++;
+
+    if (!nb_imports) return STATUS_SUCCESS;  /* no imports */
+
+    if (!create_module_activation_context( &wm->ldr ))
+        RtlActivateActivationContext( 0, wm->ldr.ActivationContext, &cookie );
+
+    /* Allocate module dependency list */
+    wm->nDeps = nb_imports;
+    wm->deps  = RtlAllocateHeap( GetProcessHeap(), 0, nb_imports*sizeof(WINE_MODREF *) );
+
+    /* load the imported modules. They are automatically
+     * added to the modref list of the process.
+     */
+    prev = current_modref;
+    current_modref = wm;
+    status = STATUS_SUCCESS;
+    for (i = 0; i < nb_imports; i++)
+    {
+        if (!(wm->deps[i] = import_dll( wm->ldr.BaseAddress, &imports[i], load_path )))
+            status = STATUS_DLL_NOT_FOUND;
+    }
+    current_modref = prev;
+    if (wm->ldr.ActivationContext) RtlDeactivateActivationContext( 0, cookie );
+    return status;
+}
+
+
 /*************************************************************************
  *		alloc_module
  *




More information about the wine-cvs mailing list