none
Rename wdk 7 printer portmon dlls RRS feed

  • Question

  • Hi,

    I have WDK generated printer portmon dlls (ddklocalmon.dll and ddklocalui.dll).I want to rename these dlls. I have renamed the dlls and corrosponding inf file entries.

    However, when I do that the port will not get created. But when I revert back name of the dll as ddklocalmon and ddklocalui, it works. Is there any standard way to rename these dlls? I use BUILD.exe to generate these dlls.

    Thanks,

    Ram

    Thursday, October 11, 2012 4:34 AM

All replies

  • are you renaming in the sources file? or just the .dll file in the obj directory? without posting your INF changes, it is hard to know what is going wrong. if ddklocalui imports from ddklocalmon or vice versa you need to make sure the name in the import table is the new name

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

    Thursday, October 11, 2012 4:50 AM
  • Hi Doron,

    I am renaming just the dlls not source file. Below is my Inf file.

    --------------------------------------------INF STSRTS HERE---------------------

    ; MyPort.inf
    ;
    ; Installation inf for printer port monitor
    ;
    ;

    [Version]
    Signature="$Windows NT$"
    Provider=%PMProducer%
    ClassGUID={4D36E979-E325-11CE-BFC1-08002BE10318}
    Class=Printer

    [PortMonitors]
    "Port Monitor" = sampleportmon

    [sampleportmon]
    CopyFiles=@ddklocalmon.dll, @ddklocalui.dll
    PortMonitorDll=ddklocalmon.dll

    [SourceDisksFiles]
    ddklocalmon.dll=1,,
    ddklocalui.dll=1,,

    [SourceDisksNames]
    1="Port Monitor Installation Disk",,,

    [Strings]
    PMProducer="ABC Inc."

    --------------------------------------------INF ENDS HERE---------------------

    What is the issue with the above file and Where is import table located?

    Thanks,

    Ram

    Thursday, October 11, 2012 4:56 AM
  • rename the target name in the sources file, ie this line

    TARGETNAME=ddklocalui

    becomes

    TARGETNAME=<your new file name>

    you can check the imports by running

    link /dump /imports <your binary dll>


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

    Thursday, October 11, 2012 5:11 AM
  • Hi Doron,

    I have renamed the dlls by changing the TARGETNAME in Sources file. Also, I changed the inf file to have this new name. However, I still get the same error.

    Add Port->New Port Type->Select the Inf-> New Port type gets added.

    However, when I select this new port type->Click on new Port => It throws below error...

    "Specified port cannot be added.Operation could not be completed (error 0x00000002)"

    I can see the dlls copied to System 32 folder.

    I tried restarting spooler and restarting machine as well but does not work.

    I renamed these dlls back to original then it worked again.

    My spooler service runs under local system account and allow service to interact with desktop is checked.

    your help will be appreciated..

    Thanks

    Thursday, October 11, 2012 7:17 AM
  • "Specified port cannot be added.Operation could not be completed (error 0x00000002)"

    Error 2 is ERROR_FILE_NOT_FOUND (The system cannot find the file specified.)
    http://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx

    So you might not have fixed up all file names in the inf file.

    You could use a tool like Process Monitor to monitor which file could not be found.

    /christoph

    Tuesday, October 16, 2012 7:22 AM
  • Hi Chris,

    I just have 2 dlls as in the earlier thread above. I have both the files present and have updated accordingly.

    Regards,

    Ram

    Wednesday, October 17, 2012 10:04 AM