Tech Support > Microsoft Windows > Drivers > Error msg upon adding printer
Error msg upon adding printer
Posted by Michael Leung on September 5th, 2003


Hi,

I am trying to install my custom printer driver via the Add Printer Wizard.
Upon clicking on Finish, I get an error message saying:
"Printer Driver not installed. Operation could not be completed."
My .inf file installs 3 files: a graphic DLL, a UI DLL and a print
processor.

Error messages in setupAPI.log complained about the files not having
digital signature information. This also happens to samples that come
with the DDK.

Does anyone know why I get the error message and how I can fix it ?
Is it a must to have the DLLs properly implemented ? My goal at this stage
is to install my print driver that does nothing. Regardless of what it does,
I
want to be able to install it at least.

Many thanks,
Michael.


Posted by Ashwin [MS] on September 8th, 2003


You cannot install a driver that does/has nothing. It has to have the
required function entry points at the very least. The functions themselves
don't need functional code within them. But they need to return the correct
value as specified in the docs. Anyway, since you are at the starting point
of the development of your driver, I am curious as to why you want to go
the monolithic printer driver route? We recommend that you use the
Unidrv-based model and write rendering and/or UI plug-ins if you want
customize any aspects. I suggest that you investigate this approach further
and see if you can also follow it.

- Ashwin

This posting is provided "AS IS" with no warranties, and confers no rights.

Posted by Michael Leung on September 10th, 2003


My DLLs has all the required functions in it but these functions have empty
bodies at the moment. I don't have any functional code at the moment. For
functions that return a BOOL I just hard a return value of TRUE for them.
For those that return a structure or a handle I temporarily return a NULL. I
wondered if hardcoding a NULL as the return value for a function expected to
return a valid handle, like DrvEnablePDEV, would cause the print drvier
installation to fail? It didn't. And I can't figure out what is wrong with
my INF file either. SetupAPI didn't reveal any thing interesting. So I
really don't know how to resolve this "Print Driver not installed. Operation
could not be completed" error now. My INF file looks like this:

[Version]
Signature="$Windows NT$"
Provider=%PROVIDER_NAME%
Class=Printer
ClassGUID={4D36E979-E325-11CE-BFC1-08002BE10318}
DriverVer=09/05/2003,1.0

;
; Manufacturer Sections
;
; This section lists all of the manufacturers that we will
; display in the Dialog box.
;
[Manufacturer]
%MANU_NAME%=MANU_NAME

[MANU_NAME]
"My Own Printer" = MYOWNPRINTER

[MYOWNPRINTER]
CopyFiles=PRTDRV_FILES
CopyFiles=MyOwnPrintProcessor
DriverFile=mogra.dll
PrintProcessor="My Own Print Processor,mopro.dll"
DefaultDataType=EMF
ConfigFile=mopui.dll

[PRTDRV_FILES]
mopui.dll
mogra.dll

[MyOwnPrintProcessor]
mopro.dll

[DestinationDirs]
DefaultDestDir=66000
MyOwnPrintProcessor=66001

[SourceDisksNames]
1 = %DISK_DESC%

[SourceDisksFiles.x86]
moprt.dll = 1
mogra.dll = 1
mopui.dll = 1

[Strings]
MANU_NAME="Manufacturer name here"
PROVIDER_NAME="Provider name here"
DISK_DESC="Disk Desc here"


I would like to write one driver that can work on NT/Win2K/XP. Is the
Unidrv-based model supported on NT4 OS ?

Many thanks,
Michael.

""Ashwin [MS]"" <ashwinn@online.microsoft.com> wrote in message
news:nA0RjdidDHA.2108@cpmsftngxa06.phx.gbl...


Posted by Michael Leung on September 10th, 2003


Dan,

First of all, thanks for you reply.
I have the Win2K DDK installed. I have modified the print\plotter sample
project and hard-coded the return value of DrvEnablePDEV in enable.c to
NULL. I built the plotter and plotui project and I successfully installed a
plotter. Now this contradicts your reasoning which asserts a NULL return
value by DrvEnablePDEV will cause the installation to fail. How come it
didn't fail for the the DDK samples ?

Please comment.

Michael.

"Dan Negrescu" <dnegrescu@hotmail.com> wrote in message
news:eO3oFw2dDHA.3240@TK2MSFTNGP11.phx.gbl...


Posted by Michael Leung on September 10th, 2003


Thanks for your reply.
Yes I did fill out the DRVENABLEDATA structure.

- Michael

""Ashwin [MS]"" <ashwinn@online.microsoft.com> wrote in message
news:FCgOXH8dDHA.460@cpmsftngxa06.phx.gbl...



Similar Posts