kernel32: Make the return type of LoadModule match the Windows SDK.

This commit is contained in:
Andrew Nguyen 2010-10-11 05:16:51 -05:00 committed by Alexandre Julliard
parent 43e99d6e0c
commit 6d605e68f4
2 changed files with 11 additions and 11 deletions

View File

@ -2297,25 +2297,25 @@ UINT WINAPI WinExec( LPCSTR lpCmdLine, UINT nCmdShow )
/********************************************************************** /**********************************************************************
* LoadModule (KERNEL32.@) * LoadModule (KERNEL32.@)
*/ */
HINSTANCE WINAPI LoadModule( LPCSTR name, LPVOID paramBlock ) DWORD WINAPI LoadModule( LPCSTR name, LPVOID paramBlock )
{ {
LOADPARMS32 *params = paramBlock; LOADPARMS32 *params = paramBlock;
PROCESS_INFORMATION info; PROCESS_INFORMATION info;
STARTUPINFOA startup; STARTUPINFOA startup;
HINSTANCE hInstance; DWORD ret;
LPSTR cmdline, p; LPSTR cmdline, p;
char filename[MAX_PATH]; char filename[MAX_PATH];
BYTE len; BYTE len;
if (!name) return (HINSTANCE)ERROR_FILE_NOT_FOUND; if (!name) return ERROR_FILE_NOT_FOUND;
if (!SearchPathA( NULL, name, ".exe", sizeof(filename), filename, NULL ) && if (!SearchPathA( NULL, name, ".exe", sizeof(filename), filename, NULL ) &&
!SearchPathA( NULL, name, NULL, sizeof(filename), filename, NULL )) !SearchPathA( NULL, name, NULL, sizeof(filename), filename, NULL ))
return ULongToHandle(GetLastError()); return GetLastError();
len = (BYTE)params->lpCmdLine[0]; len = (BYTE)params->lpCmdLine[0];
if (!(cmdline = HeapAlloc( GetProcessHeap(), 0, strlen(filename) + len + 2 ))) if (!(cmdline = HeapAlloc( GetProcessHeap(), 0, strlen(filename) + len + 2 )))
return (HINSTANCE)ERROR_NOT_ENOUGH_MEMORY; return ERROR_NOT_ENOUGH_MEMORY;
strcpy( cmdline, filename ); strcpy( cmdline, filename );
p = cmdline + strlen(cmdline); p = cmdline + strlen(cmdline);
@ -2337,19 +2337,19 @@ HINSTANCE WINAPI LoadModule( LPCSTR name, LPVOID paramBlock )
/* Give 30 seconds to the app to come up */ /* Give 30 seconds to the app to come up */
if (wait_input_idle( info.hProcess, 30000 ) == WAIT_FAILED) if (wait_input_idle( info.hProcess, 30000 ) == WAIT_FAILED)
WARN("WaitForInputIdle failed: Error %d\n", GetLastError() ); WARN("WaitForInputIdle failed: Error %d\n", GetLastError() );
hInstance = (HINSTANCE)33; ret = 33;
/* Close off the handles */ /* Close off the handles */
CloseHandle( info.hThread ); CloseHandle( info.hThread );
CloseHandle( info.hProcess ); CloseHandle( info.hProcess );
} }
else if ((hInstance = ULongToHandle(GetLastError())) >= (HINSTANCE)32) else if ((ret = GetLastError()) >= 32)
{ {
FIXME("Strange error set by CreateProcess: %p\n", hInstance ); FIXME("Strange error set by CreateProcess: %u\n", ret );
hInstance = (HINSTANCE)11; ret = 11;
} }
HeapFree( GetProcessHeap(), 0, cmdline ); HeapFree( GetProcessHeap(), 0, cmdline );
return hInstance; return ret;
} }

View File

@ -1887,7 +1887,7 @@ WINBASEAPI HMODULE WINAPI LoadLibraryW(LPCWSTR);
WINBASEAPI HMODULE WINAPI LoadLibraryExA(LPCSTR,HANDLE,DWORD); WINBASEAPI HMODULE WINAPI LoadLibraryExA(LPCSTR,HANDLE,DWORD);
WINBASEAPI HMODULE WINAPI LoadLibraryExW(LPCWSTR,HANDLE,DWORD); WINBASEAPI HMODULE WINAPI LoadLibraryExW(LPCWSTR,HANDLE,DWORD);
#define LoadLibraryEx WINELIB_NAME_AW(LoadLibraryEx) #define LoadLibraryEx WINELIB_NAME_AW(LoadLibraryEx)
WINBASEAPI HINSTANCE WINAPI LoadModule(LPCSTR,LPVOID); WINBASEAPI DWORD WINAPI LoadModule(LPCSTR,LPVOID);
WINBASEAPI HGLOBAL WINAPI LoadResource(HMODULE,HRSRC); WINBASEAPI HGLOBAL WINAPI LoadResource(HMODULE,HRSRC);
WINBASEAPI HLOCAL WINAPI LocalAlloc(UINT,SIZE_T) __WINE_ALLOC_SIZE(2); WINBASEAPI HLOCAL WINAPI LocalAlloc(UINT,SIZE_T) __WINE_ALLOC_SIZE(2);
WINBASEAPI SIZE_T WINAPI LocalCompact(UINT); WINBASEAPI SIZE_T WINAPI LocalCompact(UINT);