1 2 extern IMAGE_DOS_HEADER __ImageBase; 3 4 static const unsigned GDI_ENGINE_VERSION = DDI_DRIVER_VERSION_NT5_01; 5 6 typedef enum 7 { 8 LDEV_DEVICE_DISPLAY = 1, 9 LDEV_DEVICE_PRINTER = 2, 10 LDEV_DEVICE_META = 3, 11 LDEV_DEVICE_MIRROR = 4, 12 LDEV_IMAGE = 5, 13 LDEV_FONT = 6, 14 } LDEVTYPE; 15 16 typedef struct _LDEVOBJ 17 { 18 LIST_ENTRY leLink; 19 SYSTEM_GDI_DRIVER_INFORMATION *pGdiDriverInfo; 20 LDEVTYPE ldevtype; 21 ULONG cRefs; 22 ULONG ulDriverVersion; 23 24 union 25 { 26 PVOID apfn[INDEX_LAST]; 27 DRIVER_FUNCTIONS pfn; 28 }; 29 30 } LDEVOBJ, *PLDEVOBJ; 31 32 CODE_SEG("INIT") 33 NTSTATUS 34 NTAPI 35 InitLDEVImpl(VOID); 36 37 /* Get all available device modes from a driver 38 * - pwszDriverName: name of the driver 39 * - hDriver: handle of the driver 40 * - ppdm: allocated memory containing driver modes or NULL on error 41 * Return value: number of bytes allocated for *ppdm buffer or 0 on error 42 */ 43 ULONG 44 LDEVOBJ_ulGetDriverModes( 45 _In_ LPWSTR pwszDriverName, 46 _In_ HANDLE hDriver, 47 _Out_ PDEVMODEW *ppdm); 48 49 PLDEVOBJ 50 LDEVOBJ_pLoadInternal( 51 _In_ PFN_DrvEnableDriver pfnEnableDriver, 52 _In_ ULONG ldevtype); 53 54 PLDEVOBJ 55 APIENTRY 56 LDEVOBJ_pLoadDriver( 57 _In_z_ LPWSTR pwszDriverName, 58 _In_ ULONG ldevtype); 59 60 BOOL 61 LDEVOBJ_bBuildDevmodeList( 62 _Inout_ PGRAPHICS_DEVICE pGraphicsDevice); 63 64 /* This function selects the best available mode corresponding to requested mode */ 65 BOOL 66 LDEVOBJ_bProbeAndCaptureDevmode( 67 _Inout_ PGRAPHICS_DEVICE pGraphicsDevice, 68 _In_ PDEVMODEW RequestedMode, 69 _Out_ PDEVMODEW *pSelectedMode, 70 _In_ BOOL bSearchClosestMode); 71 72 CODE_SEG("INIT") 73 NTSTATUS 74 APIENTRY 75 DriverEntry ( 76 _In_ PDRIVER_OBJECT DriverObject, 77 _In_ PUNICODE_STRING RegistryPath); 78 79