[Bug 30665] New: Add support for DeletePrinterDriverEx deletion flags (DPD_DELETE_*)

wine-bugs at winehq.org wine-bugs at winehq.org
Sat May 12 15:34:32 CDT 2012


http://bugs.winehq.org/show_bug.cgi?id=30665

             Bug #: 30665
           Summary: Add support for DeletePrinterDriverEx deletion flags
                    (DPD_DELETE_*)
           Product: Wine
           Version: 1.5.4
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: -unknown
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: focht at gmx.net
    Classification: Unclassified


Hello,

encountered this with "Acrobat 7" tryout installer.

The installer executes a custom action "DeleteDistillerPrinter" to remove any
previous remains of "Adobe PDF Converter" driver.

DPD_DELETE_UNUSED_FILES          0x00000001
DPD_DELETE_SPECIFIC_VERSION      0x00000002
DPD_DELETE_ALL_FILES             0x00000004

First try (DPD_DELETE_UNUSED_FILES | DPD_DELETE_ALL_FILES):

--- snip ---
0025:trace:msi:HANDLE_CustomType1 Calling function L"DeleteDistillerPrinter"
from L"C:\\users\\focht\\Temp\\msiba95.tmp" 
...
0037:trace:msi:ACTION_CallDllFunction calling L"DeleteDistillerPrinter" 
...
0037:Call KERNEL32.LoadLibraryA(004d9d1c "winspool.drv") ret=004d4c0e
0037:Ret  KERNEL32.LoadLibraryA() retval=f7460000 ret=004d4c0e
0037:Call KERNEL32.GetProcAddress(f7460000,004d9d04 "DeletePrinterDriverExA")
ret=004d4c2a
0037:Ret  KERNEL32.GetProcAddress() retval=f74653e4 ret=004d4c2a
0037:Call winspool.drv.DeletePrinterDriverExA(00000000,00000000,004d9844 "Adobe
PDF Converter",00000005,00000000) ret=004d4c36
0037:Call ntdll.RtlCreateUnicodeStringFromAsciiz(015be704,004d9844 "Adobe PDF
Converter") ret=f74663b7
0037:Ret  ntdll.RtlCreateUnicodeStringFromAsciiz() retval=00000001 ret=f74663b7
0037:trace:winspool:DeletePrinterDriverExW (null) (null) L"Adobe PDF Converter"
5 0
0037:fixme:winspool:DeletePrinterDriverExW dwDeleteFlag = 5 - unsupported
...
0037:Ret  winspool.drv.DeletePrinterDriverExA() retval=00000000 ret=004d4c36
0037:Call KERNEL32.FreeLibrary(f7460000) ret=004d4c44
0037:Ret  KERNEL32.FreeLibrary() retval=00000001 ret=004d4c44
...
--- snip ---

Second try (DPD_DELETE_UNUSED_FILES):

--- snip ---
0037:Call winspool.drv.DeletePrinterDriverExA(00000000,00000000,004d9844 "Adobe
PDF Converter",00000001,00000000) ret=004d4c52
0037:Call ntdll.RtlCreateUnicodeStringFromAsciiz(015be714,004d9844 "Adobe PDF
Converter") ret=f74663b7
0037:Ret  ntdll.RtlCreateUnicodeStringFromAsciiz() retval=00000001 ret=f74663b7
0037:trace:winspool:DeletePrinterDriverExW (null) (null) L"Adobe PDF Converter"
1 0
0037:fixme:winspool:DeletePrinterDriverExW dwDeleteFlag = 1 - unsupported
...
0037:Ret  winspool.drv.DeletePrinterDriverExA() retval=00000000 ret=004d4c52 
--- snip ---

Third try, "fallback" (empty deletion flags):

--- snip ---
0037:Call winspool.drv.DeletePrinterDriverA(00000000,00000000,004d9844 "Adobe
PDF Converter") ret=004d4c65
0037:Call ntdll.RtlCreateUnicodeStringFromAsciiz(015be704,004d9844 "Adobe PDF
Converter") ret=f74663b7
0037:Ret  ntdll.RtlCreateUnicodeStringFromAsciiz() retval=00000001 ret=f74663b7
0037:trace:winspool:DeletePrinterDriverExW (null) (null) L"Adobe PDF Converter"
0 0
0037:trace:winspool:WINSPOOL_OpenDriverReg ((null))
0037:trace:winspool:validate_envW testing (null)
...
0037:trace:winspool:validate_envW using 0xf748902c: L"Windows NT x86"
...
0037:Call advapi32.RegCreateKeyW(80000002,00d85ae8
L"System\\CurrentControlSet\\control\\Print\\Environments\\Windows NT
x86\\Drivers\\Version-3",015be634) ret=f746ebca
0037:Ret  advapi32.RegCreateKeyW() retval=00000000 ret=f746ebca
0037:Call ntdll.RtlFreeHeap(00110000,00000000,00d85ae8) ret=f746ebf4
0037:Ret  ntdll.RtlFreeHeap() retval=00000001 ret=f746ebf4
0037:Call advapi32.RegDeleteTreeW(00000104,00d85ab8 L"Adobe PDF Converter")
ret=f747c98a
0037:Ret  advapi32.RegDeleteTreeW() retval=00000002 ret=f747c98a
0037:Call advapi32.RegCloseKey(00000104) ret=f747c9a3
0037:Ret  advapi32.RegCloseKey() retval=00000000 ret=f747c9a3
...
0037:Ret  winspool.drv.DeletePrinterDriverA() retval=00000000 ret=004d4c65 
--- snip ---

MSDN:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd183546%28v=vs.85%29.aspx

--- quote ---
dwDeleteFlag [in]

    The options for deleting files and versions of the driver. This parameter
can be one or more of the following values.
    Value    Meaning

    DPD_DELETE_SPECIFIC_VERSION

    Deletes the version specified in dwVersionFlag. This does not ensure that
the driver will be removed from the list of supported drivers for the server.

    DPD_DELETE_UNUSED_FILES

    Removes any unused driver files.

    DPD_DELETE_ALL_FILES

    Deletes the driver only if all its associated files can be removed. The
delete operation fails if any of the driver's files are being used by some
other installed driver.

    If DPD_DELETE_SPECIFIC_VERSION is not specified, the function deletes all
versions of the driver if none of them is in use. If neither
DPD_DELETE_UNUSED_FILES nor DPD_DELETE_ALL_FILES is specified, the function
does not delete driver files.
--- quote ---

Source:

http://source.winehq.org/git/wine.git/blob/7508a5d4b2d5246ea9c19afd734274d12ca4b5bc:/dlls/winspool.drv/info.c#l6626

--- snip ---
6626 BOOL WINAPI DeletePrinterDriverExW( LPWSTR pName, LPWSTR pEnvironment,
6627     LPWSTR pDriverName, DWORD dwDeleteFlag, DWORD dwVersionFlag)
6628 {
6629     HKEY hkey_drivers;
6630     BOOL ret = FALSE;
6631 
6632     TRACE("%s %s %s %x %x\n", debugstr_w(pName), debugstr_w(pEnvironment),
6633           debugstr_w(pDriverName), dwDeleteFlag, dwVersionFlag);
6634 
6635     if(pName && pName[0])
6636     {
6637         FIXME("pName = %s - unsupported\n", debugstr_w(pName));
6638         SetLastError(ERROR_INVALID_PARAMETER);
6639         return FALSE;
6640     }
6641 
6642     if(dwDeleteFlag)
6643     {
6644         FIXME("dwDeleteFlag = %x - unsupported\n", dwDeleteFlag);
6645         SetLastError(ERROR_INVALID_PARAMETER);
6646         return FALSE;
6647     }
...
6662     return ret;
6663 }
--- snip ---

There is a page fault after the last call to
winspool.drv.DeletePrinterDriverA() which might be a separate bug.

--- snip ---
0037:trace:seh:raise_exception code=c0000005 flags=0 addr=0x7bc78e63
ip=7bc78e63 tid=0037
0037:trace:seh:raise_exception  info[0]=00000000
0037:trace:seh:raise_exception  info[1]=00000000
0037:trace:seh:raise_exception  eax=00000000 ebx=7bcbf544 ecx=75e74639
edx=00000000 esi=7ed94da0 edi=00000037
0037:trace:seh:raise_exception  ebp=015be478 esp=015be380 cs=0023 ds=002b
es=002b fs=0063 gs=006b flags=00010246
0037:trace:seh:call_stack_handlers calling handler at 0x7bc91c09 code=c0000005
flags=0
0037:trace:seh:__regs_RtlUnwind code=c0000005 flags=2
0037:trace:seh:__regs_RtlUnwind calling handler at 0x7bc76e57 code=c0000005
flags=2
0037:trace:seh:__regs_RtlUnwind handler at 0x7bc76e57 returned 1
0037:trace:seh:raise_exception code=c0000005 flags=0 addr=(nil) ip=00000000
tid=0037
0037:trace:seh:raise_exception  info[0]=00000000
0037:trace:seh:raise_exception  info[1]=00000000
0037:trace:seh:raise_exception  eax=00000000 ebx=7ed46639 ecx=00000000
edx=00000004 esi=7ed94da0 edi=00000037
0037:trace:seh:raise_exception  ebp=004d4c65 esp=015be7ec cs=0023 ds=002b
es=002b fs=0063 gs=006b flags=00010202
...
0037:err:msi:ACTION_CallDllFunction Custom action
(L"C:\\users\\focht\\Temp\\msiba95.tmp":L"DeleteDistillerPrinter") caused a
page fault: c0000005 
--- snip ---

$ du -sh AcTR7EFG.exe 
116M    AcTR7EFG.exe

$ sha1sum AcTR7EFG.exe 
4f1ff389ea71f21d624083d65bbe5a74e4760079  AcTR7EFG.exe

Regards

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list