mirror of
https://github.com/reactos/reactos.git
synced 2025-05-19 17:14:32 +00:00
Fix indentation by replacing tabs by spaces. No code change
svn path=/trunk/; revision=22119
This commit is contained in:
parent
e7b716926f
commit
db04a303ee
1 changed files with 237 additions and 238 deletions
|
@ -53,14 +53,14 @@ static GDIDEVICE PrimarySurface;
|
||||||
func_type STDCALL func_name( HDC hdc ) \
|
func_type STDCALL func_name( HDC hdc ) \
|
||||||
{ \
|
{ \
|
||||||
func_type ft; \
|
func_type ft; \
|
||||||
PDC dc = DC_LockDc( hdc ); \
|
PDC dc = DC_LockDc( hdc ); \
|
||||||
if (!dc) \
|
if (!dc) \
|
||||||
{ \
|
{ \
|
||||||
SetLastWin32Error(ERROR_INVALID_HANDLE); \
|
SetLastWin32Error(ERROR_INVALID_HANDLE); \
|
||||||
return 0; \
|
return 0; \
|
||||||
} \
|
} \
|
||||||
ft = dc->dc_field; \
|
ft = dc->dc_field; \
|
||||||
DC_UnlockDc(dc); \
|
DC_UnlockDc(dc); \
|
||||||
return ft; \
|
return ft; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -650,7 +650,7 @@ IntPrepareDriver()
|
||||||
/* Complete initialization of the physical device */
|
/* Complete initialization of the physical device */
|
||||||
PrimarySurface.DriverFunctions.CompletePDEV(
|
PrimarySurface.DriverFunctions.CompletePDEV(
|
||||||
PrimarySurface.PDev,
|
PrimarySurface.PDev,
|
||||||
(HDEV)&PrimarySurface);
|
(HDEV)&PrimarySurface);
|
||||||
|
|
||||||
DPRINT("calling DRIVER_ReferenceDriver\n");
|
DPRINT("calling DRIVER_ReferenceDriver\n");
|
||||||
|
|
||||||
|
@ -733,7 +733,7 @@ IntCreatePrimarySurface()
|
||||||
RECTL SurfaceRect;
|
RECTL SurfaceRect;
|
||||||
SURFOBJ *SurfObj;
|
SURFOBJ *SurfObj;
|
||||||
BOOL calledFromUser;
|
BOOL calledFromUser;
|
||||||
|
|
||||||
if (! IntPrepareDriverIfNeeded())
|
if (! IntPrepareDriverIfNeeded())
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -793,8 +793,8 @@ IntCreatePrimarySurface()
|
||||||
VOID FASTCALL
|
VOID FASTCALL
|
||||||
IntDestroyPrimarySurface()
|
IntDestroyPrimarySurface()
|
||||||
{
|
{
|
||||||
BOOL calledFromUser;
|
BOOL calledFromUser;
|
||||||
|
|
||||||
DRIVER_UnreferenceDriver(L"DISPLAY");
|
DRIVER_UnreferenceDriver(L"DISPLAY");
|
||||||
|
|
||||||
calledFromUser = UserIsEntered();
|
calledFromUser = UserIsEntered();
|
||||||
|
@ -838,7 +838,7 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
|
||||||
HRGN hVisRgn;
|
HRGN hVisRgn;
|
||||||
UNICODE_STRING StdDriver;
|
UNICODE_STRING StdDriver;
|
||||||
BOOL calledFromUser;
|
BOOL calledFromUser;
|
||||||
|
|
||||||
RtlInitUnicodeString(&StdDriver, L"DISPLAY");
|
RtlInitUnicodeString(&StdDriver, L"DISPLAY");
|
||||||
|
|
||||||
if (NULL == Driver || 0 == RtlCompareUnicodeString(Driver, &StdDriver, TRUE))
|
if (NULL == Driver || 0 == RtlCompareUnicodeString(Driver, &StdDriver, TRUE))
|
||||||
|
@ -857,20 +857,20 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
|
||||||
if (!calledFromUser){
|
if (!calledFromUser){
|
||||||
UserEnterExclusive();
|
UserEnterExclusive();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! co_IntGraphicsCheck(TRUE))
|
if (! co_IntGraphicsCheck(TRUE))
|
||||||
{
|
{
|
||||||
if (!calledFromUser){
|
if (!calledFromUser){
|
||||||
UserLeave();
|
UserLeave();
|
||||||
}
|
}
|
||||||
DPRINT1("Unable to initialize graphics, returning NULL dc\n");
|
DPRINT1("Unable to initialize graphics, returning NULL dc\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!calledFromUser){
|
if (!calledFromUser){
|
||||||
UserLeave();
|
UserLeave();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -904,7 +904,7 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
|
||||||
NewDC->DevInfo = &PrimarySurface.DevInfo;
|
NewDC->DevInfo = &PrimarySurface.DevInfo;
|
||||||
NewDC->GDIInfo = &PrimarySurface.GDIInfo;
|
NewDC->GDIInfo = &PrimarySurface.GDIInfo;
|
||||||
memcpy(NewDC->FillPatternSurfaces, PrimarySurface.FillPatterns,
|
memcpy(NewDC->FillPatternSurfaces, PrimarySurface.FillPatterns,
|
||||||
sizeof(NewDC->FillPatternSurfaces));
|
sizeof(NewDC->FillPatternSurfaces));
|
||||||
NewDC->PDev = PrimarySurface.PDev;
|
NewDC->PDev = PrimarySurface.PDev;
|
||||||
NewDC->GDIDevice = (HDEV)&PrimarySurface;
|
NewDC->GDIDevice = (HDEV)&PrimarySurface;
|
||||||
NewDC->DriverFunctions = PrimarySurface.DriverFunctions;
|
NewDC->DriverFunctions = PrimarySurface.DriverFunctions;
|
||||||
|
@ -1078,7 +1078,7 @@ NtGdiDeleteObjectApp(HANDLE DCHandle)
|
||||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
DCToDelete = DC_LockDc(DCHandle);
|
DCToDelete = DC_LockDc(DCHandle);
|
||||||
if (DCToDelete == NULL)
|
if (DCToDelete == NULL)
|
||||||
{
|
{
|
||||||
|
@ -1411,104 +1411,104 @@ NtGdiSetDCState ( HDC hDC, HDC hDCSave )
|
||||||
{
|
{
|
||||||
if ( dcs->w.flags & DC_SAVED )
|
if ( dcs->w.flags & DC_SAVED )
|
||||||
{
|
{
|
||||||
dc->w.flags = dcs->w.flags & ~DC_SAVED;
|
dc->w.flags = dcs->w.flags & ~DC_SAVED;
|
||||||
|
|
||||||
dc->w.hFirstBitmap = dcs->w.hFirstBitmap;
|
dc->w.hFirstBitmap = dcs->w.hFirstBitmap;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
dc->w.hDevice = dcs->w.hDevice;
|
dc->w.hDevice = dcs->w.hDevice;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
dc->w.totalExtent = dcs->w.totalExtent;
|
dc->w.totalExtent = dcs->w.totalExtent;
|
||||||
dc->w.ROPmode = dcs->w.ROPmode;
|
dc->w.ROPmode = dcs->w.ROPmode;
|
||||||
dc->w.polyFillMode = dcs->w.polyFillMode;
|
dc->w.polyFillMode = dcs->w.polyFillMode;
|
||||||
dc->w.stretchBltMode = dcs->w.stretchBltMode;
|
dc->w.stretchBltMode = dcs->w.stretchBltMode;
|
||||||
dc->w.relAbsMode = dcs->w.relAbsMode;
|
dc->w.relAbsMode = dcs->w.relAbsMode;
|
||||||
dc->w.backgroundMode = dcs->w.backgroundMode;
|
dc->w.backgroundMode = dcs->w.backgroundMode;
|
||||||
dc->w.backgroundColor = dcs->w.backgroundColor;
|
dc->w.backgroundColor = dcs->w.backgroundColor;
|
||||||
dc->w.textColor = dcs->w.textColor;
|
dc->w.textColor = dcs->w.textColor;
|
||||||
dc->w.brushOrgX = dcs->w.brushOrgX;
|
dc->w.brushOrgX = dcs->w.brushOrgX;
|
||||||
dc->w.brushOrgY = dcs->w.brushOrgY;
|
dc->w.brushOrgY = dcs->w.brushOrgY;
|
||||||
dc->w.textAlign = dcs->w.textAlign;
|
dc->w.textAlign = dcs->w.textAlign;
|
||||||
dc->w.charExtra = dcs->w.charExtra;
|
dc->w.charExtra = dcs->w.charExtra;
|
||||||
dc->w.breakTotalExtra = dcs->w.breakTotalExtra;
|
dc->w.breakTotalExtra = dcs->w.breakTotalExtra;
|
||||||
dc->w.breakCount = dcs->w.breakCount;
|
dc->w.breakCount = dcs->w.breakCount;
|
||||||
dc->w.breakExtra = dcs->w.breakExtra;
|
dc->w.breakExtra = dcs->w.breakExtra;
|
||||||
dc->w.breakRem = dcs->w.breakRem;
|
dc->w.breakRem = dcs->w.breakRem;
|
||||||
dc->w.MapMode = dcs->w.MapMode;
|
dc->w.MapMode = dcs->w.MapMode;
|
||||||
dc->w.GraphicsMode = dcs->w.GraphicsMode;
|
dc->w.GraphicsMode = dcs->w.GraphicsMode;
|
||||||
#if 0
|
#if 0
|
||||||
/* Apparently, the DC origin is not changed by [GS]etDCState */
|
/* Apparently, the DC origin is not changed by [GS]etDCState */
|
||||||
dc->w.DCOrgX = dcs->w.DCOrgX;
|
dc->w.DCOrgX = dcs->w.DCOrgX;
|
||||||
dc->w.DCOrgY = dcs->w.DCOrgY;
|
dc->w.DCOrgY = dcs->w.DCOrgY;
|
||||||
#endif
|
#endif
|
||||||
dc->w.CursPosX = dcs->w.CursPosX;
|
dc->w.CursPosX = dcs->w.CursPosX;
|
||||||
dc->w.CursPosY = dcs->w.CursPosY;
|
dc->w.CursPosY = dcs->w.CursPosY;
|
||||||
dc->w.ArcDirection = dcs->w.ArcDirection;
|
dc->w.ArcDirection = dcs->w.ArcDirection;
|
||||||
|
|
||||||
dc->w.xformWorld2Wnd = dcs->w.xformWorld2Wnd;
|
dc->w.xformWorld2Wnd = dcs->w.xformWorld2Wnd;
|
||||||
dc->w.xformWorld2Vport = dcs->w.xformWorld2Vport;
|
dc->w.xformWorld2Vport = dcs->w.xformWorld2Vport;
|
||||||
dc->w.xformVport2World = dcs->w.xformVport2World;
|
dc->w.xformVport2World = dcs->w.xformVport2World;
|
||||||
dc->w.vport2WorldValid = dcs->w.vport2WorldValid;
|
dc->w.vport2WorldValid = dcs->w.vport2WorldValid;
|
||||||
|
|
||||||
dc->wndOrgX = dcs->wndOrgX;
|
dc->wndOrgX = dcs->wndOrgX;
|
||||||
dc->wndOrgY = dcs->wndOrgY;
|
dc->wndOrgY = dcs->wndOrgY;
|
||||||
dc->wndExtX = dcs->wndExtX;
|
dc->wndExtX = dcs->wndExtX;
|
||||||
dc->wndExtY = dcs->wndExtY;
|
dc->wndExtY = dcs->wndExtY;
|
||||||
dc->vportOrgX = dcs->vportOrgX;
|
dc->vportOrgX = dcs->vportOrgX;
|
||||||
dc->vportOrgY = dcs->vportOrgY;
|
dc->vportOrgY = dcs->vportOrgY;
|
||||||
dc->vportExtX = dcs->vportExtX;
|
dc->vportExtX = dcs->vportExtX;
|
||||||
dc->vportExtY = dcs->vportExtY;
|
dc->vportExtY = dcs->vportExtY;
|
||||||
dc->PalIndexed = dcs->PalIndexed;
|
dc->PalIndexed = dcs->PalIndexed;
|
||||||
|
|
||||||
if (!(dc->w.flags & DC_MEMORY))
|
if (!(dc->w.flags & DC_MEMORY))
|
||||||
{
|
{
|
||||||
dc->w.bitsPerPixel = dcs->w.bitsPerPixel;
|
dc->w.bitsPerPixel = dcs->w.bitsPerPixel;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (dcs->w.hClipRgn)
|
if (dcs->w.hClipRgn)
|
||||||
{
|
{
|
||||||
if (!dc->w.hClipRgn)
|
if (!dc->w.hClipRgn)
|
||||||
{
|
{
|
||||||
dc->w.hClipRgn = NtGdiCreateRectRgn( 0, 0, 0, 0 );
|
dc->w.hClipRgn = NtGdiCreateRectRgn( 0, 0, 0, 0 );
|
||||||
}
|
}
|
||||||
NtGdiCombineRgn( dc->w.hClipRgn, dcs->w.hClipRgn, 0, RGN_COPY );
|
NtGdiCombineRgn( dc->w.hClipRgn, dcs->w.hClipRgn, 0, RGN_COPY );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (dc->w.hClipRgn)
|
if (dc->w.hClipRgn)
|
||||||
{
|
{
|
||||||
NtGdiDeleteObject( dc->w.hClipRgn );
|
NtGdiDeleteObject( dc->w.hClipRgn );
|
||||||
}
|
}
|
||||||
|
|
||||||
dc->w.hClipRgn = 0;
|
dc->w.hClipRgn = 0;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
res = CLIPPING_UpdateGCRegion( dc );
|
res = CLIPPING_UpdateGCRegion( dc );
|
||||||
ASSERT ( res != ERROR );
|
ASSERT ( res != ERROR );
|
||||||
}
|
}
|
||||||
DC_UnlockDc ( dc );
|
DC_UnlockDc ( dc );
|
||||||
#else
|
#else
|
||||||
DC_UnlockDc ( dc );
|
DC_UnlockDc ( dc );
|
||||||
NtGdiSelectClipRgn(hDC, dcs->w.hClipRgn);
|
NtGdiSelectClipRgn(hDC, dcs->w.hClipRgn);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NtGdiSelectObject( hDC, dcs->w.hBitmap );
|
NtGdiSelectObject( hDC, dcs->w.hBitmap );
|
||||||
NtGdiSelectObject( hDC, dcs->w.hBrush );
|
NtGdiSelectObject( hDC, dcs->w.hBrush );
|
||||||
NtGdiSelectObject( hDC, dcs->w.hFont );
|
NtGdiSelectObject( hDC, dcs->w.hFont );
|
||||||
NtGdiSelectObject( hDC, dcs->w.hPen );
|
NtGdiSelectObject( hDC, dcs->w.hPen );
|
||||||
NtGdiSetBkColor( hDC, dcs->w.backgroundColor);
|
NtGdiSetBkColor( hDC, dcs->w.backgroundColor);
|
||||||
NtGdiSetTextColor( hDC, dcs->w.textColor);
|
NtGdiSetTextColor( hDC, dcs->w.textColor);
|
||||||
|
|
||||||
NtGdiSelectPalette( hDC, dcs->w.hPalette, FALSE );
|
NtGdiSelectPalette( hDC, dcs->w.hPalette, FALSE );
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
GDISelectPalette16( hDC, dcs->w.hPalette, FALSE );
|
GDISelectPalette16( hDC, dcs->w.hPalette, FALSE );
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
DC_UnlockDc(dc);
|
DC_UnlockDc(dc);
|
||||||
}
|
}
|
||||||
DC_UnlockDc ( dcs );
|
DC_UnlockDc ( dcs );
|
||||||
} else {
|
} else {
|
||||||
|
@ -1624,7 +1624,7 @@ IntGdiGetDeviceCaps(PDC dc, INT Index)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1635,7 +1635,7 @@ IntGdiGetDeviceCaps(PDC dc, INT Index)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1646,7 +1646,7 @@ IntGdiGetDeviceCaps(PDC dc, INT Index)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1657,7 +1657,7 @@ IntGdiGetDeviceCaps(PDC dc, INT Index)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1672,7 +1672,7 @@ IntGdiGetDeviceCaps(PDC dc, INT Index)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1683,7 +1683,7 @@ IntGdiGetDeviceCaps(PDC dc, INT Index)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1802,12 +1802,12 @@ NtGdiGetObject(HANDLE handle, INT count, LPVOID buffer)
|
||||||
|
|
||||||
/* From Wine: GetObject does not SetLastError() on a null object */
|
/* From Wine: GetObject does not SetLastError() on a null object */
|
||||||
if (!handle) return 0;
|
if (!handle) return 0;
|
||||||
|
|
||||||
if (count <= 0)
|
if (count <= 0)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
_SEH_TRY
|
_SEH_TRY
|
||||||
{
|
{
|
||||||
ProbeForWrite(buffer,
|
ProbeForWrite(buffer,
|
||||||
|
@ -1819,7 +1819,7 @@ NtGdiGetObject(HANDLE handle, INT count, LPVOID buffer)
|
||||||
Status = _SEH_GetExceptionCode();
|
Status = _SEH_GetExceptionCode();
|
||||||
}
|
}
|
||||||
_SEH_END;
|
_SEH_END;
|
||||||
|
|
||||||
if(!NT_SUCCESS(Status))
|
if(!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
SetLastNtError(Status);
|
SetLastNtError(Status);
|
||||||
|
@ -1985,7 +1985,7 @@ NtGdiRestoreDC(HDC hDC, INT SaveLevel)
|
||||||
DC_SetNextDC (dcs, DC_GetNextDC (dcs));
|
DC_SetNextDC (dcs, DC_GetNextDC (dcs));
|
||||||
if (--dc->saveLevel < SaveLevel)
|
if (--dc->saveLevel < SaveLevel)
|
||||||
{
|
{
|
||||||
DC_UnlockDc( dc );
|
DC_UnlockDc( dc );
|
||||||
DC_UnlockDc( dcs );
|
DC_UnlockDc( dcs );
|
||||||
NtGdiSetDCState(hDC, hdcs);
|
NtGdiSetDCState(hDC, hdcs);
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -1996,11 +1996,11 @@ NtGdiRestoreDC(HDC hDC, INT SaveLevel)
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
dc = DC_LockDc(hDC);
|
dc = DC_LockDc(hDC);
|
||||||
if(!dc)
|
if(!dc)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2077,17 +2077,17 @@ NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
||||||
HRGN hVisRgn;
|
HRGN hVisRgn;
|
||||||
BOOLEAN Failed;
|
BOOLEAN Failed;
|
||||||
|
|
||||||
if (!hDC || !hGDIObj)
|
if (!hDC || !hGDIObj)
|
||||||
{
|
{
|
||||||
/* From Wine:
|
/* From Wine:
|
||||||
* SelectObject() with a NULL DC returns 0 and sets ERROR_INVALID_HANDLE.
|
* SelectObject() with a NULL DC returns 0 and sets ERROR_INVALID_HANDLE.
|
||||||
* Note: Under XP at least invalid ptrs can also be passed, not just NULL;
|
* Note: Under XP at least invalid ptrs can also be passed, not just NULL;
|
||||||
* Don't test that here in case it crashes earlier win versions.
|
* Don't test that here in case it crashes earlier win versions.
|
||||||
*/
|
*/
|
||||||
if (!hDC) SetLastWin32Error(ERROR_INVALID_HANDLE);
|
if (!hDC) SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
dc = DC_LockDc(hDC);
|
dc = DC_LockDc(hDC);
|
||||||
if (NULL == dc)
|
if (NULL == dc)
|
||||||
{
|
{
|
||||||
|
@ -2162,11 +2162,11 @@ NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
||||||
}
|
}
|
||||||
pb = BITMAPOBJ_LockBitmap(hGDIObj);
|
pb = BITMAPOBJ_LockBitmap(hGDIObj);
|
||||||
if (NULL == pb)
|
if (NULL == pb)
|
||||||
{
|
{
|
||||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||||
DC_UnlockDc(dc);
|
DC_UnlockDc(dc);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
objOrg = (HGDIOBJ)dc->w.hBitmap;
|
objOrg = (HGDIOBJ)dc->w.hBitmap;
|
||||||
|
|
||||||
/* Release the old bitmap, lock the new one and convert it to a SURF */
|
/* Release the old bitmap, lock the new one and convert it to a SURF */
|
||||||
|
@ -2758,7 +2758,7 @@ IntChangeDisplaySettings(
|
||||||
DPRINT1("flag CDS_TEST UNIMPLEMENT");
|
DPRINT1("flag CDS_TEST UNIMPLEMENT");
|
||||||
Ret = DISP_CHANGE_FAILED;
|
Ret = DISP_CHANGE_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((dwflags & CDS_FULLSCREEN) == CDS_FULLSCREEN)
|
if ((dwflags & CDS_FULLSCREEN) == CDS_FULLSCREEN)
|
||||||
{
|
{
|
||||||
DEVMODE lpDevMode;
|
DEVMODE lpDevMode;
|
||||||
|
@ -2783,143 +2783,142 @@ IntChangeDisplaySettings(
|
||||||
if ((lpDevMode.dmBitsPerPel == DevMode->dmBitsPerPel) &&
|
if ((lpDevMode.dmBitsPerPel == DevMode->dmBitsPerPel) &&
|
||||||
(lpDevMode.dmPelsWidth == DevMode->dmPelsWidth) &&
|
(lpDevMode.dmPelsWidth == DevMode->dmPelsWidth) &&
|
||||||
(lpDevMode.dmPelsHeight == DevMode->dmPelsHeight))
|
(lpDevMode.dmPelsHeight == DevMode->dmPelsHeight))
|
||||||
Ret = DISP_CHANGE_SUCCESSFUL;
|
Ret = DISP_CHANGE_SUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((dwflags & CDS_VIDEOPARAMETERS) == CDS_VIDEOPARAMETERS)
|
if ((dwflags & CDS_VIDEOPARAMETERS) == CDS_VIDEOPARAMETERS)
|
||||||
{
|
{
|
||||||
dwflags &= ~CDS_VIDEOPARAMETERS;
|
dwflags &= ~CDS_VIDEOPARAMETERS;
|
||||||
if (lParam == NULL) Ret=DISP_CHANGE_BADPARAM;
|
if (lParam == NULL)
|
||||||
else
|
Ret=DISP_CHANGE_BADPARAM;
|
||||||
{
|
else
|
||||||
DPRINT1("flag CDS_VIDEOPARAMETERS UNIMPLEMENT");
|
{
|
||||||
Ret = DISP_CHANGE_FAILED;
|
DPRINT1("flag CDS_VIDEOPARAMETERS UNIMPLEMENT");
|
||||||
}
|
Ret = DISP_CHANGE_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((dwflags & CDS_UPDATEREGISTRY) == CDS_UPDATEREGISTRY)
|
if ((dwflags & CDS_UPDATEREGISTRY) == CDS_UPDATEREGISTRY)
|
||||||
{
|
{
|
||||||
|
|
||||||
UNICODE_STRING ObjectName;
|
|
||||||
UNICODE_STRING KernelModeName;
|
|
||||||
WCHAR KernelModeNameBuffer[256];
|
|
||||||
UNICODE_STRING RegistryKey;
|
|
||||||
WCHAR RegistryKeyBuffer[512];
|
|
||||||
PDEVICE_OBJECT DeviceObject;
|
|
||||||
ULONG LastSlash;
|
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
|
||||||
HANDLE DevInstRegKey;
|
|
||||||
ULONG NewValue;
|
|
||||||
|
|
||||||
|
|
||||||
DPRINT1("set CDS_UPDATEREGISTRY \n");
|
UNICODE_STRING ObjectName;
|
||||||
|
UNICODE_STRING KernelModeName;
|
||||||
dwflags &= ~CDS_UPDATEREGISTRY;
|
WCHAR KernelModeNameBuffer[256];
|
||||||
|
UNICODE_STRING RegistryKey;
|
||||||
|
WCHAR RegistryKeyBuffer[512];
|
||||||
|
PDEVICE_OBJECT DeviceObject;
|
||||||
|
ULONG LastSlash;
|
||||||
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
|
HANDLE DevInstRegKey;
|
||||||
|
ULONG NewValue;
|
||||||
|
|
||||||
/* Get device name (pDeviceName is "\.\xxx") */
|
DPRINT1("set CDS_UPDATEREGISTRY \n");
|
||||||
for (LastSlash = pDeviceName->Length / sizeof(WCHAR); LastSlash > 0; LastSlash--)
|
|
||||||
{
|
|
||||||
if (pDeviceName->Buffer[LastSlash - 1] == L'\\')
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LastSlash == 0) return DISP_CHANGE_RESTART;
|
|
||||||
ObjectName = *pDeviceName;
|
|
||||||
ObjectName.Length -= LastSlash * sizeof(WCHAR);
|
|
||||||
ObjectName.MaximumLength -= LastSlash * sizeof(WCHAR);
|
|
||||||
ObjectName.Buffer += LastSlash;
|
|
||||||
|
|
||||||
KernelModeName.Length = 0;
|
dwflags &= ~CDS_UPDATEREGISTRY;
|
||||||
KernelModeName.MaximumLength = sizeof(KernelModeNameBuffer);
|
|
||||||
KernelModeName.Buffer = KernelModeNameBuffer;
|
|
||||||
|
|
||||||
/* Open \??\xxx (ex: "\??\DISPLAY1") */
|
/* Get device name (pDeviceName is "\.\xxx") */
|
||||||
Status = RtlAppendUnicodeToString(&KernelModeName, L"\\??\\");
|
for (LastSlash = pDeviceName->Length / sizeof(WCHAR); LastSlash > 0; LastSlash--)
|
||||||
|
{
|
||||||
if (!NT_SUCCESS(Status)) return DISP_CHANGE_FAILED;
|
if (pDeviceName->Buffer[LastSlash - 1] == L'\\')
|
||||||
Status = RtlAppendUnicodeStringToString(&KernelModeName, &ObjectName);
|
break;
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status)) return DISP_CHANGE_FAILED;
|
|
||||||
Status = ObReferenceObjectByName(
|
|
||||||
&KernelModeName,
|
|
||||||
OBJ_CASE_INSENSITIVE,
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
IoDeviceObjectType,
|
|
||||||
KernelMode,
|
|
||||||
NULL,
|
|
||||||
(PVOID*)&DeviceObject);
|
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status)) return DISP_CHANGE_FAILED;
|
|
||||||
/* Get associated driver name (ex: "VBE") */
|
|
||||||
for (LastSlash = DeviceObject->DriverObject->DriverName.Length / sizeof(WCHAR); LastSlash > 0; LastSlash--)
|
|
||||||
{
|
|
||||||
if (DeviceObject->DriverObject->DriverName.Buffer[LastSlash - 1] == L'\\')
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LastSlash == 0) { ObDereferenceObject(DeviceObject); return DISP_CHANGE_FAILED; }
|
|
||||||
ObjectName = DeviceObject->DriverObject->DriverName;
|
|
||||||
ObjectName.Length -= LastSlash * sizeof(WCHAR);
|
|
||||||
ObjectName.MaximumLength -= LastSlash * sizeof(WCHAR);
|
|
||||||
ObjectName.Buffer += LastSlash;
|
|
||||||
|
|
||||||
RegistryKey.Length = 0;
|
|
||||||
RegistryKey.MaximumLength = sizeof(RegistryKeyBuffer);
|
|
||||||
RegistryKey.Buffer = RegistryKeyBuffer;
|
|
||||||
|
|
||||||
/* Open registry key */
|
|
||||||
Status = RtlAppendUnicodeToString(&RegistryKey,
|
|
||||||
L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Hardware Profiles\\Current\\System\\CurrentControlSet\\Services\\");
|
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status)) { ObDereferenceObject(DeviceObject); return DISP_CHANGE_FAILED; }
|
|
||||||
Status = RtlAppendUnicodeStringToString(&RegistryKey, &ObjectName);
|
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status)) { ObDereferenceObject(DeviceObject); return DISP_CHANGE_FAILED; }
|
|
||||||
Status = RtlAppendUnicodeToString(&RegistryKey,
|
|
||||||
L"\\Device0");
|
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status)) { ObDereferenceObject(DeviceObject); return DISP_CHANGE_FAILED; }
|
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes, &RegistryKey,
|
|
||||||
OBJ_CASE_INSENSITIVE, NULL, NULL);
|
|
||||||
Status = ZwOpenKey(&DevInstRegKey, GENERIC_READ | GENERIC_WRITE, &ObjectAttributes);
|
|
||||||
ObDereferenceObject(DeviceObject);
|
|
||||||
if (!NT_SUCCESS(Status)) return DISP_CHANGE_FAILED;
|
|
||||||
|
|
||||||
/* Update needed fields */
|
|
||||||
if (NT_SUCCESS(Status) && DevMode->dmFields & DM_BITSPERPEL)
|
|
||||||
{
|
|
||||||
RtlInitUnicodeString(&RegistryKey, L"DefaultSettings.BitsPerPel");
|
|
||||||
NewValue = DevMode->dmBitsPerPel;
|
|
||||||
Status = ZwSetValueKey(DevInstRegKey, &RegistryKey, 0, REG_DWORD, &NewValue, sizeof(NewValue));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (NT_SUCCESS(Status) && DevMode->dmFields & DM_PELSWIDTH)
|
|
||||||
{
|
|
||||||
RtlInitUnicodeString(&RegistryKey, L"DefaultSettings.XResolution");
|
|
||||||
NewValue = DevMode->dmPelsWidth;
|
|
||||||
Status = ZwSetValueKey(DevInstRegKey, &RegistryKey, 0, REG_DWORD, &NewValue, sizeof(NewValue));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (NT_SUCCESS(Status) && DevMode->dmFields & DM_PELSHEIGHT)
|
|
||||||
{
|
|
||||||
RtlInitUnicodeString(&RegistryKey, L"DefaultSettings.YResolution");
|
|
||||||
NewValue = DevMode->dmPelsHeight;
|
|
||||||
Status = ZwSetValueKey(DevInstRegKey, &RegistryKey, 0, REG_DWORD, &NewValue, sizeof(NewValue));
|
|
||||||
}
|
|
||||||
|
|
||||||
ZwClose(DevInstRegKey);
|
|
||||||
if (NT_SUCCESS(Status))
|
|
||||||
Ret = DISP_CHANGE_RESTART;
|
|
||||||
else
|
|
||||||
/* return DISP_CHANGE_NOTUPDATED when we can save to reg only vaild for NT */
|
|
||||||
Ret = DISP_CHANGE_NOTUPDATED;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dwflags != 0)
|
if (LastSlash == 0) return DISP_CHANGE_RESTART;
|
||||||
|
ObjectName = *pDeviceName;
|
||||||
|
ObjectName.Length -= LastSlash * sizeof(WCHAR);
|
||||||
|
ObjectName.MaximumLength -= LastSlash * sizeof(WCHAR);
|
||||||
|
ObjectName.Buffer += LastSlash;
|
||||||
|
|
||||||
|
KernelModeName.Length = 0;
|
||||||
|
KernelModeName.MaximumLength = sizeof(KernelModeNameBuffer);
|
||||||
|
KernelModeName.Buffer = KernelModeNameBuffer;
|
||||||
|
|
||||||
|
/* Open \??\xxx (ex: "\??\DISPLAY1") */
|
||||||
|
Status = RtlAppendUnicodeToString(&KernelModeName, L"\\??\\");
|
||||||
|
|
||||||
|
if (!NT_SUCCESS(Status)) return DISP_CHANGE_FAILED;
|
||||||
|
Status = RtlAppendUnicodeStringToString(&KernelModeName, &ObjectName);
|
||||||
|
|
||||||
|
if (!NT_SUCCESS(Status)) return DISP_CHANGE_FAILED;
|
||||||
|
Status = ObReferenceObjectByName(
|
||||||
|
&KernelModeName,
|
||||||
|
OBJ_CASE_INSENSITIVE,
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
IoDeviceObjectType,
|
||||||
|
KernelMode,
|
||||||
|
NULL,
|
||||||
|
(PVOID*)&DeviceObject);
|
||||||
|
|
||||||
|
if (!NT_SUCCESS(Status)) return DISP_CHANGE_FAILED;
|
||||||
|
/* Get associated driver name (ex: "VBE") */
|
||||||
|
for (LastSlash = DeviceObject->DriverObject->DriverName.Length / sizeof(WCHAR); LastSlash > 0; LastSlash--)
|
||||||
|
{
|
||||||
|
if (DeviceObject->DriverObject->DriverName.Buffer[LastSlash - 1] == L'\\')
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LastSlash == 0) { ObDereferenceObject(DeviceObject); return DISP_CHANGE_FAILED; }
|
||||||
|
ObjectName = DeviceObject->DriverObject->DriverName;
|
||||||
|
ObjectName.Length -= LastSlash * sizeof(WCHAR);
|
||||||
|
ObjectName.MaximumLength -= LastSlash * sizeof(WCHAR);
|
||||||
|
ObjectName.Buffer += LastSlash;
|
||||||
|
|
||||||
|
RegistryKey.Length = 0;
|
||||||
|
RegistryKey.MaximumLength = sizeof(RegistryKeyBuffer);
|
||||||
|
RegistryKey.Buffer = RegistryKeyBuffer;
|
||||||
|
|
||||||
|
/* Open registry key */
|
||||||
|
Status = RtlAppendUnicodeToString(&RegistryKey,
|
||||||
|
L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Hardware Profiles\\Current\\System\\CurrentControlSet\\Services\\");
|
||||||
|
|
||||||
|
if (!NT_SUCCESS(Status)) { ObDereferenceObject(DeviceObject); return DISP_CHANGE_FAILED; }
|
||||||
|
Status = RtlAppendUnicodeStringToString(&RegistryKey, &ObjectName);
|
||||||
|
|
||||||
|
if (!NT_SUCCESS(Status)) { ObDereferenceObject(DeviceObject); return DISP_CHANGE_FAILED; }
|
||||||
|
Status = RtlAppendUnicodeToString(&RegistryKey,
|
||||||
|
L"\\Device0");
|
||||||
|
|
||||||
|
if (!NT_SUCCESS(Status)) { ObDereferenceObject(DeviceObject); return DISP_CHANGE_FAILED; }
|
||||||
|
|
||||||
|
InitializeObjectAttributes(&ObjectAttributes, &RegistryKey,
|
||||||
|
OBJ_CASE_INSENSITIVE, NULL, NULL);
|
||||||
|
Status = ZwOpenKey(&DevInstRegKey, GENERIC_READ | GENERIC_WRITE, &ObjectAttributes);
|
||||||
|
ObDereferenceObject(DeviceObject);
|
||||||
|
if (!NT_SUCCESS(Status)) return DISP_CHANGE_FAILED;
|
||||||
|
|
||||||
|
/* Update needed fields */
|
||||||
|
if (NT_SUCCESS(Status) && DevMode->dmFields & DM_BITSPERPEL)
|
||||||
|
{
|
||||||
|
RtlInitUnicodeString(&RegistryKey, L"DefaultSettings.BitsPerPel");
|
||||||
|
NewValue = DevMode->dmBitsPerPel;
|
||||||
|
Status = ZwSetValueKey(DevInstRegKey, &RegistryKey, 0, REG_DWORD, &NewValue, sizeof(NewValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NT_SUCCESS(Status) && DevMode->dmFields & DM_PELSWIDTH)
|
||||||
|
{
|
||||||
|
RtlInitUnicodeString(&RegistryKey, L"DefaultSettings.XResolution");
|
||||||
|
NewValue = DevMode->dmPelsWidth;
|
||||||
|
Status = ZwSetValueKey(DevInstRegKey, &RegistryKey, 0, REG_DWORD, &NewValue, sizeof(NewValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NT_SUCCESS(Status) && DevMode->dmFields & DM_PELSHEIGHT)
|
||||||
|
{
|
||||||
|
RtlInitUnicodeString(&RegistryKey, L"DefaultSettings.YResolution");
|
||||||
|
NewValue = DevMode->dmPelsHeight;
|
||||||
|
Status = ZwSetValueKey(DevInstRegKey, &RegistryKey, 0, REG_DWORD, &NewValue, sizeof(NewValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
ZwClose(DevInstRegKey);
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
Ret = DISP_CHANGE_RESTART;
|
||||||
|
else
|
||||||
|
/* return DISP_CHANGE_NOTUPDATED when we can save to reg only valid for NT */
|
||||||
|
Ret = DISP_CHANGE_NOTUPDATED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dwflags != 0)
|
||||||
Ret = DISP_CHANGE_BADFLAGS;
|
Ret = DISP_CHANGE_BADFLAGS;
|
||||||
|
|
||||||
return Ret;
|
return Ret;
|
||||||
|
|
Loading…
Reference in a new issue