OpenWindowStation function user32

Win32Result<HWINSTA> OpenWindowStation(
  1. PCWSTR lpszWinSta,
  2. bool fInherit,
  3. int dwDesiredAccess
)

Opens the specified window station.

To learn more, see learn.microsoft.com/windows/win32/api/winuser/nf-winuser-openwindowstationw.

Implementation

Win32Result<HWINSTA> OpenWindowStation(
  PCWSTR lpszWinSta,
  bool fInherit,
  int dwDesiredAccess,
) {
  final result_ = OpenWindowStationW_Wrapper(
    lpszWinSta,
    fInherit ? TRUE : FALSE,
    dwDesiredAccess,
  );
  return .new(value: .new(result_.value.ptr), error: result_.error);
}