Commit 267ca682 authored by Alexandre Julliard's avatar Alexandre Julliard

Fixed HANDLE<->HFILE conversions, since they will be different types

when handles are void*.
parent 04b5a86c
...@@ -33,7 +33,7 @@ typedef struct ...@@ -33,7 +33,7 @@ typedef struct
DC *dc; DC *dc;
ENHMETAHEADER *emh; /* Pointer to enhanced metafile header */ ENHMETAHEADER *emh; /* Pointer to enhanced metafile header */
UINT nextHandle; /* Next handle number */ UINT nextHandle; /* Next handle number */
HFILE hFile; /* HFILE for disk based MetaFile */ HANDLE hFile; /* Handle for disk based MetaFile */
} EMFDRV_PDEVICE; } EMFDRV_PDEVICE;
...@@ -139,4 +139,3 @@ extern BOOL EMFDRV_WidenPath( PHYSDEV dev ); ...@@ -139,4 +139,3 @@ extern BOOL EMFDRV_WidenPath( PHYSDEV dev );
#endif /* __WINE_METAFILEDRV_H */ #endif /* __WINE_METAFILEDRV_H */
...@@ -277,7 +277,7 @@ HDC WINAPI CreateEnhMetaFileW( ...@@ -277,7 +277,7 @@ HDC WINAPI CreateEnhMetaFileW(
DC *dc; DC *dc;
HDC hRefDC = hdc ? hdc : CreateDCA("DISPLAY",NULL,NULL,NULL); /* If no ref, use current display */ HDC hRefDC = hdc ? hdc : CreateDCA("DISPLAY",NULL,NULL,NULL); /* If no ref, use current display */
EMFDRV_PDEVICE *physDev; EMFDRV_PDEVICE *physDev;
HFILE hFile; HANDLE hFile;
DWORD size = 0, length = 0; DWORD size = 0, length = 0;
TRACE("%s\n", debugstr_w(filename) ); TRACE("%s\n", debugstr_w(filename) );
......
...@@ -219,7 +219,7 @@ HDC16 WINAPI CreateMetaFile16( ...@@ -219,7 +219,7 @@ HDC16 WINAPI CreateMetaFile16(
HDC ret; HDC ret;
DC *dc; DC *dc;
METAFILEDRV_PDEVICE *physDev; METAFILEDRV_PDEVICE *physDev;
HFILE hFile; HANDLE hFile;
TRACE("'%s'\n", filename ); TRACE("'%s'\n", filename );
......
...@@ -33,7 +33,7 @@ typedef struct ...@@ -33,7 +33,7 @@ typedef struct
DC *dc; DC *dc;
METAHEADER *mh; /* Pointer to metafile header */ METAHEADER *mh; /* Pointer to metafile header */
UINT nextHandle; /* Next handle number */ UINT nextHandle; /* Next handle number */
HFILE hFile; /* HFILE for disk based MetaFile */ HANDLE hFile; /* Handle for disk based MetaFile */
} METAFILEDRV_PDEVICE; } METAFILEDRV_PDEVICE;
...@@ -152,4 +152,3 @@ extern BOOL MFDRV_StrokePath( PHYSDEV dev ); ...@@ -152,4 +152,3 @@ extern BOOL MFDRV_StrokePath( PHYSDEV dev );
extern BOOL MFDRV_WidenPath( PHYSDEV dev ); extern BOOL MFDRV_WidenPath( PHYSDEV dev );
#endif /* __WINE_METAFILEDRV_H */ #endif /* __WINE_METAFILEDRV_H */
...@@ -2044,7 +2044,7 @@ int TLB_ReadTypeLib(LPCWSTR pszFileName, INT index, ITypeLib2 **ppTypeLib) ...@@ -2044,7 +2044,7 @@ int TLB_ReadTypeLib(LPCWSTR pszFileName, INT index, ITypeLib2 **ppTypeLib)
{ {
int ret = TYPE_E_CANTLOADLIBRARY; int ret = TYPE_E_CANTLOADLIBRARY;
DWORD dwSignature = 0; DWORD dwSignature = 0;
HFILE hFile; HANDLE hFile;
TRACE_(typelib)("%s:%d\n", debugstr_w(pszFileName), index); TRACE_(typelib)("%s:%d\n", debugstr_w(pszFileName), index);
......
...@@ -251,7 +251,7 @@ static HRESULT ICO_ExtractIconExW( ...@@ -251,7 +251,7 @@ static HRESULT ICO_ExtractIconExW(
HGLOBAL hRet = E_FAIL; HGLOBAL hRet = E_FAIL;
LPBYTE pData; LPBYTE pData;
DWORD sig; DWORD sig;
HFILE hFile; HANDLE hFile;
UINT16 iconDirCount = 0,iconCount = 0; UINT16 iconDirCount = 0,iconCount = 0;
LPBYTE peimage; LPBYTE peimage;
HANDLE fmapping; HANDLE fmapping;
...@@ -676,4 +676,3 @@ HRESULT WINAPI PrivateExtractIconExA ( ...@@ -676,4 +676,3 @@ HRESULT WINAPI PrivateExtractIconExA (
HeapFree(GetProcessHeap(), 0, lpwstrFile); HeapFree(GetProcessHeap(), 0, lpwstrFile);
return ret; return ret;
} }
...@@ -342,7 +342,7 @@ BOOL WINAPI MZ_Exec( CONTEXT86 *context, LPCSTR filename, BYTE func, LPVOID para ...@@ -342,7 +342,7 @@ BOOL WINAPI MZ_Exec( CONTEXT86 *context, LPCSTR filename, BYTE func, LPVOID para
* (i.e. one DOS app spawning another) */ * (i.e. one DOS app spawning another) */
/* FIXME: do we want to check binary type first, to check /* FIXME: do we want to check binary type first, to check
* whether it's a NE/PE executable? */ * whether it's a NE/PE executable? */
HFILE hFile = CreateFileA( filename, GENERIC_READ, FILE_SHARE_READ, HANDLE hFile = CreateFileA( filename, GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING, 0, 0); NULL, OPEN_EXISTING, 0, 0);
BOOL ret = FALSE; BOOL ret = FALSE;
if (hFile == INVALID_HANDLE_VALUE) return FALSE; if (hFile == INVALID_HANDLE_VALUE) return FALSE;
......
...@@ -684,7 +684,7 @@ BOOL DOSFS_FindUnixName( LPCSTR path, LPCSTR name, LPSTR long_buf, ...@@ -684,7 +684,7 @@ BOOL DOSFS_FindUnixName( LPCSTR path, LPCSTR name, LPSTR long_buf,
*/ */
const DOS_DEVICE *DOSFS_GetDevice( const char *name ) const DOS_DEVICE *DOSFS_GetDevice( const char *name )
{ {
int i; unsigned int i;
const char *p; const char *p;
if (!name) return NULL; /* if FILE_DupUnixHandle was used */ if (!name) return NULL; /* if FILE_DupUnixHandle was used */
...@@ -707,7 +707,7 @@ const DOS_DEVICE *DOSFS_GetDevice( const char *name ) ...@@ -707,7 +707,7 @@ const DOS_DEVICE *DOSFS_GetDevice( const char *name )
/*********************************************************************** /***********************************************************************
* DOSFS_GetDeviceByHandle * DOSFS_GetDeviceByHandle
*/ */
const DOS_DEVICE *DOSFS_GetDeviceByHandle( HFILE hFile ) const DOS_DEVICE *DOSFS_GetDeviceByHandle( HANDLE hFile )
{ {
const DOS_DEVICE *ret = NULL; const DOS_DEVICE *ret = NULL;
SERVER_START_REQ( get_file_info ) SERVER_START_REQ( get_file_info )
...@@ -769,7 +769,7 @@ static HANDLE DOSFS_CreateCommPort(LPCSTR name, DWORD access, DWORD attributes, ...@@ -769,7 +769,7 @@ static HANDLE DOSFS_CreateCommPort(LPCSTR name, DWORD access, DWORD attributes,
*/ */
HANDLE DOSFS_OpenDevice( const char *name, DWORD access, DWORD attributes, LPSECURITY_ATTRIBUTES sa ) HANDLE DOSFS_OpenDevice( const char *name, DWORD access, DWORD attributes, LPSECURITY_ATTRIBUTES sa )
{ {
int i; unsigned int i;
const char *p; const char *p;
HANDLE handle; HANDLE handle;
......
...@@ -95,7 +95,7 @@ extern void DOSFS_UnixTimeToFileTime( time_t unixtime, LPFILETIME ft, ...@@ -95,7 +95,7 @@ extern void DOSFS_UnixTimeToFileTime( time_t unixtime, LPFILETIME ft,
extern time_t DOSFS_FileTimeToUnixTime( const FILETIME *ft, DWORD *remainder ); extern time_t DOSFS_FileTimeToUnixTime( const FILETIME *ft, DWORD *remainder );
extern BOOL DOSFS_ToDosFCBFormat( LPCSTR name, LPSTR buffer ); extern BOOL DOSFS_ToDosFCBFormat( LPCSTR name, LPSTR buffer );
extern const DOS_DEVICE *DOSFS_GetDevice( const char *name ); extern const DOS_DEVICE *DOSFS_GetDevice( const char *name );
extern const DOS_DEVICE *DOSFS_GetDeviceByHandle( HFILE hFile ); extern const DOS_DEVICE *DOSFS_GetDeviceByHandle( HANDLE hFile );
extern HANDLE DOSFS_OpenDevice( const char *name, DWORD access, DWORD attributes, LPSECURITY_ATTRIBUTES sa); extern HANDLE DOSFS_OpenDevice( const char *name, DWORD access, DWORD attributes, LPSECURITY_ATTRIBUTES sa);
extern BOOL DOSFS_FindUnixName( LPCSTR path, LPCSTR name, LPSTR long_buf, extern BOOL DOSFS_FindUnixName( LPCSTR path, LPCSTR name, LPSTR long_buf,
INT long_len, LPSTR short_buf, INT long_len, LPSTR short_buf,
......
...@@ -207,7 +207,7 @@ extern BOOL MODULE_DllProcessAttach( WINE_MODREF *wm, LPVOID lpReserved ); ...@@ -207,7 +207,7 @@ extern BOOL MODULE_DllProcessAttach( WINE_MODREF *wm, LPVOID lpReserved );
extern void MODULE_DllProcessDetach( BOOL bForceDetach, LPVOID lpReserved ); extern void MODULE_DllProcessDetach( BOOL bForceDetach, LPVOID lpReserved );
extern void MODULE_DllThreadAttach( LPVOID lpReserved ); extern void MODULE_DllThreadAttach( LPVOID lpReserved );
extern void MODULE_DllThreadDetach( LPVOID lpReserved ); extern void MODULE_DllThreadDetach( LPVOID lpReserved );
extern WINE_MODREF *MODULE_LoadLibraryExA( LPCSTR libname, HFILE hfile, DWORD flags ); extern WINE_MODREF *MODULE_LoadLibraryExA( LPCSTR libname, HANDLE hfile, DWORD flags );
extern BOOL MODULE_FreeLibrary( WINE_MODREF *wm ); extern BOOL MODULE_FreeLibrary( WINE_MODREF *wm );
extern WINE_MODREF *MODULE_FindModule( LPCSTR path ); extern WINE_MODREF *MODULE_FindModule( LPCSTR path );
extern HMODULE16 MODULE_CreateDummyModule( LPCSTR filename, HMODULE module32 ); extern HMODULE16 MODULE_CreateDummyModule( LPCSTR filename, HMODULE module32 );
...@@ -231,8 +231,8 @@ extern DWORD NE_StartTask(void); ...@@ -231,8 +231,8 @@ extern DWORD NE_StartTask(void);
/* loader/ne/resource.c */ /* loader/ne/resource.c */
extern HGLOBAL16 WINAPI NE_DefResourceHandler(HGLOBAL16,HMODULE16,HRSRC16); extern HGLOBAL16 WINAPI NE_DefResourceHandler(HGLOBAL16,HMODULE16,HRSRC16);
extern BOOL NE_InitResourceHandler( HMODULE16 hModule ); extern BOOL NE_InitResourceHandler( HMODULE16 hModule );
extern HRSRC16 NE_FindResource( NE_MODULE *pModule, LPCSTR name, LPCSTR type ); extern HRSRC NE_FindResource( NE_MODULE *pModule, LPCSTR name, LPCSTR type );
extern DWORD NE_SizeofResource( NE_MODULE *pModule, HRSRC16 hRsrc ); extern DWORD NE_SizeofResource( NE_MODULE *pModule, HRSRC hRsrc );
extern HGLOBAL16 NE_LoadResource( NE_MODULE *pModule, HRSRC16 hRsrc ); extern HGLOBAL16 NE_LoadResource( NE_MODULE *pModule, HRSRC16 hRsrc );
extern BOOL16 NE_FreeResource( NE_MODULE *pModule, HGLOBAL16 handle ); extern BOOL16 NE_FreeResource( NE_MODULE *pModule, HGLOBAL16 handle );
extern NE_TYPEINFO *NE_FindTypeSection( LPBYTE pResTab, NE_TYPEINFO *pTypeInfo, LPCSTR typeId ); extern NE_TYPEINFO *NE_FindTypeSection( LPBYTE pResTab, NE_TYPEINFO *pTypeInfo, LPCSTR typeId );
......
...@@ -1487,6 +1487,7 @@ LPVOID WINAPI TlsGetValue(DWORD); ...@@ -1487,6 +1487,7 @@ LPVOID WINAPI TlsGetValue(DWORD);
BOOL WINAPI TlsSetValue(DWORD,LPVOID); BOOL WINAPI TlsSetValue(DWORD,LPVOID);
BOOL WINAPI TransmitCommChar(HANDLE,CHAR); BOOL WINAPI TransmitCommChar(HANDLE,CHAR);
BOOL WINAPI UnlockFile(HANDLE,DWORD,DWORD,DWORD,DWORD); BOOL WINAPI UnlockFile(HANDLE,DWORD,DWORD,DWORD,DWORD);
BOOL WINAPI UnlockFileEx(HANDLE,DWORD,DWORD,DWORD,LPOVERLAPPED);
BOOL WINAPI UnmapViewOfFile(LPVOID); BOOL WINAPI UnmapViewOfFile(LPVOID);
BOOL WINAPI VerifyVersionInfoA(LPOSVERSIONINFOEXA,DWORD,DWORDLONG); BOOL WINAPI VerifyVersionInfoA(LPOSVERSIONINFOEXA,DWORD,DWORDLONG);
BOOL WINAPI VerifyVersionInfoW(LPOSVERSIONINFOEXW,DWORD,DWORDLONG); BOOL WINAPI VerifyVersionInfoW(LPOSVERSIONINFOEXW,DWORD,DWORDLONG);
...@@ -1703,7 +1704,6 @@ BOOL WINAPI SetVolumeLabelA(LPCSTR,LPCSTR); ...@@ -1703,7 +1704,6 @@ BOOL WINAPI SetVolumeLabelA(LPCSTR,LPCSTR);
BOOL WINAPI SetVolumeLabelW(LPCWSTR,LPCWSTR); BOOL WINAPI SetVolumeLabelW(LPCWSTR,LPCWSTR);
#define SetVolumeLabel WINELIB_NAME_AW(SetVolumeLabel) #define SetVolumeLabel WINELIB_NAME_AW(SetVolumeLabel)
DWORD WINAPI SizeofResource(HMODULE,HRSRC); DWORD WINAPI SizeofResource(HMODULE,HRSRC);
BOOL WINAPI UnlockFileEx(HFILE,DWORD,DWORD,DWORD,LPOVERLAPPED);
#define UnlockSegment(handle) GlobalUnfix((HANDLE)(handle)) #define UnlockSegment(handle) GlobalUnfix((HANDLE)(handle))
BOOL WINAPI WritePrivateProfileSectionA(LPCSTR,LPCSTR,LPCSTR); BOOL WINAPI WritePrivateProfileSectionA(LPCSTR,LPCSTR,LPCSTR);
BOOL WINAPI WritePrivateProfileSectionW(LPCWSTR,LPCWSTR,LPCWSTR); BOOL WINAPI WritePrivateProfileSectionW(LPCWSTR,LPCWSTR,LPCWSTR);
......
...@@ -899,8 +899,8 @@ UINT WINAPI WinExec( LPCSTR lpCmdLine, UINT nCmdShow ) ...@@ -899,8 +899,8 @@ UINT WINAPI WinExec( LPCSTR lpCmdLine, UINT nCmdShow )
{ {
PROCESS_INFORMATION info; PROCESS_INFORMATION info;
STARTUPINFOA startup; STARTUPINFOA startup;
HINSTANCE hInstance;
char *cmdline; char *cmdline;
UINT ret;
memset( &startup, 0, sizeof(startup) ); memset( &startup, 0, sizeof(startup) );
startup.cb = sizeof(startup); startup.cb = sizeof(startup);
...@@ -917,18 +917,18 @@ UINT WINAPI WinExec( LPCSTR lpCmdLine, UINT nCmdShow ) ...@@ -917,18 +917,18 @@ UINT WINAPI WinExec( LPCSTR lpCmdLine, UINT nCmdShow )
/* 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 ) == 0xFFFFFFFF) if (wait_input_idle( info.hProcess, 30000 ) == 0xFFFFFFFF)
WARN("WaitForInputIdle failed: Error %ld\n", GetLastError() ); WARN("WaitForInputIdle failed: Error %ld\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 = (HINSTANCE)GetLastError()) >= (HINSTANCE)32) else if ((ret = GetLastError()) >= 32)
{ {
FIXME("Strange error set by CreateProcess: %d\n", hInstance ); FIXME("Strange error set by CreateProcess: %d\n", ret );
hInstance = (HINSTANCE)11; ret = 11;
} }
HeapFree( GetProcessHeap(), 0, cmdline ); HeapFree( GetProcessHeap(), 0, cmdline );
return hInstance; return ret;
} }
/********************************************************************** /**********************************************************************
...@@ -1188,7 +1188,7 @@ static LPCSTR allocate_lib_dir(LPCSTR libname) ...@@ -1188,7 +1188,7 @@ static LPCSTR allocate_lib_dir(LPCSTR libname)
* init function into load_library). * init function into load_library).
* allocated_libdir is TRUE in the stack frame that allocated libdir * allocated_libdir is TRUE in the stack frame that allocated libdir
*/ */
WINE_MODREF *MODULE_LoadLibraryExA( LPCSTR libname, HFILE hfile, DWORD flags ) WINE_MODREF *MODULE_LoadLibraryExA( LPCSTR libname, HANDLE hfile, DWORD flags )
{ {
DWORD err = GetLastError(); DWORD err = GetLastError();
WINE_MODREF *pwm; WINE_MODREF *pwm;
......
...@@ -311,7 +311,7 @@ FARPROC16 WINAPI SetResourceHandler16( HMODULE16 hModule, LPCSTR typeId, ...@@ -311,7 +311,7 @@ FARPROC16 WINAPI SetResourceHandler16( HMODULE16 hModule, LPCSTR typeId,
/********************************************************************** /**********************************************************************
* NE_FindResource * NE_FindResource
*/ */
HRSRC16 NE_FindResource( NE_MODULE *pModule, LPCSTR name, LPCSTR type ) HRSRC NE_FindResource( NE_MODULE *pModule, LPCSTR name, LPCSTR type )
{ {
NE_TYPEINFO *pTypeInfo; NE_TYPEINFO *pTypeInfo;
NE_NAMEINFO *pNameInfo; NE_NAMEINFO *pNameInfo;
...@@ -363,7 +363,7 @@ HRSRC16 NE_FindResource( NE_MODULE *pModule, LPCSTR name, LPCSTR type ) ...@@ -363,7 +363,7 @@ HRSRC16 NE_FindResource( NE_MODULE *pModule, LPCSTR name, LPCSTR type )
if ((pNameInfo = NE_FindResourceFromType( pResTab, pTypeInfo, name ))) if ((pNameInfo = NE_FindResourceFromType( pResTab, pTypeInfo, name )))
{ {
TRACE(" Found id %08lx\n", (DWORD)name ); TRACE(" Found id %08lx\n", (DWORD)name );
return (HRSRC16)( (int)pNameInfo - (int)pModule ); return (HRSRC)( (char *)pNameInfo - (char *)pModule );
} }
TRACE(" Not found, going on\n" ); TRACE(" Not found, going on\n" );
pTypeInfo = NEXT_TYPEINFO(pTypeInfo); pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
...@@ -443,7 +443,7 @@ INT16 WINAPI AccessResource16( HINSTANCE16 hModule, HRSRC16 hRsrc ) ...@@ -443,7 +443,7 @@ INT16 WINAPI AccessResource16( HINSTANCE16 hModule, HRSRC16 hRsrc )
/********************************************************************** /**********************************************************************
* NE_SizeofResource * NE_SizeofResource
*/ */
DWORD NE_SizeofResource( NE_MODULE *pModule, HRSRC16 hRsrc ) DWORD NE_SizeofResource( NE_MODULE *pModule, HRSRC hRsrc )
{ {
NE_NAMEINFO *pNameInfo=NULL; NE_NAMEINFO *pNameInfo=NULL;
WORD sizeShift; WORD sizeShift;
...@@ -453,7 +453,7 @@ DWORD NE_SizeofResource( NE_MODULE *pModule, HRSRC16 hRsrc ) ...@@ -453,7 +453,7 @@ DWORD NE_SizeofResource( NE_MODULE *pModule, HRSRC16 hRsrc )
TRACE("module=%04x res=%04x\n", pModule->self, hRsrc ); TRACE("module=%04x res=%04x\n", pModule->self, hRsrc );
sizeShift = *(WORD *)((char *)pModule + pModule->res_table); sizeShift = *(WORD *)((char *)pModule + pModule->res_table);
pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc); pNameInfo = (NE_NAMEINFO*)((char*)pModule + LOWORD(hRsrc));
return (DWORD)pNameInfo->length << sizeShift; return (DWORD)pNameInfo->length << sizeShift;
} }
......
...@@ -111,7 +111,7 @@ BOOL NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) ...@@ -111,7 +111,7 @@ BOOL NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
WORD count, i, offset, next_offset; WORD count, i, offset, next_offset;
HMODULE16 module; HMODULE16 module;
FARPROC16 address = 0; FARPROC16 address = 0;
HFILE hf; HANDLE hf;
DWORD res; DWORD res;
struct relocation_entry_s *rep, *reloc_entries; struct relocation_entry_s *rep, *reloc_entries;
BYTE *func_name; BYTE *func_name;
...@@ -152,7 +152,7 @@ BOOL NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) ...@@ -152,7 +152,7 @@ BOOL NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
/* Implement self-loading segments */ /* Implement self-loading segments */
SELFLOADHEADER *selfloadheader; SELFLOADHEADER *selfloadheader;
DWORD oldstack; DWORD oldstack;
HFILE hFile32; HANDLE hFile32;
HFILE16 hFile16; HFILE16 hFile16;
selfloadheader = MapSL( MAKESEGPTR(SEL(pSegTable->hSeg),0) ); selfloadheader = MapSL( MAKESEGPTR(SEL(pSegTable->hSeg),0) );
...@@ -437,7 +437,7 @@ BOOL NE_LoadAllSegments( NE_MODULE *pModule ) ...@@ -437,7 +437,7 @@ BOOL NE_LoadAllSegments( NE_MODULE *pModule )
if (pModule->flags & NE_FFLAGS_SELFLOAD) if (pModule->flags & NE_FFLAGS_SELFLOAD)
{ {
HFILE hf; HANDLE hf;
HFILE16 hFile16; HFILE16 hFile16;
HGLOBAL16 sel; HGLOBAL16 sel;
/* Handle self-loading modules */ /* Handle self-loading modules */
......
...@@ -59,7 +59,7 @@ typedef struct _HRSRC_MAP ...@@ -59,7 +59,7 @@ typedef struct _HRSRC_MAP
/********************************************************************** /**********************************************************************
* MapHRsrc32To16 * MapHRsrc32To16
*/ */
static HRSRC16 MapHRsrc32To16( NE_MODULE *pModule, HANDLE hRsrc32, WORD type ) static HRSRC MapHRsrc32To16( NE_MODULE *pModule, HANDLE hRsrc32, WORD type )
{ {
HRSRC_MAP *map = (HRSRC_MAP *)pModule->hRsrcMap; HRSRC_MAP *map = (HRSRC_MAP *)pModule->hRsrcMap;
HRSRC_ELEM *newElem; HRSRC_ELEM *newElem;
...@@ -80,7 +80,7 @@ static HRSRC16 MapHRsrc32To16( NE_MODULE *pModule, HANDLE hRsrc32, WORD type ) ...@@ -80,7 +80,7 @@ static HRSRC16 MapHRsrc32To16( NE_MODULE *pModule, HANDLE hRsrc32, WORD type )
/* Check whether HRSRC32 already in map */ /* Check whether HRSRC32 already in map */
for ( i = 0; i < map->nUsed; i++ ) for ( i = 0; i < map->nUsed; i++ )
if ( map->elem[i].hRsrc == hRsrc32 ) if ( map->elem[i].hRsrc == hRsrc32 )
return (HRSRC16)(i + 1); return (HRSRC)(i + 1);
/* If no space left, grow table */ /* If no space left, grow table */
if ( map->nUsed == map->nAlloc ) if ( map->nUsed == map->nAlloc )
...@@ -102,13 +102,13 @@ static HRSRC16 MapHRsrc32To16( NE_MODULE *pModule, HANDLE hRsrc32, WORD type ) ...@@ -102,13 +102,13 @@ static HRSRC16 MapHRsrc32To16( NE_MODULE *pModule, HANDLE hRsrc32, WORD type )
map->elem[map->nUsed].type = type; map->elem[map->nUsed].type = type;
map->nUsed++; map->nUsed++;
return (HRSRC16)map->nUsed; return (HRSRC)map->nUsed;
} }
/********************************************************************** /**********************************************************************
* MapHRsrc16To32 * MapHRsrc16To32
*/ */
static HANDLE MapHRsrc16To32( NE_MODULE *pModule, HRSRC16 hRsrc16 ) static HRSRC MapHRsrc16To32( NE_MODULE *pModule, HRSRC hRsrc16 )
{ {
HRSRC_MAP *map = (HRSRC_MAP *)pModule->hRsrcMap; HRSRC_MAP *map = (HRSRC_MAP *)pModule->hRsrcMap;
if ( !map || !hRsrc16 || (int)hRsrc16 > map->nUsed ) return 0; if ( !map || !hRsrc16 || (int)hRsrc16 > map->nUsed ) return 0;
...@@ -119,7 +119,7 @@ static HANDLE MapHRsrc16To32( NE_MODULE *pModule, HRSRC16 hRsrc16 ) ...@@ -119,7 +119,7 @@ static HANDLE MapHRsrc16To32( NE_MODULE *pModule, HRSRC16 hRsrc16 )
/********************************************************************** /**********************************************************************
* MapHRsrc16ToType * MapHRsrc16ToType
*/ */
static WORD MapHRsrc16ToType( NE_MODULE *pModule, HRSRC16 hRsrc16 ) static WORD MapHRsrc16ToType( NE_MODULE *pModule, HRSRC hRsrc16 )
{ {
HRSRC_MAP *map = (HRSRC_MAP *)pModule->hRsrcMap; HRSRC_MAP *map = (HRSRC_MAP *)pModule->hRsrcMap;
if ( !map || !hRsrc16 || (int)hRsrc16 > map->nUsed ) return 0; if ( !map || !hRsrc16 || (int)hRsrc16 > map->nUsed ) return 0;
...@@ -293,7 +293,7 @@ static HGLOBAL RES_LoadResource( HMODULE hModule, HRSRC hRsrc, BOOL bRet16 ) ...@@ -293,7 +293,7 @@ static HGLOBAL RES_LoadResource( HMODULE hModule, HRSRC hRsrc, BOOL bRet16 )
/* 16-bit NE module */ /* 16-bit NE module */
/* If we got a 32-bit hRsrc, we don't need to convert it */ /* If we got a 32-bit hRsrc, we don't need to convert it */
hMem = NE_LoadResource( pModule, hRsrc ); hMem = NE_LoadResource( pModule, LOWORD(hRsrc) );
/* If we are to return a 32-bit resource, we should probably /* If we are to return a 32-bit resource, we should probably
convert it but we don't for now. FIXME !!! */ convert it but we don't for now. FIXME !!! */
...@@ -332,8 +332,8 @@ static HGLOBAL RES_LoadResource( HMODULE hModule, HRSRC hRsrc, BOOL bRet16 ) ...@@ -332,8 +332,8 @@ static HGLOBAL RES_LoadResource( HMODULE hModule, HRSRC hRsrc, BOOL bRet16 )
*/ */
HRSRC16 WINAPI FindResource16( HMODULE16 hModule, LPCSTR name, LPCSTR type ) HRSRC16 WINAPI FindResource16( HMODULE16 hModule, LPCSTR name, LPCSTR type )
{ {
return RES_FindResource( hModule, type, name, return LOWORD( RES_FindResource( hModule, type, name,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), FALSE, TRUE ); MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), FALSE, TRUE ) );
} }
/********************************************************************** /**********************************************************************
...@@ -420,7 +420,7 @@ LPVOID WINAPI LockResource( HGLOBAL handle ) ...@@ -420,7 +420,7 @@ LPVOID WINAPI LockResource( HGLOBAL handle )
return (LPVOID)handle; return (LPVOID)handle;
/* 16-bit memory handle */ /* 16-bit memory handle */
return LockResource16( handle ); return LockResource16( LOWORD(handle) );
} }
typedef WORD (WINAPI *pDestroyIcon32Proc)( HGLOBAL16 handle, UINT16 flags ); typedef WORD (WINAPI *pDestroyIcon32Proc)( HGLOBAL16 handle, UINT16 flags );
...@@ -432,7 +432,7 @@ typedef WORD (WINAPI *pDestroyIcon32Proc)( HGLOBAL16 handle, UINT16 flags ); ...@@ -432,7 +432,7 @@ typedef WORD (WINAPI *pDestroyIcon32Proc)( HGLOBAL16 handle, UINT16 flags );
*/ */
BOOL16 WINAPI FreeResource16( HGLOBAL16 handle ) BOOL16 WINAPI FreeResource16( HGLOBAL16 handle )
{ {
HGLOBAL retv = handle; HGLOBAL16 retv = handle;
NE_MODULE *pModule = NE_GetPtr( FarGetOwner16( handle ) ); NE_MODULE *pModule = NE_GetPtr( FarGetOwner16( handle ) );
TRACE("(%04x)\n", handle ); TRACE("(%04x)\n", handle );
...@@ -463,7 +463,7 @@ BOOL WINAPI FreeResource( HGLOBAL handle ) ...@@ -463,7 +463,7 @@ BOOL WINAPI FreeResource( HGLOBAL handle )
{ {
if (HIWORD(handle)) return 0; /* 32-bit memory handle: nothing to do */ if (HIWORD(handle)) return 0; /* 32-bit memory handle: nothing to do */
return FreeResource16( handle ); return FreeResource16( LOWORD(handle) );
} }
/********************************************************************** /**********************************************************************
......
...@@ -209,7 +209,7 @@ BOOL WINAPI DeleteMetaFile( HMETAFILE hmf ) ...@@ -209,7 +209,7 @@ BOOL WINAPI DeleteMetaFile( HMETAFILE hmf )
* Returns a pointer to a memory based METAHEADER read in from file HFILE * Returns a pointer to a memory based METAHEADER read in from file HFILE
* *
*/ */
static METAHEADER *MF_ReadMetaFile(HFILE hfile) static METAHEADER *MF_ReadMetaFile(HANDLE hfile)
{ {
METAHEADER *mh; METAHEADER *mh;
DWORD BytesRead, size; DWORD BytesRead, size;
......
...@@ -37,10 +37,10 @@ BOOL WINAPI CloseHandle( HANDLE handle ) ...@@ -37,10 +37,10 @@ BOOL WINAPI CloseHandle( HANDLE handle )
NTSTATUS status; NTSTATUS status;
/* stdio handles need special treatment */ /* stdio handles need special treatment */
if ((handle == STD_INPUT_HANDLE) || if ((handle == (HANDLE)STD_INPUT_HANDLE) ||
(handle == STD_OUTPUT_HANDLE) || (handle == (HANDLE)STD_OUTPUT_HANDLE) ||
(handle == STD_ERROR_HANDLE)) (handle == (HANDLE)STD_ERROR_HANDLE))
handle = GetStdHandle( handle ); handle = GetStdHandle( (DWORD)handle );
status = NtClose( handle ); status = NtClose( handle );
if (status) SetLastError( RtlNtStatusToDosError(status) ); if (status) SetLastError( RtlNtStatusToDosError(status) );
......
...@@ -449,7 +449,7 @@ static void start_process(void) ...@@ -449,7 +449,7 @@ static void start_process(void)
int debugged, console_app; int debugged, console_app;
LPTHREAD_START_ROUTINE entry; LPTHREAD_START_ROUTINE entry;
WINE_MODREF *wm; WINE_MODREF *wm;
HFILE main_file = main_exe_file; HANDLE main_file = main_exe_file;
/* use original argv[0] as name for the main module */ /* use original argv[0] as name for the main module */
if (!main_exe_name[0]) if (!main_exe_name[0])
...@@ -1332,7 +1332,7 @@ DWORD WINAPI GetProcessDword( DWORD dwProcessID, INT offset ) ...@@ -1332,7 +1332,7 @@ DWORD WINAPI GetProcessDword( DWORD dwProcessID, INT offset )
return GetAppCompatFlags16(0); return GetAppCompatFlags16(0);
case GPD_LOAD_DONE_EVENT: case GPD_LOAD_DONE_EVENT:
return current_process.load_done_evt; return (DWORD)current_process.load_done_evt;
case GPD_HINSTANCE16: case GPD_HINSTANCE16:
return GetTaskDS16(); return GetTaskDS16();
...@@ -1347,10 +1347,10 @@ DWORD WINAPI GetProcessDword( DWORD dwProcessID, INT offset ) ...@@ -1347,10 +1347,10 @@ DWORD WINAPI GetProcessDword( DWORD dwProcessID, INT offset )
return (DWORD)&current_process; return (DWORD)&current_process;
case GPD_STARTF_SHELLDATA: /* return stdoutput handle from startupinfo ??? */ case GPD_STARTF_SHELLDATA: /* return stdoutput handle from startupinfo ??? */
return current_startupinfo.hStdOutput; return (DWORD)current_startupinfo.hStdOutput;
case GPD_STARTF_HOTKEY: /* return stdinput handle from startupinfo ??? */ case GPD_STARTF_HOTKEY: /* return stdinput handle from startupinfo ??? */
return current_startupinfo.hStdInput; return (DWORD)current_startupinfo.hStdInput;
case GPD_STARTF_SHOWWINDOW: case GPD_STARTF_SHOWWINDOW:
return current_startupinfo.wShowWindow; return current_startupinfo.wShowWindow;
...@@ -1920,5 +1920,5 @@ BOOL WINAPI TlsSetValue( ...@@ -1920,5 +1920,5 @@ BOOL WINAPI TlsSetValue(
#undef GetCurrentProcess #undef GetCurrentProcess
HANDLE WINAPI GetCurrentProcess(void) HANDLE WINAPI GetCurrentProcess(void)
{ {
return 0xffffffff; return (HANDLE)0xffffffff;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment