< prev index next >

src/jdk.incubator.jpackage/windows/native/libjpackage/UniqueHandle.h

Print this page

        

*** 21,34 **** * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ #include <windows.h> ! extern "C" { ! BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, ! LPVOID lpvReserved) { ! return true; } ! } \ No newline at end of file --- 21,43 ---- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ + #ifndef UNIQUEHANDLE_H + #define UNIQUEHANDLE_H + #include <windows.h> + #include <memory> + ! struct WndHandleDeleter { ! typedef HANDLE pointer; ! void operator()(HANDLE h) { ! ::CloseHandle(h); } ! }; ! ! typedef std::unique_ptr<HANDLE, WndHandleDeleter> UniqueHandle; ! ! #endif // #ifndef UNIQUEHANDLE_H
< prev index next >