#define NDEBUG
#include <debug.h>
+PGRAPHICS_DEVICE gpPrimaryGraphicsDevice;
+PGRAPHICS_DEVICE gpVgaGraphicsDevice;
+
static PGRAPHICS_DEVICE gpGraphicsDeviceFirst = NULL;
static PGRAPHICS_DEVICE gpGraphicsDeviceLast = NULL;
static HSEMAPHORE ghsemGraphicsDeviceList;
static ULONG giDevNum = 1;
-BOOL
+INIT_FUNCTION
+NTSTATUS
NTAPI
InitDeviceImpl()
{
ghsemGraphicsDeviceList = EngCreateSemaphore();
if (!ghsemGraphicsDeviceList)
- return FALSE;
+ return STATUS_INSUFFICIENT_RESOURCES;
- return TRUE;
+ return STATUS_SUCCESS;
}
PDEVMODEW pdm, pdmEnd;
PLDEVOBJ pldev;
- DPRINT1("EngpRegisterGraphicsDevice(%S)\n", pustrDeviceName->Buffer);
+ DPRINT("EngpRegisterGraphicsDevice(%wZ)\n", pustrDeviceName);
/* Allocate a GRAPHICS_DEVICE structure */
pGraphicsDevice = ExAllocatePoolWithTag(PagedPool,
&pDeviceObject);
if (!NT_SUCCESS(Status))
{
- DPRINT1("Could not open driver, 0x%lx\n", Status);
+ DPRINT1("Could not open driver %wZ, 0x%lx\n", pustrDeviceName, Status);
ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE);
return NULL;
}
{
DPRINT1("trying driver: %ls\n", pwsz);
/* Try to load the display driver */
- pldev = EngLoadDriver(pwsz, LDEV_DEVICE_DISPLAY);
+ pldev = EngLoadImageEx(pwsz, LDEV_DEVICE_DISPLAY);
if (!pldev)
{
DPRINT1("Could not load driver: '%ls'\n", pwsz);
if (pustrDevice)
{
/* Loop through the list of devices */
- for (pGraphicsDevice = gpGraphicsDeviceFirst, i = 0;
+ for (pGraphicsDevice = gpGraphicsDeviceFirst;
pGraphicsDevice;
- pGraphicsDevice = pGraphicsDevice->pNextGraphicsDevice, i++)
+ pGraphicsDevice = pGraphicsDevice->pNextGraphicsDevice)
{
/* Compare the device name */
RtlInitUnicodeString(&ustrCurrent, pGraphicsDevice->szWinDeviceName);