Change the callback declarations to a safer format.
[wine] / dlls / wineps / driver.c
1 /*
2  * Exported functions from the PostScript driver.
3  *
4  * [Ext]DeviceMode, DeviceCapabilities, AdvancedSetupDialog. 
5  *
6  * Will need ExtTextOut for winword6 (urgh!)
7  *
8  * Copyright 1998  Huw D M Davies
9  *
10  */
11
12 #include <string.h>
13 #include "psdrv.h"
14 #include "debugtools.h"
15 #include "winuser.h"
16 #include "winspool.h"
17 #include "prsht.h"
18 #include "psdlg.h"
19
20 DEFAULT_DEBUG_CHANNEL(psdrv);
21
22
23 /************************************************************************
24  *
25  *              PSDRV_MergeDevmodes
26  *
27  * Updates dm1 with some fields from dm2
28  *
29  */
30 void PSDRV_MergeDevmodes(PSDRV_DEVMODEA *dm1, PSDRV_DEVMODEA *dm2,
31                          PRINTERINFO *pi)
32 {
33     /* some sanity checks here on dm2 */
34
35     if(dm2->dmPublic.dmFields & DM_ORIENTATION)
36         dm1->dmPublic.u1.s1.dmOrientation = dm2->dmPublic.u1.s1.dmOrientation;
37
38     /* NB PaperWidth is always < PaperLength */
39
40     if(dm2->dmPublic.dmFields & DM_PAPERSIZE) {
41         PAGESIZE *page;
42
43         for(page = pi->ppd->PageSizes; page; page = page->next) {
44             if(page->WinPage == dm2->dmPublic.u1.s1.dmPaperSize)
45                 break;
46         }
47         if(page) {
48             dm1->dmPublic.u1.s1.dmPaperSize = dm2->dmPublic.u1.s1.dmPaperSize;
49             dm1->dmPublic.u1.s1.dmPaperWidth = page->PaperDimension->x * 
50                                                                 254.0 / 72.0;
51             dm1->dmPublic.u1.s1.dmPaperLength = page->PaperDimension->y *
52                                                                 254.0 / 72.0;
53             TRACE("Changing page to %s %d x %d\n", page->FullName,
54                   dm1->dmPublic.u1.s1.dmPaperWidth,
55                   dm1->dmPublic.u1.s1.dmPaperLength );
56         } else {
57             TRACE("Trying to change to unsupported pagesize %d\n",
58                       dm2->dmPublic.u1.s1.dmPaperSize);
59         }
60     }
61
62     if(dm2->dmPublic.dmFields & DM_PAPERLENGTH) {
63         dm1->dmPublic.u1.s1.dmPaperLength = dm2->dmPublic.u1.s1.dmPaperLength; 
64         TRACE("Changing PaperLength to %d\n",
65               dm2->dmPublic.u1.s1.dmPaperLength);
66         FIXME("Changing PaperLength.  Do we adjust PaperSize?\n");
67     }
68
69     if(dm2->dmPublic.dmFields & DM_PAPERWIDTH) {
70         dm1->dmPublic.u1.s1.dmPaperWidth = dm2->dmPublic.u1.s1.dmPaperWidth; 
71         TRACE("Changing PaperWidth to %d\n",
72               dm2->dmPublic.u1.s1.dmPaperWidth);
73         FIXME("Changing PaperWidth.  Do we adjust PaperSize?\n");
74     }
75
76     if(dm2->dmPublic.dmFields & DM_SCALE) {
77         dm1->dmPublic.dmScale = dm2->dmPublic.dmScale;
78         TRACE("Changing Scale to %d\n", dm2->dmPublic.dmScale);
79     }
80
81     if(dm2->dmPublic.dmFields & DM_COPIES) {
82         dm1->dmPublic.dmCopies = dm2->dmPublic.dmCopies;
83         TRACE("Changing Copies to %d\n", dm2->dmPublic.dmCopies);
84     }
85
86     if(dm2->dmPublic.dmFields & DM_DEFAULTSOURCE) {
87         INPUTSLOT *slot;
88         
89         for(slot = pi->ppd->InputSlots; slot; slot = slot->next) {
90             if(slot->WinBin == dm2->dmPublic.dmDefaultSource)
91                 break;
92         }
93         if(slot) {
94             dm1->dmPublic.dmDefaultSource = dm2->dmPublic.dmDefaultSource;
95             TRACE("Changing bin to '%s'\n", slot->FullName);
96         } else {
97           TRACE("Trying to change to unsupported bin %d\n",
98                 dm2->dmPublic.dmDefaultSource);
99         }
100     }
101
102    if (dm2->dmPublic.dmFields & DM_DEFAULTSOURCE )
103        dm1->dmPublic.dmDefaultSource = dm2->dmPublic.dmDefaultSource;
104    if (dm2->dmPublic.dmFields & DM_PRINTQUALITY )
105        dm1->dmPublic.dmPrintQuality = dm2->dmPublic.dmPrintQuality;
106    if (dm2->dmPublic.dmFields & DM_COLOR )
107        dm1->dmPublic.dmColor = dm2->dmPublic.dmColor;
108    if (dm2->dmPublic.dmFields & DM_DUPLEX )
109        dm1->dmPublic.dmDuplex = dm2->dmPublic.dmDuplex;
110    if (dm2->dmPublic.dmFields & DM_YRESOLUTION )
111        dm1->dmPublic.dmYResolution = dm2->dmPublic.dmYResolution;
112    if (dm2->dmPublic.dmFields & DM_TTOPTION )
113        dm1->dmPublic.dmTTOption = dm2->dmPublic.dmTTOption;
114    if (dm2->dmPublic.dmFields & DM_COLLATE )
115        dm1->dmPublic.dmCollate = dm2->dmPublic.dmCollate;
116    if (dm2->dmPublic.dmFields & DM_FORMNAME )
117        lstrcpynA(dm1->dmPublic.dmFormName, dm2->dmPublic.dmFormName, CCHFORMNAME);
118    if (dm2->dmPublic.dmFields & DM_BITSPERPEL )
119        dm1->dmPublic.dmBitsPerPel = dm2->dmPublic.dmBitsPerPel;
120    if (dm2->dmPublic.dmFields & DM_PELSWIDTH )
121        dm1->dmPublic.dmPelsWidth = dm2->dmPublic.dmPelsWidth;
122    if (dm2->dmPublic.dmFields & DM_PELSHEIGHT )
123        dm1->dmPublic.dmPelsHeight = dm2->dmPublic.dmPelsHeight;
124    if (dm2->dmPublic.dmFields & DM_DISPLAYFLAGS )
125        dm1->dmPublic.dmDisplayFlags = dm2->dmPublic.dmDisplayFlags;
126    if (dm2->dmPublic.dmFields & DM_DISPLAYFREQUENCY )
127        dm1->dmPublic.dmDisplayFrequency = dm2->dmPublic.dmDisplayFrequency;
128    if (dm2->dmPublic.dmFields & DM_POSITION )
129        dm1->dmPublic.u1.dmPosition = dm2->dmPublic.u1.dmPosition;
130    if (dm2->dmPublic.dmFields & DM_LOGPIXELS )
131        dm1->dmPublic.dmLogPixels = dm2->dmPublic.dmLogPixels;
132    if (dm2->dmPublic.dmFields & DM_ICMMETHOD )
133        dm1->dmPublic.dmICMMethod = dm2->dmPublic.dmICMMethod;
134    if (dm2->dmPublic.dmFields & DM_ICMINTENT )
135        dm1->dmPublic.dmICMIntent = dm2->dmPublic.dmICMIntent;
136    if (dm2->dmPublic.dmFields & DM_MEDIATYPE )
137        dm1->dmPublic.dmMediaType = dm2->dmPublic.dmMediaType;
138    if (dm2->dmPublic.dmFields & DM_DITHERTYPE )
139        dm1->dmPublic.dmDitherType = dm2->dmPublic.dmDitherType;
140    if (dm2->dmPublic.dmFields & DM_PANNINGWIDTH )
141        dm1->dmPublic.dmPanningWidth = dm2->dmPublic.dmPanningWidth;
142    if (dm2->dmPublic.dmFields & DM_PANNINGHEIGHT )
143        dm1->dmPublic.dmPanningHeight = dm2->dmPublic.dmPanningHeight;
144
145     return;
146 }
147
148
149 /**************************************************************
150  *
151  *      PSDRV_AdvancedSetupDialog16     [WINEPS.93]
152  *
153  */
154 WORD WINAPI PSDRV_AdvancedSetupDialog16(HWND16 hwnd, HANDLE16 hDriver,
155                                          LPDEVMODEA devin, LPDEVMODEA devout)
156 {
157
158   TRACE("hwnd = %04x, hDriver = %04x devin=%p devout=%p\n", hwnd,
159         hDriver, devin, devout);
160   return IDCANCEL;
161 }
162
163 /****************************************************************
164  *       PSDRV_PaperDlgProc
165  *
166  * Dialog proc for 'Paper' propsheet
167  */
168 BOOL WINAPI PSDRV_PaperDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
169                                lParam)
170 {
171   PSDRV_DLGINFO *di;
172   int i, Cursel = 0; 
173   PAGESIZE *ps;
174
175
176   switch(msg) {
177   case WM_INITDIALOG:
178     di = (PSDRV_DLGINFO*)((PROPSHEETPAGEA*)lParam)->lParam;
179     SetWindowLongA(hwnd, DWL_USER, (LONG)di);
180
181     for(ps = di->pi->ppd->PageSizes, i = 0; ps; ps = ps->next, i++) {
182       SendDlgItemMessageA(hwnd, IDD_PAPERS, LB_INSERTSTRING, i, 
183                           (LPARAM)ps->FullName);
184       if(di->pi->Devmode->dmPublic.u1.s1.dmPaperSize == ps->WinPage)
185         Cursel = i;
186     }
187     SendDlgItemMessageA(hwnd, IDD_PAPERS, LB_SETCURSEL, Cursel, 0);
188
189     CheckRadioButton(hwnd, IDD_ORIENT_PORTRAIT, IDD_ORIENT_LANDSCAPE,
190                      di->pi->Devmode->dmPublic.u1.s1.dmOrientation ==
191                      DMORIENT_PORTRAIT ? IDD_ORIENT_PORTRAIT :
192                      IDD_ORIENT_LANDSCAPE);
193     break;
194
195   case WM_COMMAND:
196     di = (PSDRV_DLGINFO *)GetWindowLongA(hwnd, DWL_USER);
197     switch(LOWORD(wParam)) {
198     case IDD_PAPERS:
199       if(HIWORD(wParam) == LBN_SELCHANGE) {
200         Cursel = SendDlgItemMessageA(hwnd, LOWORD(wParam), LB_GETCURSEL, 0, 0);
201         for(i = 0, ps = di->pi->ppd->PageSizes; i < Cursel; i++, ps = ps->next)
202           ;
203         TRACE("Setting pagesize to item %d Winpage = %d\n", Cursel,
204               ps->WinPage);
205         di->dlgdm->dmPublic.u1.s1.dmPaperSize = ps->WinPage;
206       }
207       break;
208     case IDD_ORIENT_PORTRAIT:
209     case IDD_ORIENT_LANDSCAPE:
210       TRACE("Setting orientation to %s\n", wParam == IDD_ORIENT_PORTRAIT ?
211             "portrait" : "landscape");
212       di->dlgdm->dmPublic.u1.s1.dmOrientation = wParam == IDD_ORIENT_PORTRAIT ?
213         DMORIENT_PORTRAIT : DMORIENT_LANDSCAPE;
214       break;
215     }
216     break;
217
218   case WM_NOTIFY:
219    {
220     NMHDR *nmhdr = (NMHDR *)lParam;
221     di = (PSDRV_DLGINFO *)GetWindowLongA(hwnd, DWL_USER);
222     switch(nmhdr->code) {
223     case PSN_APPLY:
224       memcpy(di->pi->Devmode, di->dlgdm, sizeof(PSDRV_DEVMODEA));
225       SetWindowLongA(hwnd, DWL_MSGRESULT, PSNRET_NOERROR);
226       return TRUE;
227       break;
228
229     default:
230       return FALSE;
231       break;
232     }
233     break;
234    }
235    
236   default:
237     return FALSE;
238   }
239   return TRUE;
240 }
241
242
243 static void WINAPI (*pInitCommonControls) (void);
244 static HPROPSHEETPAGE WINAPI (*pCreatePropertySheetPage) (LPCPROPSHEETPAGEA);
245 static int WINAPI (*pPropertySheet) (LPCPROPSHEETHEADERA);
246
247 /***************************************************************
248  *
249  *      PSDRV_ExtDeviceMode16   [WINEPS.90]
250  *
251  * Just returns default devmode at the moment
252  */
253 INT16 WINAPI PSDRV_ExtDeviceMode16(HWND16 hwnd, HANDLE16 hDriver,
254                                    LPDEVMODEA lpdmOutput, LPSTR lpszDevice,
255                                    LPSTR lpszPort, LPDEVMODEA lpdmInput,
256                                    LPSTR lpszProfile, WORD fwMode)
257 {
258   PRINTERINFO *pi = PSDRV_FindPrinterInfo(lpszDevice);
259   if(!pi) return -1;
260
261   TRACE("(hwnd=%04x, hDriver=%04x, devOut=%p, Device='%s', Port='%s', devIn=%p, Profile='%s', Mode=%04x)\n",
262 hwnd, hDriver, lpdmOutput, lpszDevice, lpszPort, lpdmInput, lpszProfile,
263 fwMode);
264
265   if(!fwMode)
266     return sizeof(DEVMODEA); /* Just copy dmPublic bit of PSDRV_DEVMODE */
267
268   if((fwMode & DM_MODIFY) && lpdmInput) {
269     TRACE("DM_MODIFY set. devIn->dmFields = %08lx\n", lpdmInput->dmFields);
270     PSDRV_MergeDevmodes(pi->Devmode, (PSDRV_DEVMODEA *)lpdmInput, pi);
271   }
272
273   if(fwMode & DM_PROMPT) {
274     HINSTANCE hinstComctl32, hinstWineps32 = LoadLibraryA("WINEPS");
275     HPROPSHEETPAGE hpsp[1];
276     PROPSHEETPAGEA psp;
277     PROPSHEETHEADERA psh;
278     PSDRV_DLGINFO *di;
279     PSDRV_DEVMODEA *dlgdm;
280
281     hinstComctl32 = LoadLibraryA("comctl32.dll");
282     pInitCommonControls = (void*)GetProcAddress(hinstComctl32,
283                                                 "InitCommonControls");
284     pCreatePropertySheetPage = (void*)GetProcAddress(hinstComctl32,
285                                                     "CreatePropertySheetPage");
286     pPropertySheet = (void*)GetProcAddress(hinstComctl32, "PropertySheet"); 
287     memset(&psp,0,sizeof(psp));
288     dlgdm = HeapAlloc( PSDRV_Heap, 0, sizeof(*dlgdm) );
289     memcpy(dlgdm, pi->Devmode, sizeof(*dlgdm));
290     di = HeapAlloc( PSDRV_Heap, 0, sizeof(*di) );
291     di->pi = pi;
292     di->dlgdm = dlgdm;
293     psp.dwSize = sizeof(psp);
294     psp.hInstance = hinstWineps32;
295     psp.u.pszTemplate = "PAPER";
296     psp.u2.pszIcon = NULL;
297     psp.pfnDlgProc = PSDRV_PaperDlgProc;
298     psp.lParam = (LPARAM)di;
299     hpsp[0] = pCreatePropertySheetPage(&psp);
300
301     memset(&psh, 0, sizeof(psh));
302     psh.dwSize = sizeof(psh);
303     psh.pszCaption = "Setup";
304     psh.nPages = 1;
305     psh.hwndParent = hwnd;
306     psh.u3.phpage = hpsp;
307     
308     pPropertySheet(&psh);
309     
310   }
311   if(fwMode & DM_UPDATE)
312     FIXME("Mode DM_UPDATE.  Just do the same as DM_COPY\n");
313
314   if((fwMode & DM_COPY) || (fwMode & DM_UPDATE)) {
315     memcpy(lpdmOutput, pi->Devmode, sizeof(DEVMODEA));
316   }
317   return IDOK;
318 }
319
320 /**************************************************************
321  *
322  *       PSDRV_ExtDeviceMode
323  */
324 INT PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd, LPDEVMODEA lpdmOutput,
325                         LPSTR lpszDevice, LPSTR lpszPort, LPDEVMODEA lpdmInput,
326                         LPSTR lpszProfile, DWORD dwMode)
327 {
328     return PSDRV_ExtDeviceMode16(hwnd, 0, lpdmOutput, lpszDevice, lpszPort,
329                                  lpdmInput, lpszProfile, dwMode);
330 }
331
332 /***********************************************************************
333  *
334  *      PSDRV_DeviceCapabilities16      [WINEPS.91]
335  *
336  */
337 DWORD WINAPI PSDRV_DeviceCapabilities16(LPCSTR lpszDevice, LPCSTR lpszPort,
338                                         WORD fwCapability, LPSTR lpszOutput,
339                                         LPDEVMODEA lpDevMode)
340 {
341   PRINTERINFO *pi;
342   DEVMODEA *lpdm;
343   pi = PSDRV_FindPrinterInfo(lpszDevice);
344
345   TRACE("Cap=%d. Got PrinterInfo = %p\n", fwCapability, pi);
346
347
348   if (!pi) {
349           ERR("no printerinfo for %s, return 0!\n",lpszDevice);
350           return 0;
351   }
352
353
354   lpdm = lpDevMode ? lpDevMode : (DEVMODEA *)pi->Devmode;
355
356   switch(fwCapability) {
357
358   case DC_PAPERS:
359     {
360       PAGESIZE *ps;
361       WORD *wp = (WORD *)lpszOutput;
362       int i = 0;
363
364       for(ps = pi->ppd->PageSizes; ps; ps = ps->next, i++)
365         if(lpszOutput != NULL)
366           *wp++ = ps->WinPage;
367       return i;
368     }
369
370   case DC_PAPERSIZE:
371     {
372       PAGESIZE *ps;
373       POINT16 *pt = (POINT16 *)lpszOutput;
374       int i = 0;
375
376       for(ps = pi->ppd->PageSizes; ps; ps = ps->next, i++)
377         if(lpszOutput != NULL) {
378           pt->x = ps->PaperDimension->x * 254.0 / 72.0;
379           pt->y = ps->PaperDimension->y * 254.0 / 72.0;
380           pt++;
381         }
382       return i;
383     }
384
385   case DC_PAPERNAMES:
386     {
387       PAGESIZE *ps;
388       char *cp = lpszOutput;
389       int i = 0;
390
391       for(ps = pi->ppd->PageSizes; ps; ps = ps->next, i++)
392         if(lpszOutput != NULL) {
393           lstrcpynA(cp, ps->FullName, 64);
394           cp += 64;
395         }
396       return i;
397     }
398
399   case DC_ORIENTATION:
400     return pi->ppd->LandscapeOrientation ? pi->ppd->LandscapeOrientation : 90;
401
402   case DC_BINS:
403     {
404       INPUTSLOT *slot;
405       WORD *wp = (WORD *)lpszOutput;
406       int i = 0;
407
408       /* We explicitly list DMBIN_AUTO first; actually while win9x does this
409          win2000 lists DMBIN_FORMSOURCE instead. */
410       i++;
411       if(lpszOutput != NULL)
412         *wp++ = DMBIN_AUTO;
413
414       for(slot = pi->ppd->InputSlots; slot; slot = slot->next, i++)
415         if(lpszOutput != NULL)
416           *wp++ = slot->WinBin;
417       return i;
418     }
419
420   case DC_BINNAMES:
421     {
422       INPUTSLOT *slot;
423       char *cp = lpszOutput;
424       int i = 0;
425       
426       /* Add an entry corresponding to DMBIN_AUTO, see DC_BINS */
427       i++;
428       if(lpszOutput != NULL) {
429         strcpy(cp, "Automatically Select");
430         cp += 24;
431       }
432
433       for(slot = pi->ppd->InputSlots; slot; slot = slot->next, i++)
434         if(lpszOutput != NULL) {
435           lstrcpynA(cp, slot->FullName, 24);
436           cp += 24;
437         }
438       return i;
439     }
440
441   case DC_BINADJUST:
442     FIXME("DC_BINADJUST: stub.\n");
443     return DCBA_FACEUPNONE;
444
445   case DC_ENUMRESOLUTIONS:
446     {
447       LONG *lp = (LONG*)lpszOutput;
448
449       if(lpszOutput != NULL) {
450         lp[0] = (LONG)pi->ppd->DefaultResolution;
451         lp[1] = (LONG)pi->ppd->DefaultResolution;
452       }
453       return 1;
454     }
455
456   case DC_COPIES:
457     FIXME("DC_COPIES: returning %d.  Is this correct?\n", lpdm->dmCopies);
458     return lpdm->dmCopies;
459
460   case DC_DRIVER:
461     return lpdm->dmDriverVersion;
462
463   case DC_DATATYPE_PRODUCED:
464     FIXME("DATA_TYPE_PRODUCED: stub.\n");
465     return -1; /* simulate that the driver supports 'RAW' */
466
467   case DC_DUPLEX:
468     FIXME("DC_DUPLEX: returning %d.  Is this correct?\n", lpdm->dmDuplex);
469     return lpdm->dmDuplex;
470
471   case DC_EMF_COMPLIANT:
472     FIXME("DC_EMF_COMPLIANT: stub.\n");
473     return -1; /* simulate that the driver do not support EMF */
474
475   case DC_EXTRA:
476     return lpdm->dmDriverExtra;
477
478   case DC_FIELDS:
479     return lpdm->dmFields;
480
481   case DC_FILEDEPENDENCIES:
482     FIXME("DC_FILEDEPENDENCIES: stub.\n");
483     return 0;
484
485   case DC_MAXEXTENT:
486     {
487       PAGESIZE *ps;
488       int i;
489       POINT ptMax;
490       ptMax.x = ptMax.y = 0;
491
492       if(lpszOutput == NULL)
493         return -1;
494  
495       i = 0;
496       for(ps = pi->ppd->PageSizes; ps; ps = ps->next, i++) {
497         if(ps->PaperDimension->x > ptMax.x)
498           ptMax.x = ps->PaperDimension->x;
499         if(ps->PaperDimension->y > ptMax.y)
500           ptMax.y = ps->PaperDimension->y;
501       }
502       *((POINT*)lpszOutput) = ptMax;
503       return 1;
504     }
505
506   case DC_MINEXTENT:
507     {
508       PAGESIZE *ps;
509       int i;
510       POINT ptMax;
511       ptMax.x = ptMax.y = 0;
512
513       if(lpszOutput == NULL)
514         return -1;
515  
516       i = 0;
517       for(ps = pi->ppd->PageSizes; ps; ps = ps->next, i++) {
518         if(ps->PaperDimension->x > ptMax.x)
519           ptMax.x = ps->PaperDimension->x;
520         if(ps->PaperDimension->y > ptMax.y)
521           ptMax.y = ps->PaperDimension->y;
522       }
523       *((POINT*)lpszOutput) = ptMax;
524       return 1;
525     }
526
527   case DC_SIZE:
528     return lpdm->dmSize;
529
530   case DC_TRUETYPE:
531     FIXME("DC_TRUETYPE: stub\n");
532     return DCTT_SUBDEV;
533
534   case DC_VERSION:
535     return lpdm->dmSpecVersion;
536
537   default:
538     FIXME("Unsupported capability %d\n", fwCapability);
539   }
540   return -1;
541 }
542
543 /**************************************************************
544  *
545  *     PSDRV_DeviceCapabilities
546  */
547 DWORD PSDRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice,
548                                LPCSTR lpszPort, WORD fwCapability,
549                                LPSTR lpszOutput, LPDEVMODEA lpdm)
550 {
551     return PSDRV_DeviceCapabilities16(lpszDevice, lpszPort, fwCapability,
552                                       lpszOutput, lpdm);
553 }
554
555 /***************************************************************
556  *
557  *      PSDRV_DeviceMode16      [WINEPS.13]
558  *
559  */
560 void WINAPI PSDRV_DeviceMode16(HWND16 hwnd, HANDLE16 hDriver,
561 LPSTR lpszDevice, LPSTR lpszPort)
562 {
563     PSDRV_ExtDeviceMode16( hwnd, hDriver, NULL, lpszDevice, lpszPort, NULL, 
564                            NULL, DM_PROMPT );
565     return;
566 }
567
568 #if 0
569 typedef struct {
570   DWORD nPages;
571   DWORD Unknown;
572   HPROPSHEETPAGE hPages[10];
573 } EDMPS;
574
575 INT PSDRV_ExtDeviceModePropSheet(HWND hwnd, LPSTR lpszDevice, LPSTR lpszPort,
576                                  LPVOID pPropSheet)
577 {
578     EDMPS *ps = pPropSheet;
579     PROPSHEETPAGE psp;
580
581     psp->dwSize = sizeof(psp);
582     psp->hInstance = 0x1234;
583     
584     ps->nPages = 1;
585     
586 }
587
588 #endif