Commit 613ead7f authored by Alexandre Julliard's avatar Alexandre Julliard

Fixed some handle conversions in prevision of void* handles.

parent dd0c4c16
...@@ -37,7 +37,7 @@ static PLOADED_IMAGE IMAGEHLP_pLastLoadedImage=NULL; ...@@ -37,7 +37,7 @@ static PLOADED_IMAGE IMAGEHLP_pLastLoadedImage=NULL;
static LOADED_IMAGE IMAGEHLP_EmptyLoadedImage = { static LOADED_IMAGE IMAGEHLP_EmptyLoadedImage = {
NULL, /* ModuleName */ NULL, /* ModuleName */
0xffffffff, /* hFile */ 0, /* hFile */
NULL, /* MappedAddress */ NULL, /* MappedAddress */
NULL, /* FileHeader */ NULL, /* FileHeader */
NULL, /* LastRvaSection */ NULL, /* LastRvaSection */
...@@ -317,5 +317,3 @@ BOOL WINAPI UnMapAndLoad(PLOADED_IMAGE LoadedImage) ...@@ -317,5 +317,3 @@ BOOL WINAPI UnMapAndLoad(PLOADED_IMAGE LoadedImage)
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE; return FALSE;
} }
...@@ -453,7 +453,7 @@ int MSVCRT_system(const char* cmd) ...@@ -453,7 +453,7 @@ int MSVCRT_system(const char* cmd)
*/ */
int _loaddll(const char* dllname) int _loaddll(const char* dllname)
{ {
return LoadLibraryA(dllname); return (int)LoadLibraryA(dllname);
} }
/********************************************************************* /*********************************************************************
...@@ -461,7 +461,7 @@ int _loaddll(const char* dllname) ...@@ -461,7 +461,7 @@ int _loaddll(const char* dllname)
*/ */
int _unloaddll(int dll) int _unloaddll(int dll)
{ {
if (FreeLibrary((HANDLE)dll)) if (FreeLibrary((HMODULE)dll))
return 0; return 0;
else else
{ {
......
...@@ -181,8 +181,8 @@ BOOL16 WINAPI GetIconInfo16(HICON16 hIcon, LPICONINFO16 iconinfo) ...@@ -181,8 +181,8 @@ BOOL16 WINAPI GetIconInfo16(HICON16 hIcon, LPICONINFO16 iconinfo)
iconinfo->fIcon = ii32.fIcon; iconinfo->fIcon = ii32.fIcon;
iconinfo->xHotspot = ii32.xHotspot; iconinfo->xHotspot = ii32.xHotspot;
iconinfo->yHotspot = ii32.yHotspot; iconinfo->yHotspot = ii32.yHotspot;
iconinfo->hbmMask = ii32.hbmMask; iconinfo->hbmMask = HBITMAP_16(ii32.hbmMask);
iconinfo->hbmColor = ii32.hbmColor; iconinfo->hbmColor = HBITMAP_16(ii32.hbmColor);
return ret; return ret;
} }
...@@ -204,8 +204,7 @@ HCURSOR16 WINAPI CreateCursor16(HINSTANCE16 hInstance, ...@@ -204,8 +204,7 @@ HCURSOR16 WINAPI CreateCursor16(HINSTANCE16 hInstance,
info.bPlanes = 1; info.bPlanes = 1;
info.bBitsPerPixel = 1; info.bBitsPerPixel = 1;
return CreateCursorIconIndirect16(HINSTANCE_32(hInstance), &info, lpANDbits, return CreateCursorIconIndirect16(hInstance, &info, lpANDbits, lpXORbits);
lpXORbits);
} }
/********************************************************************** /**********************************************************************
......
...@@ -1074,7 +1074,7 @@ HANDLE WINAPI AddPrinterW(LPWSTR pName, DWORD Level, LPBYTE pPrinter) ...@@ -1074,7 +1074,7 @@ HANDLE WINAPI AddPrinterW(LPWSTR pName, DWORD Level, LPBYTE pPrinter)
* just create to find a DEVMODEA struct (it will use the WINEPS default * just create to find a DEVMODEA struct (it will use the WINEPS default
* one in case it is not there, so we are ok). * one in case it is not there, so we are ok).
*/ */
size = DocumentPropertiesW(0, -1, pi->pPrinterName, NULL, NULL, 0); size = DocumentPropertiesW(0, 0, pi->pPrinterName, NULL, NULL, 0);
if(size < 0) { if(size < 0) {
FIXME("DocumentPropertiesW on printer '%s' fails\n", debugstr_w(pi->pPrinterName)); FIXME("DocumentPropertiesW on printer '%s' fails\n", debugstr_w(pi->pPrinterName));
size = sizeof(DEVMODEW); size = sizeof(DEVMODEW);
...@@ -1084,7 +1084,7 @@ HANDLE WINAPI AddPrinterW(LPWSTR pName, DWORD Level, LPBYTE pPrinter) ...@@ -1084,7 +1084,7 @@ HANDLE WINAPI AddPrinterW(LPWSTR pName, DWORD Level, LPBYTE pPrinter)
else { else {
dmW = HeapAlloc(GetProcessHeap(), 0, size); dmW = HeapAlloc(GetProcessHeap(), 0, size);
dmW->dmSize = size; dmW->dmSize = size;
if (0>DocumentPropertiesW(0,-1,pi->pPrinterName,dmW,NULL,DM_OUT_BUFFER)) { if (0>DocumentPropertiesW(0,0,pi->pPrinterName,dmW,NULL,DM_OUT_BUFFER)) {
ERR("DocumentPropertiesW on printer '%s' failed!\n", debugstr_w(pi->pPrinterName)); ERR("DocumentPropertiesW on printer '%s' failed!\n", debugstr_w(pi->pPrinterName));
SetLastError(ERROR_UNKNOWN_PRINTER_DRIVER); SetLastError(ERROR_UNKNOWN_PRINTER_DRIVER);
return 0; return 0;
......
...@@ -114,7 +114,7 @@ typedef struct tagMODULEENTRY32 ...@@ -114,7 +114,7 @@ typedef struct tagMODULEENTRY32
DWORD ProccntUsage; DWORD ProccntUsage;
BYTE *modBaseAddr; BYTE *modBaseAddr;
DWORD modBaseSize; DWORD modBaseSize;
DWORD hModule; HMODULE hModule;
char szModule[MAX_MODULE_NAME32 + 1]; char szModule[MAX_MODULE_NAME32 + 1];
char szExePath[MAX_PATH]; char szExePath[MAX_PATH];
} MODULEENTRY32, *PMODULEENTRY32, *LPMODULEENTRY32; } MODULEENTRY32, *PMODULEENTRY32, *LPMODULEENTRY32;
...@@ -128,7 +128,7 @@ typedef struct tagMODULEENTRY32W ...@@ -128,7 +128,7 @@ typedef struct tagMODULEENTRY32W
DWORD ProccntUsage; DWORD ProccntUsage;
BYTE *modBaseAddr; BYTE *modBaseAddr;
DWORD modBaseSize; DWORD modBaseSize;
DWORD hModule; HMODULE hModule;
WCHAR szModule[MAX_MODULE_NAME32 + 1]; WCHAR szModule[MAX_MODULE_NAME32 + 1];
WCHAR szExePath[MAX_PATH]; WCHAR szExePath[MAX_PATH];
} MODULEENTRY32W, *PMODULEENTRY32W, *LPMODULEENTRY32W; } MODULEENTRY32W, *PMODULEENTRY32W, *LPMODULEENTRY32W;
......
...@@ -469,7 +469,7 @@ static HGDIOBJ FONT_SelectObject( HGDIOBJ handle, void *obj, HDC hdc ) ...@@ -469,7 +469,7 @@ static HGDIOBJ FONT_SelectObject( HGDIOBJ handle, void *obj, HDC hdc )
if (ret && dc->gdiFont) dc->gdiFont = 0; if (ret && dc->gdiFont) dc->gdiFont = 0;
if (ret == GDI_ERROR) if (ret == HGDI_ERROR)
ret = 0; /* SelectObject returns 0 on error */ ret = 0; /* SelectObject returns 0 on error */
else else
{ {
......
...@@ -726,7 +726,7 @@ void *GDI_ReallocObject( WORD size, HGDIOBJ handle, void *object ) ...@@ -726,7 +726,7 @@ void *GDI_ReallocObject( WORD size, HGDIOBJ handle, void *object )
{ {
HGDIOBJ new_handle; HGDIOBJ new_handle;
if (handle & 2) /* GDI heap handle */ if ((UINT_PTR)handle & 2) /* GDI heap handle */
{ {
LOCAL_Unlock( GDI_HeapSel, handle ); LOCAL_Unlock( GDI_HeapSel, handle );
if ((new_handle = LOCAL_ReAlloc( GDI_HeapSel, handle, size, LMEM_MOVEABLE ))) if ((new_handle = LOCAL_ReAlloc( GDI_HeapSel, handle, size, LMEM_MOVEABLE )))
...@@ -764,7 +764,7 @@ BOOL GDI_FreeObject( HGDIOBJ handle, void *ptr ) ...@@ -764,7 +764,7 @@ BOOL GDI_FreeObject( HGDIOBJ handle, void *ptr )
object->wMagic = 0; /* Mark it as invalid */ object->wMagic = 0; /* Mark it as invalid */
object->funcs = NULL; object->funcs = NULL;
if (handle & 2) /* GDI heap handle */ if ((UINT_PTR)handle & 2) /* GDI heap handle */
{ {
LOCAL_Unlock( GDI_HeapSel, handle ); LOCAL_Unlock( GDI_HeapSel, handle );
LOCAL_Free( GDI_HeapSel, handle ); LOCAL_Free( GDI_HeapSel, handle );
...@@ -798,7 +798,7 @@ void *GDI_GetObjPtr( HGDIOBJ handle, WORD magic ) ...@@ -798,7 +798,7 @@ void *GDI_GetObjPtr( HGDIOBJ handle, WORD magic )
_EnterSysLevel( &GDI_level ); _EnterSysLevel( &GDI_level );
if (handle & 2) /* GDI heap handle */ if ((UINT_PTR)handle & 2) /* GDI heap handle */
{ {
ptr = (GDIOBJHDR *)LOCAL_Lock( GDI_HeapSel, handle ); ptr = (GDIOBJHDR *)LOCAL_Lock( GDI_HeapSel, handle );
if (ptr) if (ptr)
...@@ -814,7 +814,7 @@ void *GDI_GetObjPtr( HGDIOBJ handle, WORD magic ) ...@@ -814,7 +814,7 @@ void *GDI_GetObjPtr( HGDIOBJ handle, WORD magic )
} }
else /* large heap handle */ else /* large heap handle */
{ {
int i = (handle >> 2) - FIRST_LARGE_HANDLE; int i = ((UINT_PTR)handle >> 2) - FIRST_LARGE_HANDLE;
if (i >= 0 && i < MAX_LARGE_HANDLES) if (i >= 0 && i < MAX_LARGE_HANDLES)
{ {
ptr = large_handles[i]; ptr = large_handles[i];
...@@ -840,7 +840,7 @@ void *GDI_GetObjPtr( HGDIOBJ handle, WORD magic ) ...@@ -840,7 +840,7 @@ void *GDI_GetObjPtr( HGDIOBJ handle, WORD magic )
*/ */
void GDI_ReleaseObj( HGDIOBJ handle ) void GDI_ReleaseObj( HGDIOBJ handle )
{ {
if (handle & 2) LOCAL_Unlock( GDI_HeapSel, handle ); if ((UINT_PTR)handle & 2) LOCAL_Unlock( GDI_HeapSel, handle );
TRACE_SEC( handle, "leave" ); TRACE_SEC( handle, "leave" );
_LeaveSysLevel( &GDI_level ); _LeaveSysLevel( &GDI_level );
} }
......
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