Checking status of KR403 with winspool in Java

Hi. I have problem with checking status of zebra KR403 in Java. I'm trying to use winspool from jna but still geting status 0 for PRINTER_INFO_2.


    public static Winspool2.PRINTER_INFO_2 getPrinterInfo2(String printerName) {         IntByReference pcbNeeded = new IntByReference();         IntByReference pcReturned = new IntByReference();         HANDLEByReference pHandle = new HANDLEByReference();           Winspool2.INSTANCE.OpenPrinter(printerName, pHandle, null);           Winspool2.INSTANCE.GetPrinter(pHandle.getValue(),                 2,                 null,                 0,                 pcbNeeded);         if (pcbNeeded.getValue() <= 0) {             return new Winspool2.PRINTER_INFO_2();         }           Winspool2.PRINTER_INFO_2 pinfo2 = new Winspool2.PRINTER_INFO_2(pcbNeeded.getValue());           Winspool2.INSTANCE.GetPrinter(pHandle.getValue(),                 2, pinfo2.getPointer(),                 pcbNeeded.getValue(),                 pcReturned);;           return pinfo2;     }