mirror of
https://github.com/reactos/reactos.git
synced 2025-07-25 10:53:38 +00:00
- make code ANSI-C compatible (makes msvc more happier )
svn path=/trunk/; revision=30780
This commit is contained in:
parent
d5c52ddf0e
commit
755bf1c3e7
13 changed files with 263 additions and 253 deletions
|
@ -330,11 +330,7 @@ co_IntSetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bR
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure the page size is valid */
|
/* Make sure the page size is valid */
|
||||||
if (Info->nPage < 0)
|
if (Info->nMax - Info->nMin + 1 < Info->nPage)
|
||||||
{
|
|
||||||
Info->nPage = 0;
|
|
||||||
}
|
|
||||||
else if (Info->nMax - Info->nMin + 1 < Info->nPage)
|
|
||||||
{
|
{
|
||||||
Info->nPage = Info->nMax - Info->nMin + 1;
|
Info->nPage = Info->nMax - Info->nMin + 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -261,10 +261,11 @@ DceReleaseDC(DCE* dce, BOOL EndPaint)
|
||||||
{
|
{
|
||||||
if (!(dce->DCXFlags & DCX_NORESETATTRS))
|
if (!(dce->DCXFlags & DCX_NORESETATTRS))
|
||||||
{
|
{
|
||||||
|
PDC dc;
|
||||||
/* make the DC clean so that SetDCState doesn't try to update the vis rgn */
|
/* make the DC clean so that SetDCState doesn't try to update the vis rgn */
|
||||||
IntGdiSetHookFlags(dce->hDC, DCHF_VALIDATEVISRGN);
|
IntGdiSetHookFlags(dce->hDC, DCHF_VALIDATEVISRGN);
|
||||||
|
|
||||||
PDC dc = DC_LockDc ( dce->hDC );
|
dc = DC_LockDc ( dce->hDC );
|
||||||
IntGdiCopyFromSaveState(dc, defaultDCstate, dce->hDC ); // Was SetDCState.
|
IntGdiCopyFromSaveState(dc, defaultDCstate, dce->hDC ); // Was SetDCState.
|
||||||
|
|
||||||
dce->DCXFlags &= ~DCX_DCEBUSY;
|
dce->DCXFlags &= ~DCX_DCEBUSY;
|
||||||
|
|
|
@ -627,7 +627,7 @@ BOOL STDCALL NtGdiResizePalette(HPALETTE hpal,
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL STDCALL NtGdiSetColorAdjustment(HDC hDC,
|
BOOL STDCALL NtGdiSetColorAdjustment(HDC hDC,
|
||||||
CONST LPCOLORADJUSTMENT ca)
|
LPCOLORADJUSTMENT ca)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -37,14 +37,16 @@
|
||||||
void FASTCALL
|
void FASTCALL
|
||||||
IntFixIsotropicMapping(PDC dc)
|
IntFixIsotropicMapping(PDC dc)
|
||||||
{
|
{
|
||||||
|
ULONG xdim;
|
||||||
|
ULONG ydim;
|
||||||
PDC_ATTR Dc_Attr = dc->pDc_Attr;
|
PDC_ATTR Dc_Attr = dc->pDc_Attr;
|
||||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||||
|
|
||||||
ULONG xdim = EngMulDiv(Dc_Attr->szlViewportExt.cx,
|
xdim = EngMulDiv(Dc_Attr->szlViewportExt.cx,
|
||||||
((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzSize,
|
((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzSize,
|
||||||
((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes) /
|
((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes) /
|
||||||
Dc_Attr->szlWindowExt.cx;
|
Dc_Attr->szlWindowExt.cx;
|
||||||
ULONG ydim = EngMulDiv(Dc_Attr->szlViewportExt.cy,
|
ydim = EngMulDiv(Dc_Attr->szlViewportExt.cy,
|
||||||
((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertSize,
|
((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertSize,
|
||||||
((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes) /
|
((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes) /
|
||||||
Dc_Attr->szlWindowExt.cy;
|
Dc_Attr->szlWindowExt.cy;
|
||||||
|
@ -85,8 +87,8 @@ IntGdiCombineTransform(LPXFORM XFormResult,
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL STDCALL NtGdiCombineTransform(LPXFORM UnsafeXFormResult,
|
BOOL STDCALL NtGdiCombineTransform(LPXFORM UnsafeXFormResult,
|
||||||
CONST LPXFORM Unsafexform1,
|
LPXFORM Unsafexform1,
|
||||||
CONST LPXFORM Unsafexform2)
|
LPXFORM Unsafexform2)
|
||||||
{
|
{
|
||||||
XFORM xformTemp;
|
XFORM xformTemp;
|
||||||
XFORM xform1 = {0}, xform2 = {0};
|
XFORM xform1 = {0}, xform2 = {0};
|
||||||
|
@ -433,7 +435,7 @@ NtGdiTransformPoints( HDC hDC,
|
||||||
BOOL
|
BOOL
|
||||||
STDCALL
|
STDCALL
|
||||||
NtGdiModifyWorldTransform(HDC hDC,
|
NtGdiModifyWorldTransform(HDC hDC,
|
||||||
CONST LPXFORM UnsafeXForm,
|
LPXFORM UnsafeXForm,
|
||||||
DWORD Mode)
|
DWORD Mode)
|
||||||
{
|
{
|
||||||
PDC dc;
|
PDC dc;
|
||||||
|
|
|
@ -1103,7 +1103,7 @@ NtGdiGetDCPoint( HDC hDC, UINT iPoint, PPOINTL Point)
|
||||||
{
|
{
|
||||||
BOOL Ret = TRUE;
|
BOOL Ret = TRUE;
|
||||||
DC *dc;
|
DC *dc;
|
||||||
POINT SafePoint;
|
POINTL SafePoint;
|
||||||
SIZE Size;
|
SIZE Size;
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
@ -1997,7 +1997,7 @@ NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dc->w.bitsPerPixel = BitsPerFormat(pb->SurfObj.iBitmapFormat);
|
dc->w.bitsPerPixel = BitsPerFormat(pb->SurfObj.iBitmapFormat);
|
||||||
dc->w.hPalette = ((DEVINFO)((GDIDEVICE *)dc->pPDev)->DevInfo).hpalDefault;
|
dc->w.hPalette = ((GDIDEVICE *)dc->pPDev)->DevInfo.hpalDefault;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reselect brush and pen to regenerate the XLATEOBJs. */
|
/* Reselect brush and pen to regenerate the XLATEOBJs. */
|
||||||
|
@ -2373,6 +2373,7 @@ FASTCALL
|
||||||
DC_AllocateDcAttr(HDC hDC)
|
DC_AllocateDcAttr(HDC hDC)
|
||||||
{
|
{
|
||||||
PVOID NewMem = NULL;
|
PVOID NewMem = NULL;
|
||||||
|
PDC pDC;
|
||||||
HANDLE Pid = NtCurrentProcess();
|
HANDLE Pid = NtCurrentProcess();
|
||||||
ULONG MemSize = sizeof(DC_ATTR); //PAGE_SIZE it will allocate that size
|
ULONG MemSize = sizeof(DC_ATTR); //PAGE_SIZE it will allocate that size
|
||||||
|
|
||||||
|
@ -2399,7 +2400,7 @@ DC_AllocateDcAttr(HDC hDC)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
KeLeaveCriticalRegion();
|
KeLeaveCriticalRegion();
|
||||||
PDC pDC = DC_LockDc(hDC);
|
pDC = DC_LockDc(hDC);
|
||||||
if(NewMem)
|
if(NewMem)
|
||||||
{
|
{
|
||||||
pDC->pDc_Attr = NewMem; // Store pointer
|
pDC->pDc_Attr = NewMem; // Store pointer
|
||||||
|
|
|
@ -134,9 +134,10 @@ BOOL
|
||||||
FASTCALL
|
FASTCALL
|
||||||
DCU_SynchDcAttrtoUser(HDC hDC)
|
DCU_SynchDcAttrtoUser(HDC hDC)
|
||||||
{
|
{
|
||||||
|
BOOL Ret;
|
||||||
PDC pDC = DC_LockDc ( hDC );
|
PDC pDC = DC_LockDc ( hDC );
|
||||||
if (!pDC) return FALSE;
|
if (!pDC) return FALSE;
|
||||||
BOOL Ret = DCU_SyncDcAttrtoUser(pDC);
|
Ret = DCU_SyncDcAttrtoUser(pDC);
|
||||||
DC_UnlockDc( pDC );
|
DC_UnlockDc( pDC );
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -209,7 +209,7 @@ IntSetDIBits(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Destination palette obtained from the hDC
|
// Destination palette obtained from the hDC
|
||||||
hDCPalette = PALETTE_LockPalette(((DEVINFO)((GDIDEVICE *)DC->pPDev)->DevInfo).hpalDefault);
|
hDCPalette = PALETTE_LockPalette(((GDIDEVICE *)DC->pPDev)->DevInfo.hpalDefault);
|
||||||
if (NULL == hDCPalette)
|
if (NULL == hDCPalette)
|
||||||
{
|
{
|
||||||
EngUnlockSurface(SourceSurf);
|
EngUnlockSurface(SourceSurf);
|
||||||
|
@ -219,7 +219,7 @@ IntSetDIBits(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DDB_Palette_Type = hDCPalette->Mode;
|
DDB_Palette_Type = hDCPalette->Mode;
|
||||||
DDB_Palette = ((DEVINFO)((GDIDEVICE *)DC->pPDev)->DevInfo).hpalDefault;
|
DDB_Palette = ((GDIDEVICE *)DC->pPDev)->DevInfo.hpalDefault;
|
||||||
PALETTE_UnlockPalette(hDCPalette);
|
PALETTE_UnlockPalette(hDCPalette);
|
||||||
|
|
||||||
// Source palette obtained from the BITMAPINFO
|
// Source palette obtained from the BITMAPINFO
|
||||||
|
@ -489,9 +489,11 @@ NtGdiGetDIBitsInternal(HDC hDC,
|
||||||
{
|
{
|
||||||
if (Info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
|
if (Info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
|
||||||
{
|
{
|
||||||
|
BITMAPCOREHEADER* coreheader;
|
||||||
|
|
||||||
ProbeForWrite(Info, sizeof(BITMAPINFO), 1);
|
ProbeForWrite(Info, sizeof(BITMAPINFO), 1);
|
||||||
|
|
||||||
BITMAPCOREHEADER* coreheader = (BITMAPCOREHEADER*) Info;
|
coreheader = (BITMAPCOREHEADER*) Info;
|
||||||
coreheader->bcWidth =BitmapObj->SurfObj.sizlBitmap.cx;
|
coreheader->bcWidth =BitmapObj->SurfObj.sizlBitmap.cx;
|
||||||
coreheader->bcPlanes = 1;
|
coreheader->bcPlanes = 1;
|
||||||
coreheader->bcBitCount = BitsPerFormat(BitmapObj->SurfObj.iBitmapFormat);
|
coreheader->bcBitCount = BitsPerFormat(BitmapObj->SurfObj.iBitmapFormat);
|
||||||
|
|
|
@ -20,6 +20,7 @@ GdiFlushUserBatch(HDC hDC, PGDIBATCHHDR pHdr)
|
||||||
{
|
{
|
||||||
PDC dc = NULL;
|
PDC dc = NULL;
|
||||||
PDC_ATTR Dc_Attr = NULL;
|
PDC_ATTR Dc_Attr = NULL;
|
||||||
|
PGDIBSSETBRHORG pgSBO;
|
||||||
if (hDC)
|
if (hDC)
|
||||||
{
|
{
|
||||||
dc = DC_LockDc(hDC);
|
dc = DC_LockDc(hDC);
|
||||||
|
@ -40,7 +41,7 @@ GdiFlushUserBatch(HDC hDC, PGDIBATCHHDR pHdr)
|
||||||
case GdiBCSetBrushOrg:
|
case GdiBCSetBrushOrg:
|
||||||
{
|
{
|
||||||
if (!dc) break;
|
if (!dc) break;
|
||||||
PGDIBSSETBRHORG pgSBO = (PGDIBSSETBRHORG) pHdr;
|
pgSBO = (PGDIBSSETBRHORG) pHdr;
|
||||||
Dc_Attr->ptlBrushOrigin = pgSBO->ptlBrushOrigin;
|
Dc_Attr->ptlBrushOrigin = pgSBO->ptlBrushOrigin;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -389,10 +389,6 @@ NtGdiCreateEnhMetaFile(HDC hDCRef,
|
||||||
ret = tempHDC;
|
ret = tempHDC;
|
||||||
if (File)
|
if (File)
|
||||||
{
|
{
|
||||||
DPRINT1("Trying Create EnhMetaFile\n");
|
|
||||||
|
|
||||||
/* disk based metafile */
|
|
||||||
dwDesiredAccess = GENERIC_WRITE | GENERIC_READ | SYNCHRONIZE | FILE_READ_ATTRIBUTES;
|
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
IO_STATUS_BLOCK IoStatusBlock;
|
IO_STATUS_BLOCK IoStatusBlock;
|
||||||
IO_STATUS_BLOCK Iosb;
|
IO_STATUS_BLOCK Iosb;
|
||||||
|
@ -400,6 +396,11 @@ NtGdiCreateEnhMetaFile(HDC hDCRef,
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
ULONG FileAttributes = (FILE_ATTRIBUTE_VALID_FLAGS & ~FILE_ATTRIBUTE_DIRECTORY);
|
ULONG FileAttributes = (FILE_ATTRIBUTE_VALID_FLAGS & ~FILE_ATTRIBUTE_DIRECTORY);
|
||||||
|
|
||||||
|
DPRINT1("Trying Create EnhMetaFile\n");
|
||||||
|
|
||||||
|
/* disk based metafile */
|
||||||
|
dwDesiredAccess = GENERIC_WRITE | GENERIC_READ | SYNCHRONIZE | FILE_READ_ATTRIBUTES;
|
||||||
|
|
||||||
if (!RtlDosPathNameToNtPathName_U (File, &NtPathU, NULL, NULL))
|
if (!RtlDosPathNameToNtPathName_U (File, &NtPathU, NULL, NULL))
|
||||||
{
|
{
|
||||||
DC_UnlockDc(Dc);
|
DC_UnlockDc(Dc);
|
||||||
|
|
|
@ -395,7 +395,7 @@ PATH_FillPath( PDC dc, GdiPath *pPath )
|
||||||
{
|
{
|
||||||
INT mapMode, graphicsMode;
|
INT mapMode, graphicsMode;
|
||||||
SIZE ptViewportExt, ptWindowExt;
|
SIZE ptViewportExt, ptWindowExt;
|
||||||
POINT ptViewportOrg, ptWindowOrg;
|
POINTL ptViewportOrg, ptWindowOrg;
|
||||||
XFORM xform;
|
XFORM xform;
|
||||||
HRGN hrgn;
|
HRGN hrgn;
|
||||||
PDC_ATTR Dc_Attr = dc->pDc_Attr;
|
PDC_ATTR Dc_Attr = dc->pDc_Attr;
|
||||||
|
@ -663,7 +663,7 @@ PATH_Rectangle ( PDC dc, INT x1, INT y1, INT x2, INT y2 )
|
||||||
* is an error in the bezier drawing code so that there are small pixel-size
|
* is an error in the bezier drawing code so that there are small pixel-size
|
||||||
* gaps when the resulting path is drawn by StrokePath()
|
* gaps when the resulting path is drawn by StrokePath()
|
||||||
*/
|
*/
|
||||||
FASTCALL BOOL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT ell_height)
|
BOOL FASTCALL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT ell_height)
|
||||||
{
|
{
|
||||||
GdiPath *pPath = &dc->w.path;
|
GdiPath *pPath = &dc->w.path;
|
||||||
POINT corners[2], pointTemp;
|
POINT corners[2], pointTemp;
|
||||||
|
|
|
@ -2758,7 +2758,7 @@ UnsafeIntRectInRegion(PROSRGNDATA Rgn,
|
||||||
BOOL
|
BOOL
|
||||||
STDCALL
|
STDCALL
|
||||||
NtGdiRectInRegion(HRGN hRgn,
|
NtGdiRectInRegion(HRGN hRgn,
|
||||||
CONST LPRECT unsaferc)
|
LPRECT unsaferc)
|
||||||
{
|
{
|
||||||
PROSRGNDATA Rgn;
|
PROSRGNDATA Rgn;
|
||||||
RECT rc = {0};
|
RECT rc = {0};
|
||||||
|
|
|
@ -173,7 +173,7 @@ IntLoadSystemFonts(VOID)
|
||||||
HANDLE hDirectory;
|
HANDLE hDirectory;
|
||||||
BYTE *DirInfoBuffer;
|
BYTE *DirInfoBuffer;
|
||||||
PFILE_DIRECTORY_INFORMATION DirInfo;
|
PFILE_DIRECTORY_INFORMATION DirInfo;
|
||||||
BOOL bRestartScan = TRUE;
|
BOOLEAN bRestartScan = TRUE;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
RtlInitUnicodeString(&Directory, L"\\SystemRoot\\media\\fonts\\");
|
RtlInitUnicodeString(&Directory, L"\\SystemRoot\\media\\fonts\\");
|
||||||
|
@ -2583,7 +2583,7 @@ FTVectorToPOINTFX(FT_Vector *vec, POINTFX *pt)
|
||||||
in the highest 16 bits and the decimal part in the lowest 16 bits of the FT_Fixed.
|
in the highest 16 bits and the decimal part in the lowest 16 bits of the FT_Fixed.
|
||||||
It fails if the integer part of the float number is greater than SHORT_MAX.
|
It fails if the integer part of the float number is greater than SHORT_MAX.
|
||||||
*/
|
*/
|
||||||
static inline FT_Fixed FT_FixedFromFloat(float f)
|
static __inline FT_Fixed FT_FixedFromFloat(float f)
|
||||||
{
|
{
|
||||||
short value = f;
|
short value = f;
|
||||||
unsigned short fract = (f - value) * 0xFFFF;
|
unsigned short fract = (f - value) * 0xFFFF;
|
||||||
|
@ -2594,7 +2594,7 @@ static inline FT_Fixed FT_FixedFromFloat(float f)
|
||||||
This function builds an FT_Fixed from a FIXED. It simply put f.value
|
This function builds an FT_Fixed from a FIXED. It simply put f.value
|
||||||
in the highest 16 bits and f.fract in the lowest 16 bits of the FT_Fixed.
|
in the highest 16 bits and f.fract in the lowest 16 bits of the FT_Fixed.
|
||||||
*/
|
*/
|
||||||
static inline FT_Fixed FT_FixedFromFIXED(FIXED f)
|
static __inline FT_Fixed FT_FixedFromFIXED(FIXED f)
|
||||||
{
|
{
|
||||||
return (FT_Fixed)((long)f.value << 16 | (unsigned long)f.fract);
|
return (FT_Fixed)((long)f.value << 16 | (unsigned long)f.fract);
|
||||||
}
|
}
|
||||||
|
@ -3364,10 +3364,11 @@ DWORD
|
||||||
NtGdiGetCharSet(HDC hDC)
|
NtGdiGetCharSet(HDC hDC)
|
||||||
{
|
{
|
||||||
PDC Dc;
|
PDC Dc;
|
||||||
|
PDC_ATTR Dc_Attr;
|
||||||
DWORD cscp = IntGdiGetCharSet(hDC);
|
DWORD cscp = IntGdiGetCharSet(hDC);
|
||||||
// If here, update everything!
|
// If here, update everything!
|
||||||
Dc = DC_LockDc(hDC);
|
Dc = DC_LockDc(hDC);
|
||||||
PDC_ATTR Dc_Attr = Dc->pDc_Attr;
|
Dc_Attr = Dc->pDc_Attr;
|
||||||
if (!Dc_Attr) Dc_Attr = &Dc->Dc_Attr;
|
if (!Dc_Attr) Dc_Attr = &Dc->Dc_Attr;
|
||||||
if (!Dc)
|
if (!Dc)
|
||||||
{
|
{
|
||||||
|
@ -3621,7 +3622,7 @@ NtGdiGetTextExtentExW(
|
||||||
|
|
||||||
/* FIXME: Handle fl */
|
/* FIXME: Handle fl */
|
||||||
|
|
||||||
if (Count < 0)
|
if (!Count)
|
||||||
{
|
{
|
||||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue