- Timestamp:
- Jun 8, 2000, 8:08:58 PM (25 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/HandleManager.cpp
r3642 r3678 1 /* $Id: HandleManager.cpp,v 1.4 0 2000-06-01 11:28:42sandervl Exp $ */1 /* $Id: HandleManager.cpp,v 1.41 2000-06-08 18:08:54 sandervl Exp $ */ 2 2 3 3 /* … … 1016 1016 { 1017 1017 TabWin32Handles[iIndexNew].hmHandleData.hHMHandle = INVALID_HANDLE_VALUE; 1018 SetLastError( rc); /* Hehe, OS/2 and NT are pretty compatible :) */1018 SetLastError(pOFStruct->nErrCode); 1019 1019 return (INVALID_HANDLE_VALUE); /* signal error */ 1020 1020 } -
trunk/src/kernel32/hmfile.cpp
r3642 r3678 1 /* $Id: hmfile.cpp,v 1. 1 2000-06-01 11:28:46 sandervl Exp $ */1 /* $Id: hmfile.cpp,v 1.2 2000-06-08 18:08:56 sandervl Exp $ */ 2 2 3 3 /* … … 137 137 SetLastError(ERROR_SUCCESS); 138 138 139 dprintf(("KERNEL32: HMDeviceFileClass::OpenFile %s(%s,%08x,%08x,%08x) - stub?\n",139 dprintf(("KERNEL32: HMDeviceFileClass::OpenFile %s(%s,%08x,%08x,%08x)", 140 140 lpHMDeviceName, 141 141 lpFileName, … … 165 165 166 166 if(SearchPathA(NULL, lpFileName, NULL, sizeof(filepath), filepath, &filenameinpath) == 0 167 && !(fuMode & OF_CREATE) ) { 167 && !(fuMode & OF_CREATE) ) 168 { 169 pOFStruct->nErrCode = ERROR_FILE_NOT_FOUND; 168 170 SetLastError(ERROR_FILE_NOT_FOUND); 169 171 return HFILE_ERROR; -
trunk/src/kernel32/registry.cpp
r2984 r3678 1 /* $Id: registry.cpp,v 1. 1 2000-03-03 11:15:59sandervl Exp $ */1 /* $Id: registry.cpp,v 1.2 2000-06-08 18:08:56 sandervl Exp $ */ 2 2 3 3 /* … … 30 30 #include "unicode.h" 31 31 #include <winreg.h> 32 33 #define DBG_LOCALLOG DBG_registry 34 #include "dbglocal.h" 32 35 33 36 … … 789 792 790 793 ODINFUNCTION4(LONG,RegQueryValueW,HKEY, hkey, 791 792 793 794 LPCWSTR,lpszSubKey, 795 LPWSTR, lpszValue, 796 PLONG, pcbValue) 794 797 { 795 798 char *astring1 = UnicodeToAsciiString((LPWSTR)lpszSubKey); … … 803 806 if(rc == ERROR_SUCCESS) 804 807 { 805 astring2 = (char *)malloc(*pcbValue); 806 strcpy(astring2, (char *)lpszValue); 807 AsciiToUnicode(astring2, lpszValue); 808 free(astring2); 808 if(pcbValue) { 809 astring2 = (char *)malloc(*pcbValue); 810 strcpy(astring2, (char *)lpszValue); 811 AsciiToUnicode(astring2, lpszValue); 812 free(astring2); 813 } 809 814 } 815 FreeAsciiString(astring1); 810 816 return(rc); 811 817 } … … 918 924 919 925 ODINFUNCTION5(LONG,RegSetValueW,HKEY, hkey, 920 921 922 923 926 LPCWSTR,lpSubKey, 927 DWORD, dwType, 928 LPCWSTR,lpData, 929 DWORD, cbData) 924 930 { 925 931 char *astring1 = UnicodeToAsciiString((LPWSTR)lpSubKey); … … 956 962 957 963 ODINFUNCTION6(LONG,RegSetValueExA,HKEY, arg1, 958 959 960 961 962 964 LPSTR, arg2, 965 DWORD, arg3, 966 DWORD, arg4, 967 BYTE*, arg5, 968 DWORD, arg6) 963 969 { 964 970 return _O32_RegSetValueEx(ConvertKey(arg1), -
trunk/src/kernel32/winimagebase.cpp
r3625 r3678 1 /* $Id: winimagebase.cpp,v 1.2 1 2000-05-28 16:45:12sandervl Exp $ */1 /* $Id: winimagebase.cpp,v 1.22 2000-06-08 18:08:56 sandervl Exp $ */ 2 2 3 3 /* … … 37 37 #include "directory.h" 38 38 #include <win\virtual.h> 39 #include <winconst.h> 39 40 40 41 #define DBG_LOCALLOG DBG_winimagebase … … 200 201 } 201 202 //****************************************************************************** 202 //****************************************************************************** 203 BOOL Win32ImageBase::isPEImage(char *szFileName) 203 //returns ERROR_SUCCESS or error code 204 //****************************************************************************** 205 ULONG Win32ImageBase::isPEImage(char *szFileName) 204 206 { 205 207 char filename[CCHMAXPATH]; … … 219 221 dprintf(("KERNEL32:Win32ImageBase::isPEImage(%s) findDll failed to find the file.\n", 220 222 szFileName, rc)); 221 return FALSE;223 return ERROR_FILE_NOT_FOUND_W; 222 224 } 223 225 rc = DosOpen(filename, /* File path name */ … … 237 239 dprintf(("KERNEL32:Win32ImageBase::isPEImage(%s) failed with %u\n", 238 240 szFileName, rc)); 239 return (FALSE);241 return ERROR_FILE_NOT_FOUND_W; 240 242 } 241 243 … … 246 248 if(pdoshdr == NULL) { 247 249 DosClose(win32handle); /* Close the file */ 248 return (FALSE);250 return ERROR_INVALID_EXE_SIGNATURE_W; 249 251 } 250 252 rc = DosRead(win32handle, pdoshdr, sizeof(IMAGE_DOS_HEADER), &ulRead); 251 253 if(rc != NO_ERROR) { 252 254 DosClose(win32handle); /* Close the file */ 253 return (FALSE);255 return ERROR_INVALID_EXE_SIGNATURE_W; 254 256 } 255 257 ULONG hdrsize = pdoshdr->e_lfanew + SIZE_OF_NT_SIGNATURE + sizeof(IMAGE_FILE_HEADER); … … 262 264 if(win32file == NULL) { 263 265 DosClose(win32handle); /* Close the file */ 264 return (FALSE);266 return ERROR_NOT_ENOUGH_MEMORY_W; 265 267 } 266 268 rc = DosRead(win32handle, win32file, hdrsize, &ulRead); … … 284 286 } 285 287 DosClose(win32handle); 286 return (TRUE);288 return ERROR_SUCCESS_W; 287 289 288 290 failure: 289 291 free(win32file); 290 292 DosClose(win32handle); 291 return (FALSE);293 return ERROR_INVALID_EXE_SIGNATURE_W; 292 294 } 293 295 //****************************************************************************** -
trunk/src/kernel32/winimagebase.h
r3625 r3678 1 /* $Id: winimagebase.h,v 1.1 0 2000-05-28 16:45:12sandervl Exp $ */1 /* $Id: winimagebase.h,v 1.11 2000-06-08 18:08:57 sandervl Exp $ */ 2 2 3 3 /* … … 87 87 ULONG getResourceSize(HRSRC hResource); 88 88 89 static BOOL isPEImage(char *szFileName); 89 //returns ERROR_SUCCESS or error code 90 static ULONG isPEImage(char *szFileName); 90 91 static BOOL findDll(const char *pszFileName, char *pszFullName, 91 92 int cchFullName, const char *pszAltPath = NULL); -
trunk/src/kernel32/winimagepeldr.cpp
r3642 r3678 1 /* $Id: winimagepeldr.cpp,v 1.4 6 2000-06-01 11:28:48sandervl Exp $ */1 /* $Id: winimagepeldr.cpp,v 1.47 2000-06-08 18:08:57 sandervl Exp $ */ 2 2 3 3 /* … … 1343 1343 Win32DllBase::renameDll(modname); 1344 1344 1345 if(isPEImage(modname) == FALSE)1345 if(isPEImage(modname) != ERROR_SUCCESS_W) 1346 1346 {//LX image, so let OS/2 do all the work for us 1347 1347 APIRET rc; -
trunk/src/kernel32/wprocess.cpp
r3588 r3678 1 /* $Id: wprocess.cpp,v 1.8 1 2000-05-22 19:08:01sandervl Exp $ */1 /* $Id: wprocess.cpp,v 1.82 2000-06-08 18:08:58 sandervl Exp $ */ 2 2 3 3 /* … … 661 661 BOOL fPath; /* Flags which is set if the */ 662 662 /* lpszLibFile contains a path. */ 663 BOOLfPE; /* isPEImage return value. */663 ULONG fPE; /* isPEImage return value. */ 664 664 665 665 /** @sketch … … 802 802 */ 803 803 fPE = Win32ImageBase::isPEImage(szModname); 804 if (fPE)804 if(fPE == ERROR_SUCCESS) 805 805 { 806 806 Win32PeLdrDll * peldrDll; … … 887 887 else 888 888 { 889 dprintf(("KERNEL32: LoadLibraryExA(%s, 0x%x, 0x%x) library w ere found (%s) but it's not loadable!",890 lpszLibFile, hFile, dwFlags, szModname ));891 SetLastError( ERROR_INVALID_EXE_SIGNATURE);889 dprintf(("KERNEL32: LoadLibraryExA(%s, 0x%x, 0x%x) library wasn't found (%s) or isn't loadable; err %x", 890 lpszLibFile, hFile, dwFlags, szModname, fPE)); 891 SetLastError(fPE); 892 892 } 893 893 … … 1370 1370 if(winimage == NULL) 1371 1371 { 1372 char modname[CCHMAXPATH];1372 char modname[CCHMAXPATH]; 1373 1373 1374 1374 strcpy(modname, lpszModName); … … 1376 1376 Win32DllBase::renameDll(modname); 1377 1377 1378 if(Win32ImageBase::isPEImage(modname) == FALSE)1379 1378 if(Win32ImageBase::isPEImage(modname) != ERROR_SUCCESS) 1379 { 1380 1380 HINSTANCE hInstance; 1381 1381 … … 1431 1431 Win32DllBase::renameDll(modname); 1432 1432 1433 if(Win32ImageBase::isPEImage(modname) == FALSE)1434 1433 if(Win32ImageBase::isPEImage(modname) != ERROR_SUCCESS) 1434 { 1435 1435 HINSTANCE hInstance; 1436 1436
Note:
See TracChangeset
for help on using the changeset viewer.