

The size, in bytes, of the buffer pointed to by pValueName. This means that the EnumPrinterData function may return values in any order.Ī pointer to a buffer that receives the name of the configuration data value, including a terminating null character. Set dwIndex to zero in the next call to EnumPrinterData to start the actual enumeration process.Ĭonfiguration data values are not ordered. If you use the technique mentioned in the descriptions of the cbValueName and cbData parameters to obtain adequate buffer size values, setting both those parameters to zero in a first call to EnumPrinterData for a specified printer handle, the value of dwIndex does not matter for that call. See the following Remarks section for further information. Then increment the parameter by one for subsequent calls involving the same printer, until the function returns ERROR_NO_MORE_ITEMS. Set this parameter to zero for the first call to EnumPrinterData for a specified printer handle. Use the OpenPrinter or AddPrinter function to retrieve a printer handle.Īn index value that specifies the configuration data value to retrieve.

Syntax DWORD EnumPrinterData(Ī handle to the printer whose configuration data is to be obtained. To retrieve the configuration data in a single call, use the EnumPrinterDataEx function. NResult = EnumPrintersA(2, svName, 5, pPointer, 500, nvByteCopy, nvNumberOfDevices) Īt the EnumPrintersA, the function call crashes the installer.The EnumPrinterData function enumerates configuration data for a specified printer. Windows API call builds list of installed printers Load winspool.drv so you can call EnumPrintersA Prototype INT winspool.EnumPrintersA(LONG, BYREF STRING, LONG, BYREF POINTER, LONG, BYREF LONG, BYREF LONG) įunction PopulatePrinterSelectionComboBoxCustomAction(hMSI) helper functions used in PopulatePrinterSelectionComboBoxCustomAction located in Windows installation My code is // structure for EnumPrintersA from winspool.drv Custom Action PopulatePrinterSelectionComboBoxCustomAction did not close 1 MSIHANDLEs.ĬustomAction PopulatePrinterSelectionComboBoxCustomAction returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)Īction ended 16:34:43: PopulatePrinterSelectionComboBoxCustomAction. MSI (c) (8C:08) : Note: 1: 2769 2: PopulatePrinterSelectionComboBoxCustomAction 3: 1 I'm doing something wrong as I get the error: MSI (c) (8C:08) : Leaked MSIHANDLE (76) of type 790541 for thread 14544
