GDI Printer Driver Development RRS feed

  • Question

  • Hello all,

    I am now developing USB GDI printer driver, encountered a problem regarding to only shows the private forms when configure the page setup for notepad, our forms are stored in the private sections of the registry, we can get these separately. I used debugview to checked when the page setup is clicked, the wCapability as DC_PAPERNAMES, DC_PAPERS... and other several requests will be sent to the driver in below function:

     * Function: IOEMUI::DeviceCapabilities
     * Purpose: Specify customized device capabilities.
     * Return: HRESULT
    HRESULT __stdcall IOEMUI::DeviceCapabilities(
        POEMUIOBJ   poemuiobj,
        HANDLE      hPrinter,
        PWSTR       pDeviceName,
        WORD        wCapability,
        PVOID       pOutput,
        PDEVMODE    pPublicDM,
        PVOID       pOEMDM,
        DWORD       dwOld,
        DWORD       *dwResult)



    But I do not know how to pass the values to pOutput and dwResult and also the return value of the function.

    My code as below:

        if (DC_PAPERNAMES == wCapability)
            VERBOSE(_T("DeviceCapabilities: DC_PAPERNAMES is requested! pDeviceName is: %s\n"), pDeviceName);

            ::lstrcpyW(strTestPaperName, _T("testPaperName"));

            VERBOSE(_T("strTestPaperName is: %s\n"), strTestPaperName);

            pOutput = (PVOID)strTestPaperName;
            *dwResult = 1;


    But it does not work.

    Anyone can give me suggestions?

    Thanks a lot!


    Friday, March 10, 2017 8:13 AM