Skip to content

Commit 72dcb3a

Browse files
committed
[WIN32SS:ENG] Initialize pdo variable before using it
1 parent 9f21cc3 commit 72dcb3a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

win32ss/user/ntuser/display.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,19 @@ UserEnumDisplayDevices(
245245
return STATUS_UNSUCCESSFUL;
246246
}
247247

248-
if (pustrDevice)
248+
if (!pustrDevice)
249+
{
250+
pdo = pGraphicsDevice->PhysDeviceHandle;
251+
}
252+
else
249253
{
250254
EngpUpdateMonitorDevices(pGraphicsDevice);
251255
if (iDevNum >= pGraphicsDevice->dwMonCnt)
252256
{
253257
TRACE("No monitor #%u for '%wZ'\n", iDevNum + 1, pustrDevice);
254258
return STATUS_UNSUCCESSFUL;
255259
}
260+
pdo = pGraphicsDevice->pvMonDev[iDevNum].pdo;
256261
}
257262

258263

@@ -282,7 +287,6 @@ UserEnumDisplayDevices(
282287
RtlStringCbCopyW(pdispdev->DeviceName, sizeof(pdispdev->DeviceName), pGraphicsDevice->szWinDeviceName);
283288
RtlStringCbCopyW(pdispdev->DeviceString, sizeof(pdispdev->DeviceString), pGraphicsDevice->pwszDescription);
284289
pdispdev->StateFlags = pGraphicsDevice->StateFlags;
285-
pdo = pGraphicsDevice->PhysDeviceHandle;
286290
}
287291
else
288292
{
@@ -298,7 +302,6 @@ UserEnumDisplayDevices(
298302
pdispdev->DeviceString[0] = UNICODE_NULL;
299303
}
300304
pdispdev->StateFlags = pGraphicsDevice->pvMonDev[iDevNum].flag;
301-
pdo = pGraphicsDevice->pvMonDev[iDevNum].pdo;
302305
}
303306
pdispdev->DeviceID[0] = UNICODE_NULL;
304307

0 commit comments

Comments
 (0)