34 IN size_t cbBufferSize)
52 LogFile->cbBufferSize = cbBufferSize;
94 LogFile->cbBufferSize,
146 LPCWSTR lpszWinSta =
L"Test-WinSta";
149 WCHAR szBuffer[2048];
151 bIsItOk =
InitLog(&LogFile,
L"test_winsta.log", szBuffer,
sizeof(szBuffer));
167 WriteToLogPuts(&LogFile,
L"\r\nHandle is NULL, cannot proceed further, stopping the test!\r\n\r\n");
171 WriteToLogPrintf(&LogFile,
L"Enumerate desktops on Window Station '%s' (0x%p) (before process attach)\r\n", lpszWinSta, hWinSta);
176 WriteToLogPrintf(&LogFile,
L"Setting current process to Window Station '%s' (0x%p)\r\n", lpszWinSta, hWinSta);
181 WriteToLogPrintf(&LogFile,
L"Enumerate desktops on Window Station '%s' (0x%p) (after process attach, before allocating console)\r\n", lpszWinSta, hWinSta);
186 WriteToLogPrintf(&LogFile,
L"Allocating a new console on Window Station '%s' (0x%p)\r\n", lpszWinSta, hWinSta);
191 WriteToLogPrintf(&LogFile,
L"Enumerate desktops on Window Station '%s' (0x%p) (after allocating console)\r\n", lpszWinSta, hWinSta);
196 WriteToLogPrintf(&LogFile,
L"Now closing Window Station '%s' (0x%p)\r\n", lpszWinSta, hWinSta);
BOOL WINAPI AllocConsole(VOID)
#define INVALID_HANDLE_VALUE
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define UNREFERENCED_PARAMETER(P)
_Must_inspect_result_ _In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_opt_ PUNICODE_STRING LogFileName
STRSAFEAPI StringCbVPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat, va_list argList)
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
BOOL WriteToLogPrintfV(IN PLOG_FILE LogFile, IN LPCWSTR Format, IN va_list args)
BOOL CALLBACK EnumDesktopProc(IN LPWSTR lpszDesktop, IN LPARAM lParam)
BOOL WriteToLogPrintf(IN PLOG_FILE LogFile, IN LPCWSTR Format,...)
BOOL WriteToLogPuts(IN PLOG_FILE LogFile, IN LPCWSTR String)
struct _LOG_FILE * PLOG_FILE
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
BOOL WriteToLog(IN PLOG_FILE LogFile, IN LPCVOID Buffer, IN DWORD dwBufferSize)
VOID CloseLog(IN PLOG_FILE LogFile)
struct _LOG_FILE LOG_FILE
DWORD WINAPI GetLastError(void)
HWINSTA WINAPI CreateWindowStationW(_In_opt_ LPCWSTR lpwinsta, _In_ DWORD dwFlags, _In_ ACCESS_MASK dwDesiredAccess, _In_opt_ LPSECURITY_ATTRIBUTES lpsa)
#define DialogBoxW(i, t, p, f)
BOOL WINAPI CloseWindowStation(_In_ HWINSTA)
BOOL WINAPI SetProcessWindowStation(_In_ HWINSTA)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
BOOL WINAPI EnumDesktopsW(_In_opt_ HWINSTA, _In_ DESKTOPENUMPROCW, _In_ LPARAM)
#define WINSTA_ALL_ACCESS
#define MAKEINTRESOURCEW(i)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)