Skip to content

Commit

Permalink
Added Win32Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanRF committed Dec 21, 2015
1 parent 55b240f commit 522e422
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Next release

Features
--------
* [#569](https://github.com/java-native-access/jna/pull/569): Added PRINTER_INFO_2 support and GetPrinter function [@IvanRF](https://github.com/IvanRF)
* [#569](https://github.com/java-native-access/jna/pull/569): Added `com.sun.jna.platform.win32.Winspool.PRINTER_INFO_2` support and GetPrinter function in `com.sun.jna.platform.win32.Winspool` [@IvanRF](https://github.com/IvanRF)
* [#526](https://github.com/java-native-access/jna/pull/526): Added initialization and conversion between Windows SYSTEMTIME and Java Calendar [@lgoldstein](https://github.com/lgoldstein)
* [#532](https://github.com/java-native-access/jna/pull/529): Added `com.sun.jna.platform.win32.Mpr`, `com.sun.jna.platform.win32.LmShare`, and `com.sun.jna.platform.win32.Winnetwk` - [@amarcionek](https://github.com/amarcionek).
* [#532](https://github.com/java-native-access/jna/pull/529): Added `ACCESS_*` definitions to `com.sun.jna.platform.win32.LmAccess` - [@amarcionek](https://github.com/amarcionek).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ public static PRINTER_INFO_2 getPrinterInfo2(String printerName) {

PRINTER_INFO_2 pinfo2 = new PRINTER_INFO_2(pcbNeeded.getValue());

Winspool.INSTANCE.GetPrinter(pHandle.getValue(), 2, pinfo2.getPointer(), pcbNeeded.getValue(), pcReturned);
if (!Winspool.INSTANCE.GetPrinter(pHandle.getValue(), 2, pinfo2.getPointer(), pcbNeeded.getValue(), pcReturned)) {
throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
}

pinfo2.read();
return pinfo2;
Expand Down

0 comments on commit 522e422

Please sign in to comment.