Search in sources :

Example 11 with EVT_HANDLE

use of com.sun.jna.platform.win32.Winevt.EVT_HANDLE in project jna by java-native-access.

the class WevtapiTest method testEvtOpenChannelConfig.

public void testEvtOpenChannelConfig() throws Exception {
    EVT_HANDLE channelHandle = null;
    try {
        channelHandle = Wevtapi.INSTANCE.EvtOpenChannelConfig(null, "Application", 0);
        assertNotNull(channelHandle);
        Winevt.EVT_VARIANT evtVariant = WevtapiUtil.EvtGetChannelConfigProperty(channelHandle, Winevt.EVT_CHANNEL_CONFIG_PROPERTY_ID.EvtChannelConfigClassicEventlog);
        assertThat(((WinDef.BOOL) evtVariant.getValue()).booleanValue(), is(true));
    } finally {
        if (channelHandle != null) {
            Wevtapi.INSTANCE.EvtClose(channelHandle);
        }
    }
}
Also used : EVT_HANDLE(com.sun.jna.platform.win32.Winevt.EVT_HANDLE)

Aggregations

EVT_HANDLE (com.sun.jna.platform.win32.Winevt.EVT_HANDLE)10 IntByReference (com.sun.jna.ptr.IntByReference)7 Memory (com.sun.jna.Memory)6 File (java.io.File)4 ArrayList (java.util.ArrayList)2 BOOL (com.sun.jna.platform.win32.WinDef.BOOL)1 EVT_VARIANT (com.sun.jna.platform.win32.Winevt.EVT_VARIANT)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1