Disable dlmalloc for exe loading for now.
[wincetools.git] / loader / ntdll_loader.c
index 8d6ba06..14e430c 100644 (file)
 \r
 #include <assert.h>\r
 \r
+#undef USE_DLMALLOC\r
+#ifdef USE_DLMALLOC\r
 #include "dlmalloc.h"\r
+#endif\r
+\r
 #include "wine.h"\r
 \r
 PIMAGE_NT_HEADERS MyRtlImageNtHeader(HMODULE hModule)\r
@@ -143,7 +147,9 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d
   SIZE_T protect_size = 0;\r
   DWORD protect_old;\r
 #endif\r
+#ifdef USE_DLMALLOC\r
   int iscoredll = 0;\r
+#endif\r
 \r
   thunk_list = get_rva( module, (DWORD)descr->FirstThunk );\r
   if (descr->OriginalFirstThunk)\r
@@ -153,8 +159,10 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d
 \r
   while (len && name[len-1] == ' ') len--;  /* remove trailing spaces */\r
 \r
+#ifdef USE_DLMALLOC\r
   if (! _stricmp (name, "coredll.dll"))\r
     iscoredll = 1;\r
+#endif\r
 \r
   if (len * sizeof(WCHAR) < sizeof(buffer))\r
     {\r
@@ -239,6 +247,7 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d
          //      thunk_list->u1.Function = (ULONG_PTR)find_ordinal_export( imp_mod, exports, exp_size,\r
          //                                                                ordinal - exports->Base, load_path );\r
 \r
+#ifdef USE_DLMALLOC\r
          if (iscoredll)\r
            {\r
 #define COREDLL_MALLOC 1041\r
@@ -258,6 +267,7 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d
                thunk_list->u1.Function = (PWORD)(ULONG_PTR)GetProcAddress (imp_mod, (void *) (ordinal & 0xffff));\r
            }\r
          else\r
+#endif\r
            thunk_list->u1.Function = (PDWORD)(ULONG_PTR)GetProcAddress (imp_mod, (void *) (ordinal & 0xffff));\r
 \r
          if (!thunk_list->u1.Function)\r
@@ -279,6 +289,7 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d
          //                                                              (const char*)pe_name->Name,\r
          //                                                              pe_name->Hint, load_path );\r
 \r
+#ifdef USE_DLMALLOC\r
          if (iscoredll)\r
            {\r
              if (! strcmp (symname, "malloc"))\r
@@ -293,6 +304,7 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d
                thunk_list->u1.Function = (PDWORD)(ULONG_PTR)GetProcAddressA (imp_mod, symname);\r
            }\r
          else\r
+#endif\r
            thunk_list->u1.Function = (PDWORD)(ULONG_PTR)GetProcAddressA (imp_mod, (const char*)pe_name->Name);\r
          if (!thunk_list->u1.Function)\r
             {\r