warnings, warnings, everywhere.... but not so many any more.

svn path=/trunk/; revision=5536
This commit is contained in:
Royce Mitchell III 2003-08-11 21:10:49 +00:00
parent 0eeded0a9a
commit 4504834722
23 changed files with 218 additions and 137 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: clip.c,v 1.15 2003/07/14 17:35:31 gvg Exp $
/* $Id: clip.c,v 1.16 2003/08/11 21:10:49 royce Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -42,7 +42,7 @@ VOID STDCALL IntEngDeleteClipRegion(CLIPOBJ *ClipObj)
FreeGDIHandle(HClip);
}
CLIPOBJ STDCALL *
CLIPOBJ* STDCALL
IntEngCreateClipRegion(ULONG count, PRECTL pRect, RECTL rcBounds)
{
HCLIP hClip;

View file

@ -20,7 +20,7 @@
#define __WIN32K_CLIP_H
typedef ULONG HCLIP;
CLIPOBJ STDCALL * IntEngCreateClipRegion( ULONG count, PRECTL pRect, RECTL rcBounds );
CLIPOBJ* STDCALL IntEngCreateClipRegion( ULONG count, PRECTL pRect, RECTL rcBounds );
VOID STDCALL IntEngDeleteClipRegion(CLIPOBJ *ClipObj);

View file

@ -3,14 +3,22 @@
#include <win32k/dc.h>
INT FASTCALL DIB_BitmapInfoSize (const BITMAPINFO * info, WORD coloruse);
HBITMAP STDCALL DIB_CreateDIBSection (PDC dc, PBITMAPINFO bmi, UINT usage, LPVOID *bits, HANDLE section, DWORD offset, DWORD ovr_pitch);
INT STDCALL DIB_GetBitmapInfo (const BITMAPINFOHEADER *header, PDWORD width, PINT height, PWORD bpp, PWORD compr);
INT STDCALL DIB_GetDIBImageBytes (INT width, INT height, INT depth);
INT FASTCALL DIB_GetDIBWidthBytes (INT width, INT depth);
RGBQUAD * FASTCALL DIB_MapPaletteColors (PDC dc, LPBITMAPINFO lpbmi);
INT FASTCALL
DIB_BitmapInfoSize (const BITMAPINFO * info, WORD coloruse);
HBITMAP STDCALL
DIB_CreateDIBSection (PDC dc, PBITMAPINFO bmi, UINT usage, LPVOID *bits, HANDLE section, DWORD offset, DWORD ovr_pitch);
INT STDCALL
DIB_GetBitmapInfo (const BITMAPINFOHEADER *header, PDWORD width, PINT height, PWORD bpp, PWORD compr);
INT STDCALL
DIB_GetDIBImageBytes (INT width, INT height, INT depth);
INT FASTCALL
DIB_GetDIBWidthBytes (INT width, INT depth);
RGBQUAD * FASTCALL
DIB_MapPaletteColors(PDC dc, CONST BITMAPINFO* lpbmi);
PPALETTEENTRY STDCALL
DIBColorTableToPaletteEntries(PPALETTEENTRY palEntries, const RGBQUAD *DIBColorTable, ULONG ColorCount);
HPALETTE FASTCALL
BuildDIBPalette (PBITMAPINFO bmi, PINT paletteType);
PPALETTEENTRY STDCALL DIBColorTableToPaletteEntries(PPALETTEENTRY palEntries, const RGBQUAD *DIBColorTable, ULONG ColorCount);
HPALETTE FASTCALL BuildDIBPalette (PBITMAPINFO bmi, PINT paletteType);
#endif /* __WIN32K_DIB_H */

View file

@ -35,7 +35,7 @@ BOOL STDCALL IntEngPolyline(SURFOBJ *DestSurf,
CONST LPPOINT pt,
LONG dCount,
MIX mix);
CLIPOBJ STDCALL * IntEngCreateClipRegion(ULONG count,
CLIPOBJ* STDCALL IntEngCreateClipRegion(ULONG count,
PRECTL pRect,
RECTL rcBounds);
#endif

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: class.c,v 1.27 2003/08/11 10:30:19 gvg Exp $
/* $Id: class.c,v 1.28 2003/08/11 21:10:49 royce Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -212,10 +212,10 @@ W32kGetClassName(struct _WINDOW_OBJECT *WindowObject,
return((RTL_ATOM)0);
}
length = 0;
Status = RtlQueryAtomInAtomTable(WinStaObject->AtomTable,(RTL_ATOM)WindowObject->Class->lpszClassName,NULL,NULL,name,&length);
Status = RtlQueryAtomInAtomTable(WinStaObject->AtomTable,(RTL_ATOM)(size_t)WindowObject->Class->lpszClassName,NULL,NULL,name,&length);
name = ExAllocatePool(PagedPool,length+1);
free = TRUE;
Status = RtlQueryAtomInAtomTable(WinStaObject->AtomTable,(RTL_ATOM)WindowObject->Class->lpszClassName,NULL,NULL,name,&length);
Status = RtlQueryAtomInAtomTable(WinStaObject->AtomTable,(RTL_ATOM)(size_t)WindowObject->Class->lpszClassName,NULL,NULL,name,&length);
if (!NT_SUCCESS(Status))
{
DPRINT("Validation of window station handle (0x%X) failed\n",

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: input.c,v 1.10 2003/08/04 16:54:54 gdalsnes Exp $
/* $Id: input.c,v 1.11 2003/08/11 21:10:49 royce Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -53,7 +53,7 @@ static BOOLEAN InputThreadsRunning = FALSE;
/* FUNCTIONS *****************************************************************/
NTSTATUS STDCALL STATIC
VOID STDCALL_FUNC STATIC
KeyboardThreadMain(PVOID StartContext)
{
UNICODE_STRING KeyboardDeviceName;
@ -76,7 +76,7 @@ KeyboardThreadMain(PVOID StartContext)
if (!NT_SUCCESS(Status))
{
DbgPrint("W32K: Failed to open keyboard.\n");
return(Status);
return; //(Status);
}
for (;;)
@ -119,7 +119,7 @@ KeyboardThreadMain(PVOID StartContext)
if (!NT_SUCCESS(Status))
{
DbgPrint("W32K: Failed to read from keyboard.\n");
return(Status);
return; //(Status);
}
SysKey = KeyEvent.dwControlKeyState & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED);

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: keyboard.c,v 1.6 2003/07/29 23:03:01 jimtabor Exp $
/* $Id: keyboard.c,v 1.7 2003/08/11 21:10:49 royce Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -318,7 +318,7 @@ NTSTATUS STDCALL LdrGetProcedureAddress(PVOID module,
void InitKbdLayout( PVOID *pkKeyboardLayout ) {
HMODULE kbModule = 0;
ANSI_STRING kbdProcedureName;
NTSTATUS Status;
//NTSTATUS Status;
KbdLayerDescriptor layerDescGetFn;
@ -333,7 +333,7 @@ void InitKbdLayout( PVOID *pkKeyboardLayout ) {
LdrGetProcedureAddress((PVOID)kbModule,
&kbdProcedureName,
0,
&layerDescGetFn);
(PVOID*)&layerDescGetFn);
if( layerDescGetFn ) {
*pkKeyboardLayout = layerDescGetFn();
}

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: menu.c,v 1.13 2003/08/07 10:25:59 weiden Exp $
/* $Id: menu.c,v 1.14 2003/08/11 21:10:49 royce Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -171,7 +171,8 @@ W32kFreeMenuItem(PMENU_OBJECT MenuObject, PMENU_ITEM MenuItem,
if(bRecurse && MenuItem->MenuItem.hSubMenu)
{
PMENU_OBJECT SubMenuObject;
SubMenuObject = W32kGetWindowObject(MenuItem->MenuItem.hSubMenu);
SubMenuObject = (PMENU_OBJECT)W32kGetWindowObject(
MenuItem->MenuItem.hSubMenu );
if(SubMenuObject)
{
W32kDestroyMenuObject(SubMenuObject, bRecurse);

View file

@ -1,4 +1,4 @@
/* $Id: misc.c,v 1.3 2003/08/06 13:17:44 weiden Exp $
/* $Id: misc.c,v 1.4 2003/08/11 21:10:49 royce Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -54,7 +54,7 @@ NtUserCallOneParam(
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
}
Result = WindowObject->Menu;
Result = (DWORD)WindowObject->Menu;
W32kReleaseWindowObject(WindowObject);
return Result;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: painting.c,v 1.25 2003/08/11 19:05:27 gdalsnes Exp $
/* $Id: painting.c,v 1.26 2003/08/11 21:10:49 royce Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -860,7 +860,7 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* lPs)
HRGN UpdateRegion;
RECT ClientRect;
RECT ClipRect;
NTSTATUS Status;
//NTSTATUS Status;
INT DcxFlags;
if (!(Window = W32kGetWindowObject(hWnd)))

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: timer.c,v 1.8 2003/07/29 18:17:53 hbirr Exp $
/* $Id: timer.c,v 1.9 2003/08/11 21:10:49 royce Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -309,7 +309,7 @@ NtUserSetSystemTimer(
}
static NTSTATUS STDCALL
static VOID STDCALL_FUNC
TimerThreadMain(
PVOID StartContext
)

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: window.c,v 1.86 2003/08/11 19:05:26 gdalsnes Exp $
/* $Id: window.c,v 1.87 2003/08/11 21:10:49 royce Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -2419,9 +2419,8 @@ W32kSetParent(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndNewParent)
{
if (!(Wnd->Style & WS_CHILD))
{
HMENU Menu = Wnd->Menu;
//if ( Wnd->Menu ) DestroyMenu ( Wnd->menu );
Wnd->Menu = NULL;
//if (Menu) DestroyMenu( menu );
}
}
}

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: winpos.c,v 1.22 2003/08/11 19:05:26 gdalsnes Exp $
/* $Id: winpos.c,v 1.23 2003/08/11 21:10:49 royce Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -117,7 +117,7 @@ WinPosCreateIconTitle(PWINDOW_OBJECT WindowObject)
BOOL STATIC FASTCALL
WinPosShowIconTitle(PWINDOW_OBJECT WindowObject, BOOL Show)
{
PINTERNALPOS InternalPos = W32kGetProp(WindowObject, AtomInternalPos);
PINTERNALPOS InternalPos = (PINTERNALPOS)W32kGetProp(WindowObject, AtomInternalPos);
PWINDOW_OBJECT IconWindow;
NTSTATUS Status;
@ -160,7 +160,7 @@ WinPosShowIconTitle(PWINDOW_OBJECT WindowObject, BOOL Show)
PINTERNALPOS STATIC STDCALL
WinPosInitInternalPos(PWINDOW_OBJECT WindowObject, POINT pt, PRECT RestoreRect)
{
PINTERNALPOS InternalPos = W32kGetProp(WindowObject, AtomInternalPos);
PINTERNALPOS InternalPos = (PINTERNALPOS)W32kGetProp(WindowObject, AtomInternalPos);
if (InternalPos == NULL)
{
InternalPos =
@ -325,7 +325,7 @@ WinPosGetMinMaxInfo(PWINDOW_OBJECT Window, POINT* MaxSize, POINT* MaxPos,
MinMax.ptMaxSize.x += 2 * XInc;
MinMax.ptMaxSize.y += 2 * YInc;
Pos = W32kGetProp(Window, AtomInternalPos);
Pos = (PINTERNALPOS)W32kGetProp(Window, AtomInternalPos);
if (Pos != NULL)
{
MinMax.ptMaxPosition = Pos->MaxPos;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: bezier.c,v 1.3 2003/05/18 17:16:17 ea Exp $ */
/* $Id: bezier.c,v 1.4 2003/08/11 21:10:49 royce Exp $ */
#include <windows.h>
#include <ddk/ntddk.h>
#include <math.h>
@ -63,7 +63,15 @@
#define BEZIERMIDDLE(Mid, P1, P2) \
(Mid).x=((P1).x+(P2).x + 1)/2;\
(Mid).y=((P1).y+(P2).y + 1)/2;
static int abs ( int __x )
{
if ( __x < 0 )
return -__x;
else
return __x;
}
/**********************************************************
* BezierCheck helper function to check
* that recursion can be terminated
@ -78,40 +86,61 @@ static BOOL FASTCALL BezierCheck( int level, POINT *Points)
dx=Points[3].x-Points[0].x;
dy=Points[3].y-Points[0].y;
if(abs(dy)<=abs(dx)) {/* shallow line */
if ( abs(dy) <= abs(dx) ) /* shallow line */
{
/* check that control points are between begin and end */
if(Points[1].x < Points[0].x){
if(Points[1].x < Points[3].x) return FALSE;
}else
if(Points[1].x > Points[3].x) return FALSE;
if(Points[2].x < Points[0].x) {
if(Points[2].x < Points[3].x) return FALSE;
} else
if(Points[2].x > Points[3].x) return FALSE;
dx=BEZIERSHIFTDOWN(dx);
if(!dx) return TRUE;
if(abs(Points[1].y-Points[0].y-(dy/dx)*
BEZIERSHIFTDOWN(Points[1].x-Points[0].x)) > BEZIERPIXEL ||
abs(Points[2].y-Points[0].y-(dy/dx)*
BEZIERSHIFTDOWN(Points[2].x-Points[0].x)) > BEZIERPIXEL) return FALSE;
if ( Points[1].x < Points[0].x )
{
if ( Points[1].x < Points[3].x )
return FALSE;
}
else if ( Points[1].x > Points[3].x )
return FALSE;
if ( Points[2].x < Points[0].x)
{
if ( Points[2].x < Points[3].x )
return FALSE;
}
else if ( Points[2].x > Points[3].x )
return FALSE;
dx = BEZIERSHIFTDOWN(dx);
if ( !dx )
return TRUE;
if ( abs(Points[1].y-Points[0].y-(dy/dx)*
BEZIERSHIFTDOWN(Points[1].x-Points[0].x)) > BEZIERPIXEL ||
abs(Points[2].y-Points[0].y-(dy/dx)*
BEZIERSHIFTDOWN(Points[2].x-Points[0].x)) > BEZIERPIXEL
)
return FALSE;
else
return TRUE;
} else{ /* steep line */
}
else
{ /* steep line */
/* check that control points are between begin and end */
if(Points[1].y < Points[0].y){
if(Points[1].y < Points[3].y) return FALSE;
} else
if(Points[1].y > Points[3].y) return FALSE;
if(Points[2].y < Points[0].y){
if(Points[2].y < Points[3].y) return FALSE;
} else
if(Points[2].y > Points[3].y) return FALSE;
dy=BEZIERSHIFTDOWN(dy);
if(!dy) return TRUE;
if(abs(Points[1].x-Points[0].x-(dx/dy)*
if(Points[1].y < Points[0].y)
{
if(Points[1].y < Points[3].y)
return FALSE;
}
else if(Points[1].y > Points[3].y)
return FALSE;
if ( Points[2].y < Points[0].y )
{
if ( Points[2].y < Points[3].y )
return FALSE;
}
else if ( Points[2].y > Points[3].y )
return FALSE;
dy = BEZIERSHIFTDOWN(dy);
if ( !dy )
return TRUE;
if ( abs(Points[1].x-Points[0].x-(dx/dy)*
BEZIERSHIFTDOWN(Points[1].y-Points[0].y)) > BEZIERPIXEL ||
abs(Points[2].x-Points[0].x-(dx/dy)*
BEZIERSHIFTDOWN(Points[2].y-Points[0].y)) > BEZIERPIXEL ) return FALSE;
BEZIERSHIFTDOWN(Points[2].y-Points[0].y)) > BEZIERPIXEL
)
return FALSE;
else
return TRUE;
}

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: cliprgn.c,v 1.18 2003/07/14 17:36:59 gvg Exp $ */
/* $Id: cliprgn.c,v 1.19 2003/08/11 21:10:49 royce Exp $ */
#undef WIN32_LEAN_AND_MEAN
#include <windows.h>
@ -76,7 +76,7 @@ CLIPPING_UpdateGCRegion(DC* Dc)
}
Dc->CombinedClip = IntEngCreateClipRegion(CombinedRegion->rdh.nCount,
CombinedRegion->Buffer,
(PRECTL)CombinedRegion->Buffer,
CombinedRegion->rdh.rcBound);
ASSERT(NULL != Dc->CombinedClip);

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: color.c,v 1.17 2003/05/18 17:16:17 ea Exp $ */
/* $Id: color.c,v 1.18 2003/08/11 21:10:49 royce Exp $ */
// FIXME: Use PXLATEOBJ logicalToSystem instead of int *mapping
@ -42,7 +42,7 @@ int COLOR_gapFilled = 0;
int COLOR_max = 256;
static HPALETTE hPrimaryPalette = 0; // used for WM_PALETTECHANGED
static HPALETTE hLastRealizedPalette = 0; // UnrealizeObject() needs it
//static HPALETTE hLastRealizedPalette = 0; // UnrealizeObject() needs it
const PALETTEENTRY COLOR_sysPalTemplate[NB_RESERVED_COLORS] =
{
@ -77,7 +77,7 @@ const PALETTEENTRY COLOR_sysPalTemplate[NB_RESERVED_COLORS] =
ULONG FASTCALL W32kGetSysColor(int nIndex)
{
PALETTEENTRY *p = COLOR_sysPalTemplate + (nIndex * sizeof(PALETTEENTRY));
const PALETTEENTRY *p = COLOR_sysPalTemplate + (nIndex * sizeof(PALETTEENTRY));
return RGB(p->peRed, p->peGreen, p->peBlue);
}
@ -167,10 +167,14 @@ HPALETTE STDCALL W32kCreatePalette(CONST PLOGPALETTE palette)
{
PPALOBJ PalObj;
HPALETTE NewPalette = (HPALETTE)EngCreatePalette(PAL_INDEXED, palette->palNumEntries, (PULONG*) palette->palPalEntry, 0, 0, 0);
HPALETTE NewPalette = (HPALETTE)EngCreatePalette(
PAL_INDEXED,
palette->palNumEntries,
(PULONG)palette->palPalEntry,
0, 0, 0);
ULONG size;
PalObj = (PPALOBJ)AccessUserObject(NewPalette);
PalObj = (PPALOBJ)AccessUserObject ( (ULONG)NewPalette );
size = sizeof(LOGPALETTE) + (palette->palNumEntries * sizeof(PALETTEENTRY));
PalObj->logpalette = ExAllocatePool(NonPagedPool, size);
@ -197,7 +201,7 @@ COLORREF STDCALL W32kGetNearestColor(HDC hDC,
if( (dc = DC_HandleToPtr(hDC) ) )
{
HPALETTE hpal = (dc->w.hPalette)? dc->w.hPalette : W32kGetStockObject(DEFAULT_PALETTE);
palObj = (PPALOBJ)AccessUserObject(hpal);
palObj = (PPALOBJ)AccessUserObject((ULONG)hpal);
if (!palObj) {
// GDI_ReleaseObj(hdc);
return nearest;
@ -216,7 +220,7 @@ COLORREF STDCALL W32kGetNearestColor(HDC hDC,
UINT STDCALL W32kGetNearestPaletteIndex(HPALETTE hpal,
COLORREF Color)
{
PPALOBJ palObj = (PPALOBJ)AccessUserObject(hpal);
PPALOBJ palObj = (PPALOBJ)AccessUserObject((ULONG)hpal);
UINT index = 0;
if( palObj )
@ -237,7 +241,7 @@ UINT STDCALL W32kGetPaletteEntries(HPALETTE hpal,
PPALOBJ palPtr;
UINT numEntries;
palPtr = (PPALOBJ)AccessUserObject(hpal);
palPtr = (PPALOBJ)AccessUserObject((ULONG)hpal);
if (!palPtr) return 0;
numEntries = palPtr->logpalette->palNumEntries;
@ -264,8 +268,8 @@ UINT STDCALL W32kGetSystemPaletteEntries(HDC hDC,
UINT Entries,
LPPALETTEENTRY pe)
{
UINT i;
PDC dc;
//UINT i;
//PDC dc;
/*
if (!(dc = AccessUserObject(hdc))) return 0;
@ -291,11 +295,14 @@ UINT STDCALL W32kGetSystemPaletteEntries(HDC hDC,
done:
// GDI_ReleaseObj(hdc);
return count; */
// FIXME UNIMPLEMENTED;
return 0;
}
UINT STDCALL W32kGetSystemPaletteUse(HDC hDC)
{
UNIMPLEMENTED;
return 0;
}
/*!
@ -327,12 +334,12 @@ UINT STDCALL W32kRealizePalette(HDC hDC)
if (!dc)
return 0;
palPtr = (PPALOBJ)AccessUserObject(dc->w.hPalette);
palPtr = (PPALOBJ)AccessUserObject((ULONG)dc->w.hPalette);
SurfGDI = (PSURFGDI)AccessInternalObjectFromUserObject(dc->Surface);
systemPalette = W32kGetStockObject(STOCK_DEFAULT_PALETTE);
sysPtr = (PPALOBJ)AccessInternalObject(systemPalette);
palGDI = (PPALGDI)AccessInternalObject(dc->w.hPalette);
sysGDI = (PPALGDI)AccessInternalObject(systemPalette);
systemPalette = W32kGetStockObject((INT)STOCK_DEFAULT_PALETTE);
sysPtr = (PPALOBJ)AccessInternalObject((ULONG)systemPalette);
palGDI = (PPALGDI)AccessInternalObject((ULONG)dc->w.hPalette);
sysGDI = (PPALGDI)AccessInternalObject((ULONG)systemPalette);
// Step 1: Create mapping of system palette\DC palette
realized = PALETTE_SetMapping(palPtr, 0, palPtr->logpalette->palNumEntries,
@ -453,7 +460,7 @@ UINT STDCALL W32kSetPaletteEntries(HPALETTE hpal,
PPALOBJ palPtr;
INT numEntries;
palPtr = (PPALOBJ)AccessUserObject(hpal);
palPtr = (PPALOBJ)AccessUserObject((ULONG)hpal);
if (!palPtr) return 0;
numEntries = palPtr->logpalette->palNumEntries;
@ -484,9 +491,9 @@ BOOL STDCALL W32kUnrealizeObject(HGDIOBJ hgdiobj)
BOOL STDCALL W32kUpdateColors(HDC hDC)
{
PDC dc;
HWND hWnd;
int size;
//PDC dc;
//HWND hWnd;
//int size;
/*
if (!(dc = AccessUserObject(hDC))) return 0;
size = dc->GDIInfo->ulNumPalReg;
@ -500,6 +507,7 @@ BOOL STDCALL W32kUpdateColors(HDC hDC)
// but it would take forever given the speed of XGet/PutPixel.
if (hWnd && size) Callout.RedrawWindow( hWnd, NULL, 0, RDW_INVALIDATE );
} */
// FIXME UNIMPLEMENTED
return 0x666;
}

View file

@ -1,5 +1,5 @@
/*
* $Id: dib.c,v 1.23 2003/06/06 10:17:44 gvg Exp $
* $Id: dib.c,v 1.24 2003/08/11 21:10:49 royce Exp $
*
* ReactOS W32 Subsystem
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
@ -44,11 +44,11 @@ UINT STDCALL W32kSetDIBColorTable(HDC hDC,
PDC dc;
PALETTEENTRY * palEntry;
PPALOBJ palette;
RGBQUAD *end;
const RGBQUAD *end;
if (!(dc = (PDC)AccessUserObject(hDC))) return 0;
if (!(dc = (PDC)AccessUserObject((ULONG)hDC))) return 0;
if (!(palette = (PPALOBJ)AccessUserObject(dc->DevInfo->hpalDefault)))
if (!(palette = (PPALOBJ)AccessUserObject((ULONG)dc->DevInfo->hpalDefault)))
{
// GDI_ReleaseObj( hdc );
return 0;
@ -56,7 +56,8 @@ UINT STDCALL W32kSetDIBColorTable(HDC hDC,
// Transfer color info
if (dc->w.bitsPerPixel <= 8) {
if (dc->w.bitsPerPixel <= 8)
{
palEntry = palette->logpalette->palPalEntry + StartIndex;
if (StartIndex + Entries > (1 << dc->w.bitsPerPixel))
Entries = (1 << dc->w.bitsPerPixel) - StartIndex;
@ -70,7 +71,9 @@ UINT STDCALL W32kSetDIBColorTable(HDC hDC,
palEntry->peGreen = Colors->rgbGreen;
palEntry->peBlue = Colors->rgbBlue;
}
} else {
}
else
{
Entries = 0;
}
@ -81,13 +84,15 @@ UINT STDCALL W32kSetDIBColorTable(HDC hDC,
}
// Converts a DIB to a device-dependent bitmap
INT STDCALL W32kSetDIBits(HDC hDC,
HBITMAP hBitmap,
UINT StartScan,
UINT ScanLines,
CONST VOID *Bits,
CONST BITMAPINFO *bmi,
UINT ColorUse)
INT STDCALL
W32kSetDIBits(
HDC hDC,
HBITMAP hBitmap,
UINT StartScan,
UINT ScanLines,
CONST VOID *Bits,
CONST BITMAPINFO *bmi,
UINT ColorUse)
{
DC *dc;
BITMAPOBJ *bitmap;
@ -104,7 +109,7 @@ INT STDCALL W32kSetDIBits(HDC hDC,
RGBQUAD *lpRGB;
HPALETTE DDB_Palette, DIB_Palette;
ULONG DDB_Palette_Type, DIB_Palette_Type;
PBYTE vBits = Bits;
const BYTE* vBits = (const BYTE*)Bits;
INT scanDirection = 1, DIBWidth;
// Check parameters
@ -195,18 +200,20 @@ INT STDCALL W32kSetDIBits(HDC hDC,
return result;
}
INT STDCALL W32kSetDIBitsToDevice(HDC hDC,
INT XDest,
INT YDest,
DWORD Width,
DWORD Height,
INT XSrc,
INT YSrc,
UINT StartScan,
UINT ScanLines,
CONST VOID *Bits,
CONST BITMAPINFO *bmi,
UINT ColorUse)
INT STDCALL
W32kSetDIBitsToDevice(
HDC hDC,
INT XDest,
INT YDest,
DWORD Width,
DWORD Height,
INT XSrc,
INT YSrc,
UINT StartScan,
UINT ScanLines,
CONST VOID *Bits,
CONST BITMAPINFO *bmi,
UINT ColorUse)
{
}
@ -854,7 +861,8 @@ PBITMAPOBJ FASTCALL DIBtoDDB(HGLOBAL hPackedDIB, HDC hdc) // FIXME: This should
return pBmp;
}
RGBQUAD * FASTCALL DIB_MapPaletteColors(PDC dc, LPBITMAPINFO lpbmi)
RGBQUAD * FASTCALL
DIB_MapPaletteColors(PDC dc, CONST BITMAPINFO* lpbmi)
{
RGBQUAD *lpRGB;
int nNumColors,i;
@ -863,7 +871,8 @@ RGBQUAD * FASTCALL DIB_MapPaletteColors(PDC dc, LPBITMAPINFO lpbmi)
palObj = AccessUserObject(dc->DevInfo->hpalDefault);
if (palObj == NULL) {
if (palObj == NULL)
{
// RELEASEDCINFO(hDC);
return NULL;
}
@ -875,7 +884,8 @@ RGBQUAD * FASTCALL DIB_MapPaletteColors(PDC dc, LPBITMAPINFO lpbmi)
lpRGB = (RGBQUAD *)ExAllocatePool(NonPagedPool, sizeof(RGBQUAD) * nNumColors);
lpIndex = (DWORD *)&lpbmi->bmiColors[0];
for (i=0; i<nNumColors; i++) {
for (i=0; i<nNumColors; i++)
{
lpRGB[i].rgbRed = palObj->logpalette->palPalEntry[*lpIndex].peRed;
lpRGB[i].rgbGreen = palObj->logpalette->palPalEntry[*lpIndex].peGreen;
lpRGB[i].rgbBlue = palObj->logpalette->palPalEntry[*lpIndex].peBlue;

View file

@ -19,7 +19,7 @@
/*
* GDIOBJ.C - GDI object manipulation routines
*
* $Id: gdiobj.c,v 1.33 2003/08/04 19:08:26 royce Exp $
* $Id: gdiobj.c,v 1.34 2003/08/11 21:10:49 royce Exp $
*
*/
@ -594,7 +594,8 @@ GDIOBJ_LockObjDbg ( const char* file, int line, HGDIOBJ hObj, WORD Magic )
)
)
{
DPRINT1("GDIBOJ_LockObj failed for %d, magic: %d, reqMagic\n",(WORD) hObj & 0xffff, handleEntry->wMagic, Magic);
DPRINT1("GDIBOJ_LockObj failed for %d, magic: %d, reqMagic\n",
(WORD)((size_t)hObj&0xffff), handleEntry->wMagic, Magic);
DPRINT1("\tcalled from: %s:%i\n", file, line );
return NULL;
}
@ -629,9 +630,10 @@ GDIOBJ_UnlockObjDbg ( const char* file, int line, HGDIOBJ hObj, WORD Magic )
)
)
{
DPRINT1("GDIBOJ_UnlockObj failed for %d, magic: %d, reqMagic\n",(WORD) hObj & 0xffff, handleEntry->wMagic, Magic );
DPRINT1("GDIBOJ_UnlockObj failed for %d, magic: %d, reqMagic\n",
(WORD)((size_t)hObj & 0xffff), handleEntry->wMagic, Magic );
DPRINT1("\tcalled from: %s:%i\n", file, line );
return NULL;
return FALSE;
}
//DbgPrint("(%s:%i) GDIOBJ_UnlockObj(0x%x,0x%x)\n", file, line, hObj, Magic );
handleEntry->lockfile = NULL;
@ -666,8 +668,9 @@ GDIOBJ_LockObj( HGDIOBJ hObj, WORD Magic )
)
)
{
DPRINT1("GDIBOJ_LockObj failed for %d, magic: %d, reqMagic\n",(WORD) hObj & 0xffff, handleEntry->wMagic, Magic);
return NULL;
DPRINT1("GDIBOJ_LockObj failed for %d, magic: %d, reqMagic\n",
(WORD)((size_t)hObj & 0xffff), handleEntry->wMagic, Magic);
return NULL;
}
objectHeader = (PGDIOBJHDR) handleEntry->pObject;
@ -713,7 +716,7 @@ GDIOBJ_UnlockObj( HGDIOBJ hObj, WORD Magic )
)
{
DPRINT1( "GDIOBJ_UnLockObj: failed\n");
return FALSE;
return FALSE;
}
objectHeader = (PGDIOBJHDR) handleEntry->pObject;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: line.c,v 1.17 2003/07/14 09:43:11 gvg Exp $ */
/* $Id: line.c,v 1.18 2003/08/11 21:10:49 royce Exp $ */
// Some code from the WINE project source (www.winehq.com)
@ -133,7 +133,7 @@ W32kLineTo(HDC hDC,
int YEnd)
{
DC *dc = DC_HandleToPtr(hDC);
SURFOBJ *SurfObj = (SURFOBJ*)AccessUserObject(dc->Surface);
SURFOBJ *SurfObj = (SURFOBJ*)AccessUserObject((ULONG)dc->Surface);
BOOL Ret;
PPENOBJ Pen;
RECT Bounds;
@ -303,7 +303,7 @@ W32kPolyline(HDC hDC,
int Count)
{
DC *dc = DC_HandleToPtr(hDC);
SURFOBJ *SurfObj = (SURFOBJ*)AccessUserObject(dc->Surface);
SURFOBJ *SurfObj = (SURFOBJ*)AccessUserObject((ULONG)dc->Surface);
BOOL ret;
LONG i;
PPENOBJ pen;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: objconv.c,v 1.9 2003/05/18 17:16:18 ea Exp $ */
/* $Id: objconv.c,v 1.10 2003/08/11 21:10:49 royce Exp $ */
#undef WIN32_LEAN_AND_MEAN
#include <windows.h>
@ -42,7 +42,7 @@
PBRUSHOBJ FASTCALL PenToBrushObj(PDC dc, PENOBJ *pen)
{
BRUSHOBJ *BrushObj;
XLATEOBJ *RGBtoVGA16;
//XLATEOBJ *RGBtoVGA16;
ASSERT( pen );

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: path.c,v 1.10 2003/05/18 17:16:18 ea Exp $ */
/* $Id: path.c,v 1.11 2003/08/11 21:10:49 royce Exp $ */
#undef WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <ddk/ntddk.h>
@ -763,6 +763,12 @@ BOOL FASTCALL PATH_FlattenPath(GdiPath *pPath)
* error occurs, SetLastError is called with the appropriate value and
* FALSE is returned.
*/
#if 0
// FIXME - don't reenable this function until you deal with the
// const pPath being given to PATH_FlattenPath() - which is
// expecting a non-const*. Since this function isn't being called
// at the moment, I'm commenting it out until the issue needs to
// be addressed.
BOOL STDCALL PATH_PathToRegion(const GdiPath *pPath, INT nPolyFillMode,
HRGN *pHrgn)
{
@ -773,7 +779,7 @@ BOOL STDCALL PATH_PathToRegion(const GdiPath *pPath, INT nPolyFillMode,
assert(pPath!=NULL);
assert(pHrgn!=NULL);
PATH_FlattenPath(pPath);
PATH_FlattenPath ( pPath );
/* FIXME: What happens when number of points is zero? */
@ -822,6 +828,7 @@ BOOL STDCALL PATH_PathToRegion(const GdiPath *pPath, INT nPolyFillMode,
*pHrgn=hrgn;
return TRUE;
}
#endif
/* PATH_EmptyPath
*

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: region.c,v 1.30 2003/08/04 19:07:50 royce Exp $ */
/* $Id: region.c,v 1.31 2003/08/11 21:10:49 royce Exp $ */
#undef WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <ddk/ntddk.h>
@ -1833,7 +1833,8 @@ W32kPaintRgn(HDC hDC,
//visrgn = RGNDATA_LockRgn(tmpVisRgn);
visrgn = RGNDATA_LockRgn(hRgn);
ClipRegion = IntEngCreateClipRegion( visrgn->rdh.nCount, visrgn->Buffer, visrgn->rdh.rcBound );
ClipRegion = IntEngCreateClipRegion (
visrgn->rdh.nCount, (PRECTL)visrgn->Buffer, visrgn->rdh.rcBound );
ASSERT( ClipRegion );
pBrush = BRUSHOBJ_LockBrush(dc->w.hBrush);
ASSERT(pBrush);

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: text.c,v 1.40 2003/08/09 21:14:01 gvg Exp $ */
/* $Id: text.c,v 1.41 2003/08/11 21:10:49 royce Exp $ */
#undef WIN32_LEAN_AND_MEAN
@ -861,8 +861,12 @@ W32kGetTextExtentPoint32(HDC hDC,
}
TextObj = TEXTOBJ_LockText(dc->w.hFont);
DC_ReleasePtr(hDC);
Result = TextIntGetTextExtentPoint(dc, String, Count, 0, NULL, NULL, &Size);
Result = TextIntGetTextExtentPoint (
TextObj, String, Count, 0, NULL, NULL, &Size);
dc = DC_HandleToPtr(hDC);
ASSERT(dc); // it succeeded earlier, it should now, too
TEXTOBJ_UnlockText(dc->w.hFont);
DC_ReleasePtr(hDC);
ExFreePool(String);
if (! Result)
@ -1175,7 +1179,18 @@ W32kTextOut(HDC hDC,
SourceGlyphSurf = (PSURFOBJ)AccessUserObject((ULONG) HSourceGlyph);
// Use the font data as a mask to paint onto the DCs surface using a brush
IntEngBitBlt(SurfObj, NULL, SourceGlyphSurf, dc->CombinedClip, NULL, &DestRect, &SourcePoint, &MaskRect, Brush, &BrushOrigin, 0xAACC);
IntEngBitBlt (
SurfObj,
NULL,
SourceGlyphSurf,
dc->CombinedClip,
NULL,
&DestRect,
&SourcePoint,
(PPOINTL)&MaskRect,
Brush,
&BrushOrigin,
0xAACC );
EngDeleteSurface(HSourceGlyph);