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