winspool.drv: There is no need to speculate about wineps.drv default DEVMODE.

This commit is contained in:
Dmitry Timoshkov 2013-02-12 15:21:26 +08:00 committed by Alexandre Julliard
parent ac79a3f9d3
commit dc8d7e7d62
2 changed files with 11 additions and 54 deletions

View file

@ -3986,63 +3986,20 @@ static BOOL WINSPOOL_GetStringFromReg(HKEY hkey, LPCWSTR ValueName, LPBYTE ptr,
* WINSPOOL_GetDefaultDevMode * WINSPOOL_GetDefaultDevMode
* *
* Get a default DevMode values for wineps. * Get a default DevMode values for wineps.
* FIXME - use ppd.
*/ */
static void WINSPOOL_GetDefaultDevMode(LPBYTE ptr, DWORD buflen, DWORD *needed)
static void WINSPOOL_GetDefaultDevMode(
LPBYTE ptr,
DWORD buflen, DWORD *needed)
{ {
DEVMODEW dm; static const WCHAR winepsW[] = { 'w','i','n','e','p','s','.','d','r','v',0 };
static const WCHAR szWwps[] = {'w', 'i', 'n', 'e', 'p', 's', '.', 'd', 'r', 'v', 0 };
/* fill default DEVMODE - should be read from ppd... */ if (buflen >= sizeof(DEVMODEW))
ZeroMemory( &dm, sizeof(dm) ); {
memcpy(dm.dmDeviceName,szWwps,sizeof szWwps); DEVMODEW *dm = (DEVMODEW *)ptr;
dm.dmSpecVersion = DM_SPECVERSION;
dm.dmDriverVersion = 1;
dm.dmSize = sizeof(DEVMODEW);
dm.dmDriverExtra = 0;
dm.dmFields =
DM_ORIENTATION | DM_PAPERSIZE |
DM_PAPERLENGTH | DM_PAPERWIDTH |
DM_SCALE |
DM_COPIES |
DM_DEFAULTSOURCE | DM_PRINTQUALITY |
DM_YRESOLUTION | DM_TTOPTION;
dm.u1.s1.dmOrientation = DMORIENT_PORTRAIT; /* the driver will update registry with real values */
dm.u1.s1.dmPaperSize = DMPAPER_A4; memset(dm, 0, sizeof(*dm));
dm.u1.s1.dmPaperLength = 2970; dm->dmSize = sizeof(*dm);
dm.u1.s1.dmPaperWidth = 2100; lstrcpyW(dm->dmDeviceName, winepsW);
}
dm.u1.s1.dmScale = 100;
dm.u1.s1.dmCopies = 1;
dm.u1.s1.dmDefaultSource = DMBIN_AUTO;
dm.u1.s1.dmPrintQuality = DMRES_MEDIUM;
/* dm.dmColor */
/* dm.dmDuplex */
dm.dmYResolution = 300; /* 300dpi */
dm.dmTTOption = DMTT_BITMAP;
/* dm.dmCollate */
/* dm.dmFormName */
/* dm.dmLogPixels */
/* dm.dmBitsPerPel */
/* dm.dmPelsWidth */
/* dm.dmPelsHeight */
/* dm.u2.dmDisplayFlags */
/* dm.dmDisplayFrequency */
/* dm.dmICMMethod */
/* dm.dmICMIntent */
/* dm.dmMediaType */
/* dm.dmDitherType */
/* dm.dmReserved1 */
/* dm.dmReserved2 */
/* dm.dmPanningWidth */
/* dm.dmPanningHeight */
if(buflen >= sizeof(DEVMODEW))
memcpy(ptr, &dm, sizeof(DEVMODEW));
*needed = sizeof(DEVMODEW); *needed = sizeof(DEVMODEW);
} }

View file

@ -2989,7 +2989,7 @@ todo_wine
START_TEST(info) START_TEST(info)
{ {
hwinspool = GetModuleHandleA("winspool.drv"); hwinspool = LoadLibrary("winspool.drv");
pAddPortExA = (void *) GetProcAddress(hwinspool, "AddPortExA"); pAddPortExA = (void *) GetProcAddress(hwinspool, "AddPortExA");
pEnumPrinterDriversW = (void *) GetProcAddress(hwinspool, "EnumPrinterDriversW"); pEnumPrinterDriversW = (void *) GetProcAddress(hwinspool, "EnumPrinterDriversW");
pGetDefaultPrinterA = (void *) GetProcAddress(hwinspool, "GetDefaultPrinterA"); pGetDefaultPrinterA = (void *) GetProcAddress(hwinspool, "GetDefaultPrinterA");