Skip to content

Commit 1a438b4

Browse files
committed
query: subscribe: Handle rpc login flag on session
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent c5a1c15 commit 1a438b4

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

ext/winevt/winevt_c.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ VALUE wstr_to_rb_str(UINT cp, const WCHAR* wstr, int clen);
4040
void raise_system_error(VALUE error, DWORD errorCode);
4141
VALUE render_to_rb_str(EVT_HANDLE handle, DWORD flags);
4242
EVT_HANDLE connect_to_remote(LPWSTR computerName, LPWSTR domain,
43-
LPWSTR username, LPWSTR password);
43+
LPWSTR username, LPWSTR password,
44+
EVT_RPC_LOGIN_FLAGS flags);
4445
WCHAR* get_description(EVT_HANDLE handle, LANGID langID, EVT_HANDLE hRemote);
4546
VALUE get_values(EVT_HANDLE handle);
4647
VALUE render_system_event(EVT_HANDLE handle, BOOL preserve_qualifiers);

ext/winevt/winevt_query.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ rb_winevt_query_initialize(VALUE argc, VALUE* argv, VALUE self)
8989
hRemoteHandle = connect_to_remote(winevtSession->server,
9090
winevtSession->domain,
9191
winevtSession->username,
92-
winevtSession->password);
92+
winevtSession->password,
93+
winevtSession->flags);
9394

9495
err = GetLastError();
9596
if (err != ERROR_SUCCESS) {

ext/winevt/winevt_subscribe.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ rb_winevt_subscribe_subscribe(int argc, VALUE* argv, VALUE self)
190190
hRemoteHandle = connect_to_remote(winevtSession->server,
191191
winevtSession->domain,
192192
winevtSession->username,
193-
winevtSession->password);
193+
winevtSession->password,
194+
winevtSession->flags);
194195

195196
err = GetLastError();
196197
if (err != ERROR_SUCCESS) {

ext/winevt/winevt_utils.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ render_to_rb_str(EVT_HANDLE handle, DWORD flags)
7777
}
7878

7979
EVT_HANDLE
80-
connect_to_remote(LPWSTR computerName, LPWSTR domain, LPWSTR username, LPWSTR password)
80+
connect_to_remote(LPWSTR computerName, LPWSTR domain, LPWSTR username, LPWSTR password,
81+
EVT_RPC_LOGIN_FLAGS flags)
8182
{
8283
EVT_HANDLE hRemote = NULL;
8384
EVT_RPC_LOGIN Credentials;
@@ -88,7 +89,7 @@ connect_to_remote(LPWSTR computerName, LPWSTR domain, LPWSTR username, LPWSTR pa
8889
Credentials.Domain = domain;
8990
Credentials.User = username;
9091
Credentials.Password = password;
91-
Credentials.Flags = EvtRpcLoginAuthDefault;
92+
Credentials.Flags = flags;
9293

9394
hRemote = EvtOpenSession(EvtRpcLogin, &Credentials, 0, 0);
9495

0 commit comments

Comments
 (0)