Changeset 1872 for trunk/src/kernel32/resource.cpp
- Timestamp:
- Nov 29, 1999, 1:05:03 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/resource.cpp
r956 r1872 1 /* $Id: resource.cpp,v 1. 9 1999-09-15 23:38:01 sandervlExp $ */1 /* $Id: resource.cpp,v 1.10 1999-11-29 00:04:05 bird Exp $ */ 2 2 3 3 /* … … 27 27 28 28 dprintf(("FindResourceA %X", hModule)); 29 if(hModule == 0 || hModule == -1 || (WinExe != NULL && hModule == 30 WinExe->getInstanceHandle())) 31 { 32 module = (Win32ImageBase *)WinExe; 33 } 34 else module = (Win32ImageBase *)Win32DllBase::findModule(hModule); 35 29 module = Win32ImageBase::findModule(hModule); 36 30 if(module == NULL) 37 31 return(NULL); 38 32 39 33 return module->findResourceA(lpszName, (LPSTR)lpszType); … … 42 36 //****************************************************************************** 43 37 HRSRC WIN32API FindResourceW(HINSTANCE hModule, LPCWSTR lpszName, 44 38 LPCWSTR lpszType) 45 39 { 46 40 Win32ImageBase *module; 47 41 48 42 dprintf(("FindResourceW %X", hModule)); 49 if(hModule == 0 || hModule == -1 || (WinExe != NULL && hModule == 50 WinExe->getInstanceHandle())) 51 { 52 module = (Win32ImageBase *)WinExe; 53 } 54 else module = (Win32ImageBase *)Win32DllBase::findModule(hModule); 55 43 module = Win32ImageBase::findModule(hModule); 56 44 if(module == NULL) 57 45 return(NULL); 58 46 59 47 return module->findResourceW((LPWSTR)lpszName, (LPWSTR)lpszType); … … 77 65 /* @@@PH */ 78 66 if (HIWORD(res) == NULL) { 79 80 67 dprintf(("LoadResource %x: invalid hRes %x", hModule, hRes)); 68 return 0; 81 69 } 82 70 else return (HGLOBAL)res->lockResource(); … … 96 84 } 97 85 //****************************************************************************** 98 //****************************************************************************** 99 BOOL WIN32API EnumResourceNamesA(HINSTANCE hModule, LPCTSTR lpszType, 100 ENUMRESNAMEPROCA lpEnumFunc, LONG lParam) 86 87 88 89 /** 90 * The EnumResourceNames function searches a module for each 91 * resource of the specified type and passes the name of each 92 * resource it locates to an application-defined callback function 93 * 94 * @returns If the function succeeds, the return value is nonzero. 95 * If the function fails, the return value is zero 96 * @param hModule resource-module handling 97 * @param lpszType pointer to resource type 98 * @param lpEnumFunc pointer to callback function 99 * @param lParam application-defined parameter 100 * @status stub 101 * @author knut st. osmundsen 102 * @remark The EnumResourceNames function continues to enumerate resource 103 * names until the callback function returns FALSE or all resource 104 * names have been enumerated 105 */ 106 BOOL WIN32API EnumResourceNamesA(HINSTANCE hModule, 107 LPCTSTR lpszType, 108 ENUMRESNAMEPROCA lpEnumFunc, 109 LONG lParam) 101 110 { 102 dprintf(("OS2EnumResourceNamesA - stub\n")); 103 return(FALSE); 111 Win32ImageBase *pModule; 112 113 dprintf(("KERNEL32:EnumResourceNamesA(%08x,%08x,%08x,%08x) not implemented\n", 114 hModule, lpszType, lpEnumFunc, lParam 115 )); 116 117 pModule = Win32ImageBase::findModule(hModule); 118 if (pModule == NULL) 119 { 120 SetLastError(ERROR_RESOURCE_DATA_NOT_FOUND); 121 return FALSE; 122 } 123 124 return pModule->enumResourceNamesA(hModule, lpszType, lpEnumFunc, lParam); 104 125 } 105 //****************************************************************************** 106 //****************************************************************************** 126 127 128 /** 129 * The EnumResourceNames function searches a module for each 130 * resource of the specified type and passes the name of each 131 * resource it locates to an application-defined callback function 132 * 133 * @returns If the function succeeds, the return value is nonzero. 134 * If the function fails, the return value is zero 135 * @param hModule resource-module handling 136 * @param lpszType pointer to resource type 137 * @param lpEnumFunc pointer to callback function 138 * @param lParam application-defined parameter 139 * @status stub 140 * @author knut st. osmundsen 141 * @remark The EnumResourceNames function continues to enumerate resource 142 * names until the callback function returns FALSE or all resource 143 * names have been enumerated 144 */ 145 BOOL WIN32API EnumResourceNamesW(HMODULE hModule, 146 LPCWSTR lpszType, 147 ENUMRESNAMEPROCW lpEnumFunc, 148 LONG lParam) 149 { 150 Win32ImageBase *pModule; 151 152 dprintf(("KERNEL32:EnumResourceNamesW(%08x,%08x,%08x,%08x)\n", 153 hModule, lpszType, lpEnumFunc, lParam)); 154 155 pModule = Win32ImageBase::findModule(hModule); 156 if (pModule == NULL) 157 { 158 SetLastError(ERROR_RESOURCE_DATA_NOT_FOUND); 159 return FALSE; 160 } 161 162 return pModule->enumResourceNamesW(hModule, lpszType, lpEnumFunc, lParam); 163 } 164
Note:
See TracChangeset
for help on using the changeset viewer.