- Timestamp:
- Nov 18, 2002, 2:54:12 PM (23 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/KERNEL32.DEF
r8938 r9411 1 ; $Id: KERNEL32.DEF,v 1.14 4 2002-07-30 12:55:04sandervl Exp $1 ; $Id: KERNEL32.DEF,v 1.145 2002-11-18 13:53:53 sandervl Exp $ 2 2 3 3 ;Basis is Windows95 KERNEL32 … … 1195 1195 1196 1196 _SetRegistryRootKey@8 @2013 NONAME 1197 _SetCustomBuildName@ 8@2014 NONAME1197 _SetCustomBuildName@12 @2014 NONAME 1198 1198 _RegisterCustomDriver@36 @2015 NONAME 1199 1199 -
trunk/src/kernel32/kernel32dbg.def
r8938 r9411 1 ; $Id: kernel32dbg.def,v 1. 19 2002-07-30 12:55:05sandervl Exp $1 ; $Id: kernel32dbg.def,v 1.20 2002-11-18 13:53:54 sandervl Exp $ 2 2 3 3 ;Basis is Windows95 KERNEL32 … … 1195 1195 1196 1196 _SetRegistryRootKey@8 @2013 NONAME 1197 _SetCustomBuildName@ 8@2014 NONAME1197 _SetCustomBuildName@12 @2014 NONAME 1198 1198 _RegisterCustomDriver@36 @2015 NONAME 1199 1199 -
trunk/src/kernel32/windlllx.cpp
r8462 r9411 1 /* $Id: windlllx.cpp,v 1.2 5 2002-05-21 14:42:40sandervl Exp $ */1 /* $Id: windlllx.cpp,v 1.26 2002-11-18 13:53:54 sandervl Exp $ */ 2 2 3 3 /* … … 40 40 #include "dbglocal.h" 41 41 42 char *lpszCustomDllName = NULL; 43 ULONG dwOrdinalBase = 0; 44 45 //****************************************************************************** 46 //****************************************************************************** 47 void WIN32API SetCustomBuildName(char *lpszName, DWORD ordinalbase) 48 { 49 lpszCustomDllName = lpszName; 50 dwOrdinalBase = ordinalbase; 42 char *lpszCustomDllName = NULL; 43 char *lpszCustomExportPrefix = NULL; 44 ULONG dwOrdinalBase = 0; 45 46 //****************************************************************************** 47 //****************************************************************************** 48 void WIN32API SetCustomBuildName(char *lpszName, DWORD ordinalbase, 49 char *lpszExportPrefix) 50 { 51 lpszCustomDllName = lpszName; 52 dwOrdinalBase = ordinalbase; 53 lpszCustomExportPrefix = lpszExportPrefix; 51 54 } 52 55 //****************************************************************************** -
trunk/src/kernel32/windlllx.h
r8462 r9411 1 /* $Id: windlllx.h,v 1. 7 2002-05-21 14:42:40sandervl Exp $ */1 /* $Id: windlllx.h,v 1.8 2002-11-18 13:53:54 sandervl Exp $ */ 2 2 3 3 /* … … 47 47 }; 48 48 49 extern char *lpszCustomDllName ;49 extern char *lpszCustomDllName, *lpszCustomExportPrefix; 50 50 extern DWORD dwOrdinalBase; 51 51 -
trunk/src/kernel32/winimagelx.cpp
r8887 r9411 1 /* $Id: winimagelx.cpp,v 1.1 7 2002-07-18 12:01:34 achimhaExp $ */1 /* $Id: winimagelx.cpp,v 1.18 2002-11-18 13:53:54 sandervl Exp $ */ 2 2 3 3 /* … … 73 73 if(lpszCustomDllName) { 74 74 name = lpszCustomDllName; 75 this->dwOrdinalBase = ::dwOrdinalBase; 75 this->dwOrdinalBase = ::dwOrdinalBase; 76 77 if(lpszCustomExportPrefix) { 78 this->lpszExportPrefix = strdup(::lpszCustomExportPrefix); 79 } 76 80 } 77 81 else { 78 82 name = OSLibGetDllName(hinstance); 79 this->dwOrdinalBase = 0; 83 this->dwOrdinalBase = 0; 84 this->lpszExportPrefix = NULL; 80 85 } 81 86 … … 97 102 Win32LxImage::~Win32LxImage() 98 103 { 104 if(lpszExportPrefix) free(lpszExportPrefix); 105 99 106 if(header) { 100 107 DosFreeMem(header); … … 108 115 ULONG apiaddr; 109 116 117 if(lpszExportPrefix) 118 {//if this dll exports by name with a prefix, then concatenate the prefix 119 //with the export name to get the OS/2 export name 120 char *lpszNewName = (char *)alloca(strlen(name) + strlen(lpszExportPrefix)+1); 121 if(lpszNewName == NULL) { 122 DebugInt3(); 123 return 0; 124 } 125 strcpy(lpszNewName, lpszExportPrefix); 126 strcat(lpszNewName, name); 127 rc = DosQueryProcAddr(hinstanceOS2, 0, lpszNewName, (PFN *)&apiaddr); 128 if(rc == NO_ERROR) { 129 return(apiaddr); 130 } 131 //else try with the normal name 132 } 110 133 rc = DosQueryProcAddr(hinstanceOS2, 0, name, (PFN *)&apiaddr); 111 134 if(rc) 112 135 { 113 114 136 dprintf(("Win32LxImage::getApi %x %s -> rc = %d", hinstanceOS2, name, rc)); 137 return(0); 115 138 } 116 139 return(apiaddr); … … 123 146 ULONG apiaddr; 124 147 125 rc = DosQueryProcAddr(hinstanceOS2, dwOrdinalBase +ordinal, NULL, (PFN *)&apiaddr);148 rc = DosQueryProcAddr(hinstanceOS2, dwOrdinalBase+ordinal, NULL, (PFN *)&apiaddr); 126 149 if(rc) { 127 150 dprintf(("Win32LxImage::getApi %x %d -> rc = %d", hinstanceOS2, ordinal, rc)); … … 131 154 } 132 155 //****************************************************************************** 133 // here we build a fake PE header for an LX module. In Windows, HINSTANCE handles134 // actually contain the virtual address of of the PE header. We try to fill in135 // sensible values as much as possible...136 156 //****************************************************************************** 137 157 LPVOID Win32LxImage::buildHeader(DWORD MajorImageVersion, DWORD MinorImageVersion, … … 144 164 DWORD *ntsig; 145 165 146 // AH TODO: we are wasting 60k address space here!!!! (at least without PAG_ANY)147 166 rc = DosAllocMem(&header, 4096, PAG_READ | PAG_WRITE | PAG_COMMIT | flAllocMem); 148 167 if(rc) { 149 168 dprintf(("ERROR: buildHeader DosAllocMem failed!! (rc=%x)", rc)); 150 169 DebugInt3(); 151 170 return NULL; 152 171 } 153 172 memcpy(header, dosHeader, sizeof(dosHeader)); -
trunk/src/kernel32/winimagelx.h
r7797 r9411 1 /* $Id: winimagelx.h,v 1. 6 2002-02-03 13:16:23sandervl Exp $ */1 /* $Id: winimagelx.h,v 1.7 2002-11-18 13:53:55 sandervl Exp $ */ 2 2 3 3 /* … … 30 30 HINSTANCE getHMOD() const { return hinstanceOS2; } 31 31 protected: 32 LPVOID header;32 LPVOID header; 33 33 HINSTANCE hinstanceOS2; 34 DWORD dwOrdinalBase; 34 DWORD dwOrdinalBase; 35 LPSTR lpszExportPrefix; 35 36 private: 36 37 };
Note:
See TracChangeset
for help on using the changeset viewer.