base::ScopedNativeLibrary winsta(winsta_path);
if (winsta.is_valid()) {
PWINSTATIONQUERYINFORMATIONW win_station_query_information =
- static_cast<PWINSTATIONQUERYINFORMATIONW>(
+ reinterpret_cast<PWINSTATIONQUERYINFORMATIONW>(
winsta.GetFunctionPointer("WinStationQueryInformationW"));
if (win_station_query_information) {
wchar_t name[MAX_PATH];
}
ScopedHandle process_token(temp_handle);
- if (!DuplicateTokenEx(process_token,
+ if (!DuplicateTokenEx(process_token.Get(),
desired_access,
NULL,
SecurityImpersonation,
}
// Enable the SE_TCB_NAME privilege.
- if (!AdjustTokenPrivileges(privileged_token, FALSE, &state, 0, NULL, 0)) {
+ if (!AdjustTokenPrivileges(privileged_token.Get(), FALSE, &state, 0, NULL,
+ 0)) {
PLOG(ERROR) << "Failed to enable SE_TCB_NAME privilege in a token";
return false;
}
if (!ConnectToExecutionServer(session_id, &pipe))
return false;
- if (!SendCreateProcessRequest(pipe, application_name, command_line,
+ if (!SendCreateProcessRequest(pipe.Get(), application_name, command_line,
creation_flags, desktop_name)) {
return false;
}
PROCESS_INFORMATION process_information;
- if (!ReceiveCreateProcessResponse(pipe, &process_information))
+ if (!ReceiveCreateProcessResponse(pipe.Get(), &process_information))
return false;
if (!ProcessCreateProcessResponse(creation_flags, &process_information)) {
if (!CreatePrivilegedToken(&privileged_token)) {
return false;
}
- if (!ImpersonateLoggedOnUser(privileged_token)) {
+ if (!ImpersonateLoggedOnUser(privileged_token.Get())) {
PLOG(ERROR) << "Failed to impersonate the privileged token";
return false;
}
// Change the session ID of the token.
DWORD new_session_id = session_id;
- if (!SetTokenInformation(session_token,
+ if (!SetTokenInformation(session_token.Get(),
TokenSessionId,
&new_session_id,
sizeof(new_session_id))) {