Re: WINEDLLPATH, ddiwrapper, msvcrt40 (Re: wine based win32 printer drivers)

2008-04-07 Thread Ulrich Hecht
Hi!

On Saturday 05 April 2008, Hin-Tak Leung wrote:
> 2) (to uli and Till) - do you mind if I put a mod/update of ddiwrapper
> out publicly, or uli can release a new one that works with current
> wine?

Hand it over, and I'll put it on the FTP server and update our package. 

CU
Uli

-- 
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)




Re: WINEDLLPATH, ddiwrapper, msvcrt40 (Re: wine based win32 printer drivers)

2008-04-05 Thread Till Kamppeter
Hin-Tak Leung wrote:
> 2) (to uli and Till) - do you mind if I put a mod/update of ddiwrapper out
> publicly, or uli can release a new one that works with current wine? 
> 
> I have a third question - while looking at another XP driver for a 
> paper-weight printer (konica-minolta magic color 2500W), it depends on 
> msvcrt40.dll. 
>

I am not of much help here. I have never really used wine (once for 
running a self-extracting .exe with a firmware for a didgital camera in 
it) and I also never packaged it for a distro.

Till





Re: wine based win32 printer drivers

2008-04-04 Thread Hin-Tak Leung
I am looking at ddiwrapper lately and having a lot of fun with it. Is Marcel's 
on-going 
not-merged work anywhere on line that I can have a peek before its merge into 
wine?

Hin-Tak

--- On Mon, 31/3/08, Detlef Riekenberg <[EMAIL PROTECTED]> wrote:

> From: Detlef Riekenberg <[EMAIL PROTECTED]>
> Subject: wine based win32 printer drivers
> To: "Marcel Partap" <[EMAIL PROTECTED]>
> Cc: wine-devel@winehq.org
> Date: Monday, 31 March, 2008, 12:12 AM
> On So, 2008-03-30 at 06:03 +0200, Marcel Partap wrote:
> > Anyways, I am working on getting something merged.. 
> 
> Great!
> 
> > For now the target is to get the Adobe pscript5 driver
> working which
> > has its own raster renderer and thus does not depend
> on the dib
> > engine. 
> A Postscript Driver has no raster renderer...
> A Postscript Driver has a Postscript Engine.
> 
> > Just started by making AddPrinter correctly get 
> > a default devmode out of the driver, patch is
> attached, 
> 
> > DRIVER_EVENT_INITIALIZE, 3,
> "3" is wrong here. See:
> myAddPrinterDriverEx(DWORD level, ...
> 
> Since there are much more Events, we need the DriverUI in
> more Places
> later. I suggest a simple struct, which can be extended
> later
> (The struct must include the Results from GetProcAddress)
> 
> 
> The changes for winspool.drv must go in a seperate Patch.
> WINSPOOL_CallDrvDocumentProperties is the wrong name, when
> you 
> call DrvDocumentPropertySheets.
> 
> You should collect all API in winspool.drv, that need the
> driverui
> (some are not implemented) and design a simple struct
> with helper functions (Use monitor_t as example).
> Not all Drivers Export DrvDocumentPropertySheets.
> You must prepare to use a Fallback to get the default
> devmode
> (DrvConvertDevMode)
> See winspool.drv/monitor_load as Example:
> - InitializePrintMonitor2 is suggested my MSDN, but not
> needed yet
> - InitializePrintMonitor implemented
> - InitializeMonitorEx and InitializeMonitor as Fallback.
> 
> The current Code is a crosscall from DocumentPropertiesW to
> DocumentPropertiesA.
> The DDI-API is unicode and should be the prefered way.
> When wineps.drv is updated, the old code with the crosscall
> can be
> removed, since we do not support ANSI Drivers (Windows 9x).
> 
> You can even use the same struct and helper functions 
> in localspl.dll and winspool.drv
> 
> 
> -- 
>  
> By by ... Detlef


  ___ 
Yahoo! For Good helps you make a difference  

http://uk.promotions.yahoo.com/forgood/




Re: wine based win32 printer drivers

2008-03-30 Thread Marcel Partap

A Postscript Driver has no raster renderer...
A Postscript Driver has a Postscript Engine.

... ^ ^


DRIVER_EVENT_INITIALIZE, 3,

"3" is wrong here. See: myAddPrinterDriverEx(DWORD level, ...
It seemed suspicious to me anyway.. How do those integer shifts creep into my retyped header files 
again and again? hhh ... *g



Since there are much more Events, we need the DriverUI in more Places
later. I suggest a simple struct, which can be extended later
(The struct must include the Results from GetProcAddress)
a struct.. that contains what? the function pointers and results? i had thought about adding a 
macro.. for hooking driver exports..



The changes for winspool.drv must go in a seperate Patch.

yeah it jsut was a quick and dirty preview patch ;)

WINSPOOL_CallDrvDocumentProperties is the wrong name, when you 
call DrvDocumentPropertySheets.

statement totally makes sense.


You should collect all API in winspool.drv, that need the driverui
(some are not implemented) and design a simple struct
with helper functions (Use monitor_t as example).

I dont really grok it... like the DDI_FUNCS array in the patch i sent you or 
rather somethign
stuct {
LPWSTR name;
LPWSTR driverdll;
HMODULE hdriver;
LPWSTR interfacedll;
HMODULE hinterface,
DWORD refcount;
} printertriver_t;
?


Not all Drivers Export DrvDocumentPropertySheets.
You must prepare to use a Fallback to get the default devmode
(DrvConvertDevMode)

ok just need to transplant my old code


See winspool.drv/monitor_load as Example:

l8r :)


The current Code is a crosscall from DocumentPropertiesW to
DocumentPropertiesA.
The DDI-API is unicode and should be the prefered way.

so shall i put the ddi call before that deprecated stuff? and does it need to 
be called from docpropsA?
oh and I reodne the EnumForms patch (now less monsterous ;). Now here's only the part that provides 
the builtin forms, but very easy to expand, once its ready to be &/ comimtted i'll do the addforms 
delforms stuff..
and oh sh1t gotta write my soc application today last day heh.. this time i'm opting for drupal/php 
code though C/win32api is just too hellish *g

n8

--

  "Obstacles are those frightful things you see when you take your eyes off your 
goal."
  -- Henry Ford 
(1863-1947)
  Change the world! Vote revolution: http://hfopi.org/vote-future

>From 8018b72f94b3a63598db70c95851ebf0a49da89f Mon Sep 17 00:00:00 2001
From: Marcel Partap <[EMAIL PROTECTED]>
Date: Mon, 31 Mar 2008 05:29:09 +0200
Subject: [PATCH] winspool: implement EnumFormsA/W with built-in forms

---
 dlls/winspool.drv/info.c |  145 ++---
 1 files changed, 135 insertions(+), 10 deletions(-)

diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c
index 351aaba..0071ef4 100644
--- a/dlls/winspool.drv/info.c
+++ b/dlls/winspool.drv/info.c
@@ -123,6 +123,17 @@ typedef struct {
 WCHAR *document_title;
 } job_t;
 
+typedef struct {
+SIZEL size;
+RECTL area;
+DWORD formorder;
+DWORD flags;
+} form_regentry_t;
+
+typedef struct {
+WCHAR   formname[CCHFORMNAME];
+form_regentry_t formdata;
+} builtin_form_t;
 
 typedef struct {
 LPCWSTR  envname;
@@ -248,6 +259,12 @@ static const WCHAR LPR_Port[] = {'L','P','R',':',0};
 static const WCHAR default_doc_title[] = {'L','o','c','a','l',' ','D','o','w','n','l','e','v','e','l',' ',
   'D','o','c','u','m','e','n','t',0};
 
+static const builtin_form_t builtin_forms[] = {
+{{'L','e','t','t','e','r',0}, {{216000,279000}, {0,0,216000,279000}, 0, FORM_BUILTIN}},
+{{'A','3',0}, {{297000,42}, {0,0,297000,42}, 0, FORM_BUILTIN}},
+{{'A','4',0}, {{21,297000}, {0,0,21,297000}, 0, FORM_BUILTIN}},
+{{'A','5',0}, {{148000,21}, {0,0,148000,21}, 0, FORM_BUILTIN}} };
+
 static const DWORD di_sizeof[] = {0, sizeof(DRIVER_INFO_1W), sizeof(DRIVER_INFO_2W),
  sizeof(DRIVER_INFO_3W), sizeof(DRIVER_INFO_4W),
  sizeof(DRIVER_INFO_5W), sizeof(DRIVER_INFO_6W),
@@ -7181,23 +7198,131 @@ BOOL WINAPI DeletePrintProvidorW(LPWSTR pName, LPWSTR pEnvironment, LPWSTR pPrin
 /**
  *  EnumFormsA (WINSPOOL.@)
  */
-BOOL WINAPI EnumFormsA( HANDLE hPrinter, DWORD Level, LPBYTE pForm,
-DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned )
+BOOL WINAPI EnumFormsA(HANDLE hPrinter, DWORD Level, LPBYTE pForm,
+   DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned)
 {
-FIXME("%p %x %p %x %p %p\n", hPrinter, Level, pForm, cbBuf, pcbNeeded, pcReturned);
-SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-return FALSE;
+PFORM_INFO_1A fiA;
+PFORM_INFO_1W fiW;
+LPBYTE bufferW;
+BOOL   res;
+DWORD  i;
+DWORD  needed = 0;
+DWORD  num = 0;
+
+TRACE("(%p %d %p %d %