Microsoft KB Archive/242395

{|
 * width="100%"|

PRB: AddPrintProcessor Fails to Install Processor DLL on Windows

 * }

Q242395

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API), used with:
 * the operating system: Microsoft Windows 95
 * the operating system: Microsoft Windows 98
 * the operating system: Microsoft Windows 98 Second Edition
 * the operating system: Microsoft Windows Millennium Edition

-

SYMPTOMS
A call to the AddPrintProcessor function to install a print processor dynamic link library (DLL) into the print spooler subsystem fails and returns FALSE. The GetLastError function returns the error value "ERROR_BAD_FORMAT". However, the DLL seems valid and can be loaded in a test application through a call to the LoadLibrary function. The problem may occur on some computers but not others.

CAUSE
The problem is caused by an attempt to relocate the DLL in memory when the LoadLibrary function is called by the spooler but the DLL was not linked to allow it to be relocated.

RESOLUTION
To resolve this problem, you can use the "/FIXED:no" linker option to build the DLL so it can be relocated in memory when the print spooler process attempts to load the executable file.

STATUS
This behavior is by design.

Additional query words: spool print processor link ddk

Keywords : kbDDK kbGDI kbSDKWin32 kbSpooler kbDSupport kbGrpDSGDI kbgrpdsvc

Issue type : kbprb

Technology : kbAudDeveloper kbWin32sSearch kbWin32API