https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0ad90f83d3bfdbebb6143…
commit 0ad90f83d3bfdbebb6143e88a01fc2897474d2a8
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Nov 24 21:19:14 2019 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Mon Nov 25 00:41:49 2019 +0100
[WIN32K] Code formatting.
---
win32ss/gdi/eng/device.c | 14 ++++++--------
win32ss/gdi/eng/pdevobj.c | 30 ++++++++++++++++--------------
win32ss/user/ntuser/display.c | 4 ++--
3 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/win32ss/gdi/eng/device.c b/win32ss/gdi/eng/device.c
index 6d20e30de55..e5f30aa0bba 100644
--- a/win32ss/gdi/eng/device.c
+++ b/win32ss/gdi/eng/device.c
@@ -51,8 +51,8 @@ EngpPopulateDeviceModeList(
* This is a REG_MULTI_SZ string */
for (; *pwsz; pwsz += wcslen(pwsz) + 1)
{
- TRACE("trying driver: %ls\n", pwsz);
/* Try to load the display driver */
+ TRACE("Trying driver: %ls\n", pwsz);
pldev = EngLoadImageEx(pwsz, LDEV_DEVICE_DISPLAY);
if (!pldev)
{
@@ -186,14 +186,14 @@ EngpRegisterGraphicsDevice(
return NULL;
}
- /* Try to open the driver */
+ /* Try to open and enable the device */
Status = IoGetDeviceObjectPointer(pustrDeviceName,
FILE_READ_DATA | FILE_WRITE_DATA,
&pFileObject,
&pDeviceObject);
if (!NT_SUCCESS(Status))
{
- ERR("Could not open driver %wZ, 0x%lx\n", pustrDeviceName, Status);
+ ERR("Could not open device %wZ, 0x%lx\n", pustrDeviceName, Status);
ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE);
return NULL;
}
@@ -225,13 +225,13 @@ EngpRegisterGraphicsDevice(
return NULL;
}
- /* Copy display driver names */
+ /* Copy the display driver names */
pGraphicsDevice->pDiplayDrivers = pwsz;
RtlCopyMemory(pGraphicsDevice->pDiplayDrivers,
pustrDiplayDrivers->Buffer,
pustrDiplayDrivers->Length);
- /* Copy description */
+ /* Copy the description */
pGraphicsDevice->pwszDescription = pwsz + pustrDiplayDrivers->Length /
sizeof(WCHAR);
RtlCopyMemory(pGraphicsDevice->pwszDescription,
pustrDescription->Buffer,
@@ -265,7 +265,7 @@ EngpRegisterGraphicsDevice(
if (!gpGraphicsDeviceFirst)
gpGraphicsDeviceFirst = pGraphicsDevice;
- /* Increment device number */
+ /* Increment the device number */
giDevNum++;
/* Unlock loader */
@@ -275,7 +275,6 @@ EngpRegisterGraphicsDevice(
return pGraphicsDevice;
}
-
PGRAPHICS_DEVICE
NTAPI
EngpFindGraphicsDevice(
@@ -321,7 +320,6 @@ EngpFindGraphicsDevice(
return pGraphicsDevice;
}
-
static
NTSTATUS
EngpFileIoRequest(
diff --git a/win32ss/gdi/eng/pdevobj.c b/win32ss/gdi/eng/pdevobj.c
index 19c2fee06ba..450d37f6785 100644
--- a/win32ss/gdi/eng/pdevobj.c
+++ b/win32ss/gdi/eng/pdevobj.c
@@ -90,15 +90,15 @@ PDEVOBJ_vDeletePDEV(
VOID
NTAPI
-PDEVOBJ_vRelease(PPDEVOBJ ppdev)
+PDEVOBJ_vRelease(
+ _Inout_ PPDEVOBJ ppdev)
{
/* Lock loader */
EngAcquireSemaphore(ghsemPDEV);
/* Decrease reference count */
- --ppdev->cPdevRefs;
-
- ASSERT(ppdev->cPdevRefs >= 0) ;
+ InterlockedDecrement(&ppdev->cPdevRefs);
+ ASSERT(ppdev->cPdevRefs >= 0);
/* Check if references are left */
if (ppdev->cPdevRefs == 0)
@@ -112,7 +112,7 @@ PDEVOBJ_vRelease(PPDEVOBJ ppdev)
}
/* Do we have a palette? */
- if(ppdev->ppalSurf)
+ if (ppdev->ppalSurf)
{
PALETTE_ShareUnlockPalette(ppdev->ppalSurf);
}
@@ -125,20 +125,22 @@ PDEVOBJ_vRelease(PPDEVOBJ ppdev)
}
/* Remove it from list */
- if( ppdev == gppdevList )
- gppdevList = ppdev->ppdevNext ;
+ if (ppdev == gppdevList)
+ {
+ gppdevList = ppdev->ppdevNext;
+ }
else
{
PPDEVOBJ ppdevCurrent = gppdevList;
- BOOL found = FALSE ;
+ BOOL found = FALSE;
while (!found && ppdevCurrent->ppdevNext)
{
if (ppdevCurrent->ppdevNext == ppdev)
found = TRUE;
else
- ppdevCurrent = ppdevCurrent->ppdevNext ;
+ ppdevCurrent = ppdevCurrent->ppdevNext;
}
- if(found)
+ if (found)
ppdevCurrent->ppdevNext = ppdev->ppdevNext;
}
@@ -152,7 +154,6 @@ PDEVOBJ_vRelease(PPDEVOBJ ppdev)
/* Unlock loader */
EngReleaseSemaphore(ghsemPDEV);
-
}
BOOL
@@ -320,7 +321,7 @@ PDEVOBJ_pdmMatchDevMode(
/* Compare asked DEVMODE fields
* Only compare those that are valid in both DEVMODE structs */
- dwFields = pdmCurrent->dmFields & pdm->dmFields ;
+ dwFields = pdmCurrent->dmFields & pdm->dmFields;
/* For now, we only need those */
if ((dwFields & DM_BITSPERPEL) &&
@@ -348,6 +349,7 @@ EngpCreatePDEV(
{
PGRAPHICS_DEVICE pGraphicsDevice;
PPDEVOBJ ppdev;
+
DPRINT("EngpCreatePDEV(%wZ, %p)\n", pustrDeviceName, pdm);
/* Try to find the GRAPHICS_DEVICE */
@@ -407,7 +409,7 @@ EngpCreatePDEV(
ppdev->hSpooler = ppdev->pGraphicsDevice->DeviceObject;
// Should we change the ative mode of pGraphicsDevice ?
- ppdev->pdmwDev = PDEVOBJ_pdmMatchDevMode(ppdev, pdm) ;
+ ppdev->pdmwDev = PDEVOBJ_pdmMatchDevMode(ppdev, pdm);
/* FIXME! */
ppdev->flFlags = PDEV_DISPLAY;
@@ -561,7 +563,7 @@ PDEVOBJ_bSwitchMode(
PDEVOBJ_vRelease(ppdevTmp);
/* Update primary display capabilities */
- if(ppdev == gppdevPrimary)
+ if (ppdev == gppdevPrimary)
{
PDEVOBJ_vGetDeviceCaps(ppdev, &GdiHandleTable->DevCaps);
}
diff --git a/win32ss/user/ntuser/display.c b/win32ss/user/ntuser/display.c
index 3f2b99cc229..cebaf8c1148 100644
--- a/win32ss/user/ntuser/display.c
+++ b/win32ss/user/ntuser/display.c
@@ -557,7 +557,7 @@ UserEnumRegistryDisplaySettings(
ZwClose(hkey);
return STATUS_SUCCESS;
}
- return Status ;
+ return Status;
}
NTSTATUS
@@ -674,6 +674,7 @@ NtUserEnumDisplaySettings(
return Status;
}
+
VOID
UserUpdateFullscreen(
DWORD flags)
@@ -1012,4 +1013,3 @@ NtUserChangeDisplaySettings(
return lRet;
}
-