ReactOS  0.4.15-dev-1152-g6c94e4f
mainwnd.c File Reference
#include <precomp.h>
#include <io.h>
Include dependency graph for mainwnd.c:

Go to the source code of this file.

Macros

#define BUFSIZE   4096
 

Typedefs

typedef int(_cdecl * RUNTEST) (char **)
 

Functions

DWORD WINAPI PipeReadThread (LPVOID lpParam)
 
DWORD WINAPI CreateClientProcess (PMAIN_WND_INFO pInfo)
 
static BOOL OnInitMainDialog (HWND hDlg, LPARAM lParam)
 
static VOID RunSelectedTest (PMAIN_WND_INFO pInfo)
 
static VOID AddTestToCombo (PMAIN_WND_INFO pInfo)
 
static VOID FreeTestCmdStrings (PMAIN_WND_INFO pInfo)
 
static BOOL CALLBACK MainDlgProc (HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam)
 
INT WINAPI wWinMain (HINSTANCE hInst, HINSTANCE hPrev, LPWSTR Cmd, int iCmd)
 

Variables

HINSTANCE hInstance
 
WCHAR szPipeName [] = L"\\\\.\\pipe\\winetest_pipe"
 

Macro Definition Documentation

◆ BUFSIZE

#define BUFSIZE   4096

Definition at line 13 of file mainwnd.c.

Typedef Documentation

◆ RUNTEST

typedef int(_cdecl * RUNTEST) (char **)

Definition at line 19 of file mainwnd.c.

Function Documentation

◆ AddTestToCombo()

static VOID AddTestToCombo ( PMAIN_WND_INFO  pInfo)
static

Definition at line 231 of file mainwnd.c.

232 {
233  HWND hRunCmd;
234  LPWSTR lpExePath;
235  INT len;
236 
237  hRunCmd = GetDlgItem(pInfo->hMainWnd, IDC_TESTSELECTION);
238  if (hRunCmd)
239  {
240  SendMessageW(hRunCmd,
242  0,
243  (LPARAM)pInfo->SelectedTest.szName);
244 
245  len = (wcslen(pInfo->SelectedTest.szRunCmd) + 1) * sizeof(WCHAR);
246  lpExePath = HeapAlloc(GetProcessHeap(), 0, len);
247  if (lpExePath)
248  {
249  wcsncpy(lpExePath,
250  pInfo->SelectedTest.szRunCmd,
251  len / sizeof(WCHAR));
252  }
253 
254  SendMessageW(hRunCmd,
256  0,
257  (LPARAM)lpExePath);
258  SendMessageW(hRunCmd,
259  CB_SETCURSEL,
260  0,
261  0);
262  }
263 }
#define CB_SETITEMDATA
Definition: winuser.h:1948
WCHAR szName[MAX_NAME]
Definition: precomp.h:17
#define IDC_TESTSELECTION
Definition: resource.h:12
int32_t INT
Definition: typedefs.h:58
#define CB_INSERTSTRING
Definition: winuser.h:1939
WCHAR szRunCmd[MAX_RUN_CMD]
Definition: precomp.h:18
LONG_PTR LPARAM
Definition: windef.h:208
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
TEST_ITEM SelectedTest
Definition: precomp.h:40
GLenum GLsizei len
Definition: glext.h:6722
#define CB_SETCURSEL
Definition: winuser.h:1943
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND hMainWnd
Definition: precomp.h:50
WCHAR * LPWSTR
Definition: xmlstorage.h:184
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by MainDlgProc().

◆ CreateClientProcess()

DWORD WINAPI CreateClientProcess ( PMAIN_WND_INFO  pInfo)

Definition at line 67 of file mainwnd.c.

68 {
70  STARTUPINFO si;
73 
74  //
75  // Set up the security attributes
76  //
77  sa.nLength= sizeof(SECURITY_ATTRIBUTES);
78  sa.lpSecurityDescriptor = NULL;
79  sa.bInheritHandle = TRUE;
80 
81  //
82  // Create a pipe for the child process's STDOUT
83  //
84  if (!CreatePipe(&pInfo->hStdOutRd,
85  &pInfo->hStdOutWr,
86  &sa,
87  0))
88  {
89  return FALSE;
90  }
91 
92  //
93  // Ensure the read handle to the pipe for STDOUT is not inherited
94  //
95  if (!SetHandleInformation(pInfo->hStdOutRd,
97  0))
98  {
99  return FALSE;
100  }
101 
102  ZeroMemory(&si, sizeof(STARTUPINFO));
103  si.cb = sizeof(STARTUPINFO);
104  si.hStdError = pInfo->hStdOutWr;
105  si.hStdOutput = pInfo->hStdOutWr;
108 
109  ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
110 
112  NULL,
113  NULL,
114  NULL,
115  TRUE,
116  0,//CREATE_SUSPENDED,
117  NULL,
118  NULL,
119  &si,
120  &pi);
121  if (bSuccess)
122  {
123  //
124  // Create thread to handle pipe input from child processes
125  //
126  pInfo->hPipeThread = CreateThread(NULL,
127  0,
129  pInfo,
130  0,
131  NULL);
132 
133  WaitForSingleObject(pi.hProcess, INFINITE);
134 
135  CloseHandle(pi.hProcess);
136  CloseHandle(pi.hThread);
137  }
138 
139  return bSuccess;
140 }
HANDLE hStdOutRd
Definition: precomp.h:29
#define CloseHandle
Definition: compat.h:487
#define TRUE
Definition: types.h:120
#define ZeroMemory
Definition: winbase.h:1648
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
Definition: console.c:200
DWORD WINAPI PipeReadThread(LPVOID lpParam)
Definition: mainwnd.c:22
DWORD dwFlags
Definition: winbase.h:820
static BOOLEAN bSuccess
Definition: drive.cpp:419
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
#define HANDLE_FLAG_INHERIT
Definition: winbase.h:261
#define STD_INPUT_HANDLE
Definition: winbase.h:264
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4595
#define STARTF_USESTDHANDLES
Definition: winbase.h:480
LPWSTR lpCmdLine
Definition: precomp.h:31
DWORD cb
Definition: winbase.h:809
HANDLE hPipeThread
Definition: precomp.h:28
static refpint_t pi[]
Definition: server.c:96
HANDLE hStdOutput
Definition: winbase.h:825
BOOL WINAPI CreatePipe(PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES lpPipeAttributes, DWORD nSize)
Definition: npipe.c:117
HANDLE hStdOutWr
Definition: precomp.h:30
STARTUPINFOA STARTUPINFO
Definition: winbase.h:3559
HANDLE hStdInput
Definition: winbase.h:824
BOOL WINAPI SetHandleInformation(IN HANDLE hObject, IN DWORD dwMask, IN DWORD dwFlags)
Definition: handle.c:78
#define INFINITE
Definition: serial.h:102
HANDLE hStdError
Definition: winbase.h:826
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES

Referenced by RunSelectedTest().

◆ FreeTestCmdStrings()

static VOID FreeTestCmdStrings ( PMAIN_WND_INFO  pInfo)
static

Definition at line 266 of file mainwnd.c.

267 {
268  HWND hRunCmd;
269  LPWSTR lpExePath;
270  INT cnt, i;
271 
272  hRunCmd = GetDlgItem(pInfo->hMainWnd, IDC_TESTSELECTION);
273 
274  cnt = SendMessageW(hRunCmd,
275  CB_GETCOUNT,
276  0,
277  0);
278  if (cnt != CB_ERR)
279  {
280  for (i = 0; i < cnt; i++)
281  {
282  lpExePath = (LPWSTR)SendMessage(hRunCmd,
284  i,
285  0);
286  if (lpExePath)
287  {
288  HeapFree(GetProcessHeap(), 0, lpExePath);
289  }
290  }
291  }
292 }
#define IDC_TESTSELECTION
Definition: resource.h:12
#define CB_GETITEMDATA
Definition: winuser.h:1932
int32_t INT
Definition: typedefs.h:58
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define CB_ERR
Definition: winuser.h:2410
#define GetProcessHeap()
Definition: compat.h:484
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND hMainWnd
Definition: precomp.h:50
#define SendMessage
Definition: winuser.h:5818
#define CB_GETCOUNT
Definition: winuser.h:1924
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:483

Referenced by MainDlgProc().

◆ MainDlgProc()

static BOOL CALLBACK MainDlgProc ( HWND  hDlg,
UINT  Message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 295 of file mainwnd.c.

299 {
300  PMAIN_WND_INFO pInfo;
301 
302  /* Get the window context */
303  pInfo = (PMAIN_WND_INFO)GetWindowLongPtr(hDlg,
304  GWLP_USERDATA);
305  if (pInfo == NULL && Message != WM_INITDIALOG)
306  {
307  goto HandleDefaultMessage;
308  }
309 
310  switch(Message)
311  {
312  case WM_INITDIALOG:
313  return OnInitMainDialog(hDlg, lParam);
314 
315  case WM_COMMAND:
316  {
317  switch(LOWORD(wParam))
318  {
319  case IDC_BROWSE:
320  {
321  INT_PTR ret;
322 
325  hDlg,
327  (LPARAM)pInfo);
328  if (ret == IDOK)
329  {
330  AddTestToCombo(pInfo);
331  }
332 
333  break;
334  }
335  case IDC_OPTIONS:
338  hDlg,
340  (LPARAM)pInfo);
341  break;
342 
343  case IDC_RUN:
344  RunSelectedTest(pInfo);
345  break;
346 
347  case IDOK:
348  EndDialog(hDlg, 0);
349  break;
350  }
351  }
352  break;
353 
354  case WM_CLOSE:
355  EndDialog(hDlg, 0);
356  break;
357 
358  case WM_DESTROY:
359  if (pInfo->hSmIcon)
360  DestroyIcon(pInfo->hSmIcon);
361  if (pInfo->hBgIcon)
362  DestroyIcon(pInfo->hBgIcon);
363 
364  FreeTestCmdStrings(pInfo);
365 
366  break;
367 
368 HandleDefaultMessage:
369  default:
370  return FALSE;
371  }
372 
373  return FALSE;
374 }
#define IDD_TESTBROWSER
Definition: resource.h:2
#define IDOK
Definition: winuser.h:824
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
HICON hSmIcon
Definition: precomp.h:34
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define IDC_BROWSE
Definition: resource.h:21
HICON hBgIcon
Definition: precomp.h:35
#define IDC_OPTIONS
static BOOL OnInitMainDialog(HWND hDlg, LPARAM lParam)
Definition: mainwnd.c:144
BOOL CALLBACK BrowseDlgProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam)
Definition: browsewnd.c:332
int32_t INT_PTR
Definition: typedefs.h:64
#define IDD_OPTIONS
Definition: resource.h:18
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define FALSE
Definition: types.h:117
#define GWLP_USERDATA
Definition: treelist.c:63
#define IDC_RUN
Definition: resource.h:21
smooth NULL
Definition: ftsmooth.c:416
static VOID RunSelectedTest(PMAIN_WND_INFO pInfo)
Definition: mainwnd.c:190
LONG_PTR LPARAM
Definition: windef.h:208
static VOID FreeTestCmdStrings(PMAIN_WND_INFO pInfo)
Definition: mainwnd.c:266
#define WM_DESTROY
Definition: winuser.h:1591
#define WM_CLOSE
Definition: winuser.h:1603
struct _MAIN_WND_INFO * PMAIN_WND_INFO
CHAR Message[80]
Definition: alive.c:5
int ret
#define WM_COMMAND
Definition: winuser.h:1722
INT_PTR(CALLBACK * DLGPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2871
static VOID AddTestToCombo(PMAIN_WND_INFO pInfo)
Definition: mainwnd.c:231
HINSTANCE hInstance
Definition: mainwnd.c:15
INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:273
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define GetWindowLongPtr
Definition: treelist.c:73
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by wWinMain().

◆ OnInitMainDialog()

static BOOL OnInitMainDialog ( HWND  hDlg,
LPARAM  lParam 
)
static

Definition at line 144 of file mainwnd.c.

146 {
147  PMAIN_WND_INFO pInfo;
148 
149  pInfo = (PMAIN_WND_INFO)lParam;
150 
151  /* Initialize the main window context */
152  pInfo->hMainWnd = hDlg;
153 
154  SetWindowLongPtr(hDlg,
156  (LONG_PTR)pInfo);
157 
158  pInfo->hSmIcon = LoadImageW(hInstance,
160  IMAGE_ICON,
161  16,
162  16,
163  0);
164  if (pInfo->hSmIcon)
165  {
166  SendMessageW(hDlg,
167  WM_SETICON,
168  ICON_SMALL,
169  (LPARAM)pInfo->hSmIcon);
170  }
171 
172  pInfo->hBgIcon = LoadImageW(hInstance,
174  IMAGE_ICON,
175  32,
176  32,
177  0);
178  if (pInfo->hBgIcon)
179  {
180  SendMessageW(hDlg,
181  WM_SETICON,
182  ICON_BIG,
183  (LPARAM)pInfo->hBgIcon);
184  }
185 
186  return TRUE;
187 }
#define IDI_ICON
Definition: resource.h:5
#define IMAGE_ICON
Definition: winuser.h:212
HICON hSmIcon
Definition: precomp.h:34
#define TRUE
Definition: types.h:120
HICON hBgIcon
Definition: precomp.h:35
#define SetWindowLongPtr
Definition: treelist.c:70
#define ICON_SMALL
Definition: tnclass.cpp:48
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
#define GWLP_USERDATA
Definition: treelist.c:63
LONG_PTR LPARAM
Definition: windef.h:208
struct _MAIN_WND_INFO * PMAIN_WND_INFO
HINSTANCE hInstance
Definition: mainwnd.c:15
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND hMainWnd
Definition: precomp.h:50
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
LPARAM lParam
Definition: combotst.c:139
#define ICON_BIG
Definition: tnclass.cpp:51

Referenced by MainDlgProc().

◆ PipeReadThread()

DWORD WINAPI PipeReadThread ( LPVOID  lpParam)

Definition at line 22 of file mainwnd.c.

23 {
24  PMAIN_WND_INFO pInfo;
25  HWND hList, hEdit;
26  DWORD dwRead;
27  CHAR chBuf[BUFSIZE];
29  LVITEMA item;
30  INT count;
31 
32  pInfo = (PMAIN_WND_INFO)lpParam;
33 
34  hList = GetDlgItem(pInfo->hMainWnd, IDC_LIST);
36 
37  ZeroMemory(&item, sizeof(LVITEMA));
38  item.mask = LVIF_TEXT;
39 
40  while (TRUE)
41  {
42  dwRead = 0;
43  bSuccess = ReadFile(pInfo->hStdOutRd,
44  chBuf,
45  BUFSIZE,
46  &dwRead,
47  NULL);
48  if(!bSuccess || dwRead == 0)
49  break;
50 
51  chBuf[dwRead] = 0;
52 
56 
57  //item.iItem = ListView_GetItemCount(hList);
58  //item.pszText = chBuf;
59  //SendMessage(hEdit, LVM_INSERTITEMA, 0, (LPARAM)&item);
60  }
61 
62  return 0;
63 }
HANDLE hStdOutRd
Definition: precomp.h:29
#define IDC_OUTPUT
Definition: resource.h:11
#define TRUE
Definition: types.h:120
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLuint GLuint GLsizei count
Definition: gl.h:1545
char CHAR
Definition: xmlstorage.h:175
#define ZeroMemory
Definition: winbase.h:1648
#define BUFSIZE
Definition: mainwnd.c:13
UINT_PTR WPARAM
Definition: windef.h:207
int32_t INT
Definition: typedefs.h:58
static BOOLEAN bSuccess
Definition: drive.cpp:419
#define LVIF_TEXT
Definition: commctrl.h:2305
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define IDC_LIST
Definition: resource.h:93
LONG_PTR LPARAM
Definition: windef.h:208
int WINAPI GetWindowTextLengthA(_In_ HWND)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define EM_SETSEL
Definition: winuser.h:2000
struct _MAIN_WND_INFO * PMAIN_WND_INFO
unsigned long DWORD
Definition: ntddk_ex.h:95
static HWND hEdit
Definition: autocomplete.c:34
HWND hList
Definition: livecd.c:10
static ATOM item
Definition: dde.c:856
HWND hMainWnd
Definition: precomp.h:50
#define ReadFile(a, b, c, d, e)
Definition: compat.h:490
#define EM_REPLACESEL
Definition: winuser.h:1988

Referenced by CreateClientProcess().

◆ RunSelectedTest()

static VOID RunSelectedTest ( PMAIN_WND_INFO  pInfo)
static

Definition at line 190 of file mainwnd.c.

191 {
192  HWND hRunCmd;
193  WCHAR szTextCmd[MAX_RUN_CMD];
194  INT sel;
195 
196  hRunCmd = GetDlgItem(pInfo->hMainWnd, IDC_TESTSELECTION);
197 
198  sel = SendMessageW(hRunCmd,
199  CB_GETCURSEL,
200  0,
201  0);
202  if (sel != CB_ERR)
203  {
204  if (SendMessageW(hRunCmd,
205  CB_GETLBTEXT,
206  sel,
207  (LPARAM)szTextCmd) != CB_ERR)
208  {
209  pInfo->lpCmdLine = (LPWSTR)SendMessage(hRunCmd,
211  0,
212  0);
213  if (pInfo->lpCmdLine)
214  {
215  //
216  // Create a new thread to create the client process
217  // and receive any ouput via stdout
218  //
220  0,
222  pInfo,
223  0,
224  NULL);
225  }
226  }
227  }
228 }
DWORD WINAPI CreateClientProcess(PMAIN_WND_INFO pInfo)
Definition: mainwnd.c:67
#define IDC_TESTSELECTION
Definition: resource.h:12
#define CB_GETLBTEXT
Definition: winuser.h:1934
#define CB_GETITEMDATA
Definition: winuser.h:1932
int32_t INT
Definition: typedefs.h:58
#define CB_GETCURSEL
Definition: winuser.h:1925
#define MAX_RUN_CMD
Definition: precomp.h:13
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_ERR
Definition: winuser.h:2410
LPWSTR lpCmdLine
Definition: precomp.h:31
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND hMainWnd
Definition: precomp.h:50
#define SendMessage
Definition: winuser.h:5818
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by MainDlgProc().

◆ wWinMain()

INT WINAPI wWinMain ( HINSTANCE  hInstance,
HINSTANCE  hPrevInstance,
LPWSTR  lpCmdLine,
int  nShowCmd 
)

This file has no copyright assigned and is placed in the Public Domain. This file is part of the w64 mingw-runtime package. No warranty is given; refer to the file DISCLAIMER.PD within this package.

Definition at line 378 of file mainwnd.c.

382 {
384  PMAIN_WND_INFO pInfo;
385  INT Ret = -1;
386 
387  UNREFERENCED_PARAMETER(hPrev);
389  UNREFERENCED_PARAMETER(iCmd);
390 
391  hInstance = hInst;
392 
393  ZeroMemory(&iccx, sizeof(INITCOMMONCONTROLSEX));
394  iccx.dwSize = sizeof(INITCOMMONCONTROLSEX);
395  iccx.dwICC = ICC_TAB_CLASSES;
396  InitCommonControlsEx(&iccx);
397 
398  pInfo = HeapAlloc(GetProcessHeap(),
399  0,
400  sizeof(MAIN_WND_INFO));
401  if (pInfo)
402  {
403  Ret = (DialogBoxParamW(hInstance,
405  NULL,
407  (LPARAM)pInfo) == IDOK);
408 
410  0,
411  pInfo);
412  }
413 
414  return Ret;
415 }
#define IDOK
Definition: winuser.h:824
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define ZeroMemory
Definition: winbase.h:1648
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
int32_t INT
Definition: typedefs.h:58
static BOOL CALLBACK MainDlgProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam)
Definition: mainwnd.c:295
#define IDD_WINETESTGUI
Definition: resource.h:1
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
Definition: sacdrv.h:277
INT_PTR(CALLBACK * DLGPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2871
HINSTANCE hInst
Definition: dxdiag.c:13
HINSTANCE hInstance
Definition: mainwnd.c:15
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define HeapFree(x, y, z)
Definition: compat.h:483
#define ICC_TAB_CLASSES
Definition: commctrl.h:61

Referenced by wmain().

Variable Documentation

◆ hInstance

◆ szPipeName

WCHAR szPipeName[] = L"\\\\.\\pipe\\winetest_pipe"

Definition at line 17 of file mainwnd.c.