wine  6.0.1
About: Wine is an Open Source implementation of the MS Windows API on top of X, OpenGL, and Unix. Think of Wine as a compatibility layer for running Windows programs.
  Fossies Dox: wine-6.0.1.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

process.c
Go to the documentation of this file.
1 /*
2  * Win32 processes
3  *
4  * Copyright 1996, 1998 Alexandre Julliard
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #include <assert.h>
22 #include <ctype.h>
23 #include <errno.h>
24 #include <signal.h>
25 #include <stdarg.h>
26 #include <stdio.h>
27 #include <time.h>
28 
29 #include "ntstatus.h"
30 #define WIN32_NO_STATUS
31 #include "winternl.h"
32 #include "winbase.h"
33 #include "winnls.h"
34 #include "wincon.h"
35 #include "kernel_private.h"
36 #include "psapi.h"
37 #include "wine/exception.h"
38 #include "wine/server.h"
39 #include "wine/asm.h"
40 #include "wine/debug.h"
41 
43 
44 typedef struct
45 {
50 } LOADPARMS32;
51 
53 
54 /* Process flags */
55 #define PDB32_DEBUGGED 0x0001 /* Process is being debugged */
56 #define PDB32_WIN16_PROC 0x0008 /* Win16 process */
57 #define PDB32_DOS_PROC 0x0010 /* Dos process */
58 #define PDB32_CONSOLE_PROC 0x0020 /* Console process */
59 #define PDB32_FILE_APIS_OEM 0x0040 /* File APIs are OEM */
60 #define PDB32_WIN32S_PROC 0x8000 /* Win32s process */
61 
62 
63 /***********************************************************************
64  * wait_input_idle
65  *
66  * Wrapper to call WaitForInputIdle USER function
67  */
68 typedef DWORD (WINAPI *WaitForInputIdle_ptr)( HANDLE hProcess, DWORD dwTimeOut );
69 
71 {
72  HMODULE mod = GetModuleHandleA( "user32.dll" );
73  if (mod)
74  {
75  WaitForInputIdle_ptr ptr = (WaitForInputIdle_ptr)GetProcAddress( mod, "WaitForInputIdle" );
76  if (ptr) return ptr( process, timeout );
77  }
78  return 0;
79 }
80 
81 
82 /***********************************************************************
83  * WinExec (KERNEL32.@)
84  */
86 {
88  STARTUPINFOA startup;
89  char *cmdline;
90  UINT ret;
91 
92  memset( &startup, 0, sizeof(startup) );
93  startup.cb = sizeof(startup);
94  startup.dwFlags = STARTF_USESHOWWINDOW;
95  startup.wShowWindow = nCmdShow;
96 
97  /* cmdline needs to be writable for CreateProcess */
98  if (!(cmdline = HeapAlloc( GetProcessHeap(), 0, strlen(lpCmdLine)+1 ))) return 0;
99  strcpy( cmdline, lpCmdLine );
100 
102  0, NULL, NULL, &startup, &info ))
103  {
104  /* Give 30 seconds to the app to come up */
105  if (wait_input_idle( info.hProcess, 30000 ) == WAIT_FAILED)
106  WARN("WaitForInputIdle failed: Error %d\n", GetLastError() );
107  ret = 33;
108  /* Close off the handles */
109  CloseHandle( info.hThread );
110  CloseHandle( info.hProcess );
111  }
112  else if ((ret = GetLastError()) >= 32)
113  {
114  FIXME("Strange error set by CreateProcess: %d\n", ret );
115  ret = 11;
116  }
118  return ret;
119 }
120 
121 
122 /**********************************************************************
123  * LoadModule (KERNEL32.@)
124  */
126 {
127  LOADPARMS32 *params = paramBlock;
129  STARTUPINFOA startup;
130  DWORD ret;
131  LPSTR cmdline, p;
132  char filename[MAX_PATH];
133  BYTE len;
134 
135  if (!name) return ERROR_FILE_NOT_FOUND;
136 
137  if (!SearchPathA( NULL, name, ".exe", sizeof(filename), filename, NULL ) &&
138  !SearchPathA( NULL, name, NULL, sizeof(filename), filename, NULL ))
139  return GetLastError();
140 
141  len = (BYTE)params->lpCmdLine[0];
142  if (!(cmdline = HeapAlloc( GetProcessHeap(), 0, strlen(filename) + len + 2 )))
144 
145  strcpy( cmdline, filename );
146  p = cmdline + strlen(cmdline);
147  *p++ = ' ';
148  memcpy( p, params->lpCmdLine + 1, len );
149  p[len] = 0;
150 
151  memset( &startup, 0, sizeof(startup) );
152  startup.cb = sizeof(startup);
153  if (params->lpCmdShow)
154  {
155  startup.dwFlags = STARTF_USESHOWWINDOW;
156  startup.wShowWindow = ((WORD *)params->lpCmdShow)[1];
157  }
158 
160  params->lpEnvAddress, NULL, &startup, &info ))
161  {
162  /* Give 30 seconds to the app to come up */
163  if (wait_input_idle( info.hProcess, 30000 ) == WAIT_FAILED)
164  WARN("WaitForInputIdle failed: Error %d\n", GetLastError() );
165  ret = 33;
166  /* Close off the handles */
167  CloseHandle( info.hThread );
168  CloseHandle( info.hProcess );
169  }
170  else if ((ret = GetLastError()) >= 32)
171  {
172  FIXME("Strange error set by CreateProcess: %u\n", ret );
173  ret = 11;
174  }
175 
177  return ret;
178 }
179 
180 
181 /***********************************************************************
182  * ExitProcess (KERNEL32.@)
183  *
184  * Exits the current process.
185  *
186  * PARAMS
187  * status [I] Status code to exit with.
188  *
189  * RETURNS
190  * Nothing.
191  */
192 #ifdef __i386__
193 __ASM_STDCALL_FUNC( ExitProcess, 4, /* Shrinker depend on this particular ExitProcess implementation */
194  "pushl %ebp\n\t"
195  ".byte 0x8B, 0xEC\n\t" /* movl %esp, %ebp */
196  ".byte 0x6A, 0x00\n\t" /* pushl $0 */
197  ".byte 0x68, 0x00, 0x00, 0x00, 0x00\n\t" /* pushl $0 - 4 bytes immediate */
198  "pushl 8(%ebp)\n\t"
199  "call " __ASM_STDCALL("RtlExitUserProcess",4) "\n\t"
200  "leave\n\t"
201  "ret $4" )
202 #else
203 
205 {
207 }
208 
209 #endif
210 
211 /***********************************************************************
212  * GetExitCodeProcess [KERNEL32.@]
213  *
214  * Gets termination status of specified process.
215  *
216  * PARAMS
217  * hProcess [in] Handle to the process.
218  * lpExitCode [out] Address to receive termination status.
219  *
220  * RETURNS
221  * Success: TRUE
222  * Failure: FALSE
223  */
224 BOOL WINAPI GetExitCodeProcess( HANDLE hProcess, LPDWORD lpExitCode )
225 {
227 
228  if (!set_ntstatus( NtQueryInformationProcess( hProcess, ProcessBasicInformation, &pbi, sizeof(pbi), NULL )))
229  return FALSE;
230  if (lpExitCode) *lpExitCode = pbi.ExitStatus;
231  return TRUE;
232 }
233 
234 
235 /**************************************************************************
236  * FatalExit (KERNEL32.@)
237  */
238 void WINAPI FatalExit( int code )
239 {
240  WARN( "FatalExit\n" );
241  ExitProcess( code );
242 }
243 
244 
245 /***********************************************************************
246  * GetProcessFlags (KERNEL32.@)
247  */
249 {
251  DWORD flags = 0;
252 
253  if (processid && processid != GetCurrentProcessId()) return 0;
254 
255  if ((nt = RtlImageNtHeader( NtCurrentTeb()->Peb->ImageBaseAddress )))
256  {
259  }
262  return flags;
263 }
264 
265 
266 /***********************************************************************
267  * ConvertToGlobalHandle (KERNEL32.@)
268  */
270 {
274  return ret;
275 }
276 
277 
278 /***********************************************************************
279  * SetHandleContext (KERNEL32.@)
280  */
282 {
283  FIXME("(%p,%d), stub. In case this got called by WSOCK32/WS2_32: "
284  "the external WINSOCK DLLs won't work with WINE, don't use them.\n",hnd,context);
286  return FALSE;
287 }
288 
289 
290 /***********************************************************************
291  * GetHandleContext (KERNEL32.@)
292  */
294 {
295  FIXME("(%p), stub. In case this got called by WSOCK32/WS2_32: "
296  "the external WINSOCK DLLs won't work with WINE, don't use them.\n",hnd);
298  return 0;
299 }
300 
301 
302 /***********************************************************************
303  * CreateSocketHandle (KERNEL32.@)
304  */
306 {
307  FIXME("(), stub. In case this got called by WSOCK32/WS2_32: "
308  "the external WINSOCK DLLs won't work with WINE, don't use them.\n");
310  return INVALID_HANDLE_VALUE;
311 }
312 
313 
314 /***********************************************************************
315  * SetProcessAffinityMask (KERNEL32.@)
316  */
318 {
320  &affmask, sizeof(DWORD_PTR) ));
321 }
322 
323 
324 /**********************************************************************
325  * GetProcessAffinityMask (KERNEL32.@)
326  */
327 BOOL WINAPI GetProcessAffinityMask( HANDLE hProcess, PDWORD_PTR process_mask, PDWORD_PTR system_mask )
328 {
329  if (process_mask)
330  {
332  process_mask, sizeof(*process_mask), NULL )))
333  return FALSE;
334  }
335  if (system_mask)
336  {
338 
340  return FALSE;
341  *system_mask = info.ActiveProcessorsAffinityMask;
342  }
343  return TRUE;
344 }
345 
346 
347 /***********************************************************************
348  * SetProcessWorkingSetSize [KERNEL32.@]
349  * Sets the min/max working set sizes for a specified process.
350  *
351  * PARAMS
352  * process [I] Handle to the process of interest
353  * minset [I] Specifies minimum working set size
354  * maxset [I] Specifies maximum working set size
355  *
356  * RETURNS
357  * Success: TRUE
358  * Failure: FALSE
359  */
361 {
362  return SetProcessWorkingSetSizeEx(process, minset, maxset, 0);
363 }
364 
365 /***********************************************************************
366  * GetProcessWorkingSetSize (KERNEL32.@)
367  */
369 {
370  return GetProcessWorkingSetSizeEx(process, minset, maxset, NULL);
371 }
372 
373 
374 /******************************************************************
375  * GetProcessIoCounters (KERNEL32.@)
376  */
378 {
379  return set_ntstatus( NtQueryInformationProcess(hProcess, ProcessIoCounters, ioc, sizeof(*ioc), NULL ));
380 }
381 
382 /***********************************************************************
383  * RegisterServiceProcess (KERNEL32.@)
384  *
385  * A service process calls this function to ensure that it continues to run
386  * even after a user logged off.
387  */
389 {
390  /* I don't think that Wine needs to do anything in this function */
391  return 1; /* success */
392 }
393 
394 
395 /***********************************************************************
396  * GetCurrentProcess (KERNEL32.@)
397  *
398  * Get a handle to the current process.
399  *
400  * PARAMS
401  * None.
402  *
403  * RETURNS
404  * A handle representing the current process.
405  */
407 {
408  return (HANDLE)~(ULONG_PTR)0;
409 }
410 
411 
412 /***********************************************************************
413  * CreateActCtxA (KERNEL32.@)
414  */
416 {
417  ACTCTXW actw;
418  SIZE_T len;
420  LPWSTR src = NULL, assdir = NULL, resname = NULL, appname = NULL;
421 
422  TRACE("%p %08x\n", actctx, actctx ? actctx->dwFlags : 0);
423 
424  if (!actctx || actctx->cbSize != sizeof(*actctx))
425  {
427  return INVALID_HANDLE_VALUE;
428  }
429 
430  actw.cbSize = sizeof(actw);
431  actw.dwFlags = actctx->dwFlags;
432  if (actctx->lpSource)
433  {
434  len = MultiByteToWideChar(CP_ACP, 0, actctx->lpSource, -1, NULL, 0);
435  src = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
436  if (!src) return INVALID_HANDLE_VALUE;
437  MultiByteToWideChar(CP_ACP, 0, actctx->lpSource, -1, src, len);
438  }
439  actw.lpSource = src;
440 
444  actw.wLangId = actctx->wLangId;
446  {
447  len = MultiByteToWideChar(CP_ACP, 0, actctx->lpAssemblyDirectory, -1, NULL, 0);
448  assdir = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
449  if (!assdir) goto done;
450  MultiByteToWideChar(CP_ACP, 0, actctx->lpAssemblyDirectory, -1, assdir, len);
451  actw.lpAssemblyDirectory = assdir;
452  }
454  {
455  if ((ULONG_PTR)actctx->lpResourceName >> 16)
456  {
457  len = MultiByteToWideChar(CP_ACP, 0, actctx->lpResourceName, -1, NULL, 0);
458  resname = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
459  if (!resname) goto done;
460  MultiByteToWideChar(CP_ACP, 0, actctx->lpResourceName, -1, resname, len);
461  actw.lpResourceName = resname;
462  }
463  else actw.lpResourceName = (LPCWSTR)actctx->lpResourceName;
464  }
466  {
467  len = MultiByteToWideChar(CP_ACP, 0, actctx->lpApplicationName, -1, NULL, 0);
468  appname = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
469  if (!appname) goto done;
470  MultiByteToWideChar(CP_ACP, 0, actctx->lpApplicationName, -1, appname, len);
471  actw.lpApplicationName = appname;
472  }
474  actw.hModule = actctx->hModule;
475 
476  ret = CreateActCtxW(&actw);
477 
478 done:
479  HeapFree(GetProcessHeap(), 0, src);
480  HeapFree(GetProcessHeap(), 0, assdir);
481  HeapFree(GetProcessHeap(), 0, resname);
482  HeapFree(GetProcessHeap(), 0, appname);
483  return ret;
484 }
485 
486 /***********************************************************************
487  * FindActCtxSectionStringA (KERNEL32.@)
488  */
491 {
492  LPWSTR searchW;
493  DWORD len;
494  BOOL ret;
495 
496  TRACE("%08x %s %u %s %p\n", flags, debugstr_guid(guid), id, debugstr_a(search), info);
497 
498  if (!search || !info)
499  {
501  return FALSE;
502  }
503  len = MultiByteToWideChar(CP_ACP, 0, search, -1, NULL, 0);
504  searchW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
505  MultiByteToWideChar(CP_ACP, 0, search, -1, searchW, len);
506  ret = FindActCtxSectionStringW( flags, guid, id, searchW, info );
507  HeapFree(GetProcessHeap(), 0, searchW);
508  return ret;
509 }
510 
511 
512 /***********************************************************************
513  * CmdBatNotification (KERNEL32.@)
514  *
515  * Notifies the system that a batch file has started or finished.
516  *
517  * PARAMS
518  * bBatchRunning [I] TRUE if a batch file has started or
519  * FALSE if a batch file has finished executing.
520  *
521  * RETURNS
522  * Unknown.
523  */
525 {
526  FIXME("%d\n", bBatchRunning);
527  return FALSE;
528 }
529 
530 /***********************************************************************
531  * RegisterApplicationRestart (KERNEL32.@)
532  */
534 {
535  FIXME("(%s,%d)\n", debugstr_w(pwzCommandLine), dwFlags);
536 
537  return S_OK;
538 }
539 
540 /**********************************************************************
541  * WTSGetActiveConsoleSessionId (KERNEL32.@)
542  */
544 {
545  static int once;
546  if (!once++) FIXME("stub\n");
547  /* Return current session id. */
548  return NtCurrentTeb()->Peb->SessionId;
549 }
550 
551 /**********************************************************************
552  * GetSystemDEPPolicy (KERNEL32.@)
553  */
555 {
556  FIXME("stub\n");
557  return OptIn;
558 }
559 
560 /**********************************************************************
561  * SetProcessDEPPolicy (KERNEL32.@)
562  */
564 {
565  FIXME("(%d): stub\n", newDEP);
567  return FALSE;
568 }
569 
570 /**********************************************************************
571  * ApplicationRecoveryFinished (KERNEL32.@)
572  */
574 {
575  FIXME(": stub\n");
577 }
578 
579 /**********************************************************************
580  * ApplicationRecoveryInProgress (KERNEL32.@)
581  */
583 {
584  FIXME(":%p stub\n", canceled);
586  return E_FAIL;
587 }
588 
589 /**********************************************************************
590  * RegisterApplicationRecoveryCallback (KERNEL32.@)
591  */
593 {
594  FIXME("%p, %p, %d, %d: stub, faking success\n", callback, param, pingint, flags);
595  return S_OK;
596 }
597 
598 /***********************************************************************
599  * GetActiveProcessorGroupCount (KERNEL32.@)
600  */
602 {
603  FIXME("semi-stub, always returning 1\n");
604  return 1;
605 }
606 
607 /***********************************************************************
608  * GetActiveProcessorCount (KERNEL32.@)
609  */
611 {
613 
614  FIXME("semi-stub, returning %u\n", cpus);
615  return cpus;
616 }
617 
618 /***********************************************************************
619  * GetMaximumProcessorCount (KERNEL32.@)
620  */
622 {
624 
625  FIXME("semi-stub, returning %u\n", cpus);
626  return cpus;
627 }
628 
629 /***********************************************************************
630  * GetFirmwareEnvironmentVariableA (KERNEL32.@)
631  */
633 {
634  FIXME("stub: %s %s %p %u\n", debugstr_a(name), debugstr_a(guid), buffer, size);
636  return 0;
637 }
638 
639 /***********************************************************************
640  * GetFirmwareEnvironmentVariableW (KERNEL32.@)
641  */
643 {
644  FIXME("stub: %s %s %p %u\n", debugstr_w(name), debugstr_w(guid), buffer, size);
646  return 0;
647 }
648 
649 /***********************************************************************
650  * SetFirmwareEnvironmentVariableW (KERNEL32.@)
651  */
653 {
654  FIXME("stub: %s %s %p %u\n", debugstr_w(name), debugstr_w(guid), buffer, size);
656  return FALSE;
657 }
658 
659 /**********************************************************************
660  * GetNumaNodeProcessorMask (KERNEL32.@)
661  */
663 {
664  FIXME("(%c %p): stub\n", node, mask);
666  return FALSE;
667 }
668 
669 /**********************************************************************
670  * GetNumaAvailableMemoryNode (KERNEL32.@)
671  */
673 {
674  FIXME("(%c %p): stub\n", node, available_bytes);
676  return FALSE;
677 }
678 
679 /**********************************************************************
680  * GetNumaAvailableMemoryNodeEx (KERNEL32.@)
681  */
683 {
684  FIXME("(%hu %p): stub\n", node, available_bytes);
686  return FALSE;
687 }
688 
689 /***********************************************************************
690  * GetNumaProcessorNode (KERNEL32.@)
691  */
693 {
694  TRACE("(%d, %p)\n", processor, node);
695 
697  {
698  *node = 0;
699  return TRUE;
700  }
701 
702  *node = 0xFF;
704  return FALSE;
705 }
706 
707 /***********************************************************************
708  * GetNumaProcessorNodeEx (KERNEL32.@)
709  */
711 {
713  return FALSE;
714 }
715 
716 /***********************************************************************
717  * GetNumaProximityNode (KERNEL32.@)
718  */
719 BOOL WINAPI GetNumaProximityNode(ULONG proximity_id, PUCHAR node_number)
720 {
722  return FALSE;
723 }
724 
725 /**********************************************************************
726  * GetProcessDEPPolicy (KERNEL32.@)
727  */
729 {
730  ULONG dep_flags;
731 
732  TRACE("(%p %p %p)\n", process, flags, permanent);
733 
735  &dep_flags, sizeof(dep_flags), NULL )))
736  return FALSE;
737 
738  if (flags)
739  {
740  *flags = 0;
741  if (dep_flags & MEM_EXECUTE_OPTION_DISABLE)
745  }
746 
747  if (permanent) *permanent = (dep_flags & MEM_EXECUTE_OPTION_PERMANENT) != 0;
748  return TRUE;
749 }
750 
751 /***********************************************************************
752  * UnregisterApplicationRestart (KERNEL32.@)
753  */
755 {
756  FIXME(": stub\n");
758  return S_OK;
759 }
760 
761 /***********************************************************************
762  * CreateUmsCompletionList (KERNEL32.@)
763  */
765 {
766  FIXME( "%p: stub\n", list );
768  return FALSE;
769 }
770 
771 /***********************************************************************
772  * CreateUmsThreadContext (KERNEL32.@)
773  */
775 {
776  FIXME( "%p: stub\n", ctx );
778  return FALSE;
779 }
780 
781 /***********************************************************************
782  * DeleteUmsCompletionList (KERNEL32.@)
783  */
785 {
786  FIXME( "%p: stub\n", list );
788  return FALSE;
789 }
790 
791 /***********************************************************************
792  * DeleteUmsThreadContext (KERNEL32.@)
793  */
795 {
796  FIXME( "%p: stub\n", ctx );
798  return FALSE;
799 }
800 
801 /***********************************************************************
802  * DequeueUmsCompletionListItems (KERNEL32.@)
803  */
805 {
806  FIXME( "%p,%08x,%p: stub\n", list, timeout, ctx );
808  return FALSE;
809 }
810 
811 /***********************************************************************
812  * EnterUmsSchedulingMode (KERNEL32.@)
813  */
815 {
816  FIXME( "%p: stub\n", info );
818  return FALSE;
819 }
820 
821 /***********************************************************************
822  * ExecuteUmsThread (KERNEL32.@)
823  */
825 {
826  FIXME( "%p: stub\n", ctx );
828  return FALSE;
829 }
830 
831 /***********************************************************************
832  * GetCurrentUmsThread (KERNEL32.@)
833  */
835 {
836  FIXME( "stub\n" );
838  return FALSE;
839 }
840 
841 /***********************************************************************
842  * GetNextUmsListItem (KERNEL32.@)
843  */
845 {
846  FIXME( "%p: stub\n", ctx );
848  return NULL;
849 }
850 
851 /***********************************************************************
852  * GetUmsCompletionListEvent (KERNEL32.@)
853  */
855 {
856  FIXME( "%p,%p: stub\n", list, event );
858  return FALSE;
859 }
860 
861 /***********************************************************************
862  * QueryUmsThreadInformation (KERNEL32.@)
863  */
865  void *buf, ULONG length, ULONG *ret_length)
866 {
867  FIXME( "%p,%08x,%p,%08x,%p: stub\n", ctx, class, buf, length, ret_length );
869  return FALSE;
870 }
871 
872 /***********************************************************************
873  * SetUmsThreadInformation (KERNEL32.@)
874  */
876  void *buf, ULONG length)
877 {
878  FIXME( "%p,%08x,%p,%08x: stub\n", ctx, class, buf, length );
880  return FALSE;
881 }
882 
883 /***********************************************************************
884  * UmsThreadYield (KERNEL32.@)
885  */
887 {
888  FIXME( "%p: stub\n", param );
890  return FALSE;
891 }
#define __ASM_STDCALL_FUNC(name, args, code)
Definition: asm.h:91
#define __ASM_STDCALL(name, args)
Definition: asm.h:34
ULONG_PTR DWORD_PTR
Definition: basetsd.h:131
ULONG_PTR * PDWORD_PTR
Definition: basetsd.h:131
unsigned long ULONG_PTR
Definition: basetsd.h:130
ULONG_PTR SIZE_T
Definition: basetsd.h:264
#define WINAPI
Definition: bcrypt.h:23
DWORD mask
Definition: fontdlg.c:120
DEP_SYSTEM_POLICY_TYPE GetSystemDEPPolicy(void)
Definition: process.c:554
BOOL GetNumaAvailableMemoryNode(UCHAR node, PULONGLONG available_bytes)
Definition: process.c:672
BOOL GetProcessAffinityMask(HANDLE hProcess, PDWORD_PTR process_mask, PDWORD_PTR system_mask)
Definition: process.c:327
void ApplicationRecoveryFinished(BOOL success)
Definition: process.c:573
BOOL GetNumaProcessorNodeEx(PPROCESSOR_NUMBER processor, PUSHORT node_number)
Definition: process.c:710
DWORD GetHandleContext(HANDLE hnd)
Definition: process.c:293
PUMS_CONTEXT GetNextUmsListItem(PUMS_CONTEXT ctx)
Definition: process.c:844
BOOL UmsThreadYield(void *param)
Definition: process.c:886
BOOL DeleteUmsThreadContext(PUMS_CONTEXT ctx)
Definition: process.c:794
BOOL CreateUmsThreadContext(PUMS_CONTEXT *ctx)
Definition: process.c:774
static DWORD wait_input_idle(HANDLE process, DWORD timeout)
Definition: process.c:70
BOOL GetProcessDEPPolicy(HANDLE process, LPDWORD flags, PBOOL permanent)
Definition: process.c:728
WORD GetActiveProcessorGroupCount(void)
Definition: process.c:601
BOOL GetNumaProcessorNode(UCHAR processor, PUCHAR node)
Definition: process.c:692
#define PDB32_CONSOLE_PROC
Definition: process.c:58
BOOL EnterUmsSchedulingMode(UMS_SCHEDULER_STARTUP_INFO *info)
Definition: process.c:814
HRESULT UnregisterApplicationRestart(void)
Definition: process.c:754
HANDLE CreateSocketHandle(void)
Definition: process.c:305
BOOL DeleteUmsCompletionList(PUMS_COMPLETION_LIST list)
Definition: process.c:784
#define PDB32_FILE_APIS_OEM
Definition: process.c:59
DWORD WTSGetActiveConsoleSessionId(void)
Definition: process.c:543
BOOL GetNumaNodeProcessorMask(UCHAR node, PULONGLONG mask)
Definition: process.c:662
BOOL GetUmsCompletionListEvent(PUMS_COMPLETION_LIST list, HANDLE *event)
Definition: process.c:854
BOOL ExecuteUmsThread(PUMS_CONTEXT ctx)
Definition: process.c:824
HANDLE KERNEL32_GetCurrentProcess(void)
Definition: process.c:406
BOOL CmdBatNotification(BOOL bBatchRunning)
Definition: process.c:524
HRESULT RegisterApplicationRecoveryCallback(APPLICATION_RECOVERY_CALLBACK callback, PVOID param, DWORD pingint, DWORD flags)
Definition: process.c:592
void FatalExit(int code)
Definition: process.c:238
BOOL GetExitCodeProcess(HANDLE hProcess, LPDWORD lpExitCode)
Definition: process.c:224
BOOL FindActCtxSectionStringA(DWORD flags, const GUID *guid, ULONG id, const char *search, ACTCTX_SECTION_KEYED_DATA *info)
Definition: process.c:489
HANDLE ConvertToGlobalHandle(HANDLE hSrc)
Definition: process.c:269
DWORD GetFirmwareEnvironmentVariableW(LPCWSTR name, LPCWSTR guid, PVOID buffer, DWORD size)
Definition: process.c:642
HANDLE CreateActCtxA(const ACTCTXA *actctx)
Definition: process.c:415
DWORD LoadModule(LPCSTR name, LPVOID paramBlock)
Definition: process.c:125
BOOL GetProcessIoCounters(HANDLE hProcess, PIO_COUNTERS ioc)
Definition: process.c:377
DWORD RegisterServiceProcess(DWORD dwProcessId, DWORD dwType)
Definition: process.c:388
BOOL SetProcessAffinityMask(HANDLE hProcess, DWORD_PTR affmask)
Definition: process.c:317
DWORD GetMaximumProcessorCount(WORD group)
Definition: process.c:621
#define PDB32_DEBUGGED
Definition: process.c:55
DWORD GetProcessFlags(DWORD processid)
Definition: process.c:248
BOOL SetProcessDEPPolicy(DWORD newDEP)
Definition: process.c:563
UINT WinExec(LPCSTR lpCmdLine, UINT nCmdShow)
Definition: process.c:85
DWORD(* WaitForInputIdle_ptr)(HANDLE hProcess, DWORD dwTimeOut)
Definition: process.c:68
BOOL SetHandleContext(HANDLE hnd, DWORD context)
Definition: process.c:281
BOOL CreateUmsCompletionList(PUMS_COMPLETION_LIST *list)
Definition: process.c:764
BOOL DequeueUmsCompletionListItems(void *list, DWORD timeout, PUMS_CONTEXT *ctx)
Definition: process.c:804
DWORD GetFirmwareEnvironmentVariableA(LPCSTR name, LPCSTR guid, PVOID buffer, DWORD size)
Definition: process.c:632
HRESULT ApplicationRecoveryInProgress(PBOOL canceled)
Definition: process.c:582
void ExitProcess(DWORD status)
Definition: process.c:204
BOOL SetFirmwareEnvironmentVariableW(const WCHAR *name, const WCHAR *guid, void *buffer, DWORD size)
Definition: process.c:652
BOOL SetUmsThreadInformation(PUMS_CONTEXT ctx, UMS_THREAD_INFO_CLASS class, void *buf, ULONG length)
Definition: process.c:875
BOOL QueryUmsThreadInformation(PUMS_CONTEXT ctx, UMS_THREAD_INFO_CLASS class, void *buf, ULONG length, ULONG *ret_length)
Definition: process.c:864
DWORD GetActiveProcessorCount(WORD group)
Definition: process.c:610
PUMS_CONTEXT GetCurrentUmsThread(void)
Definition: process.c:834
BOOL SetProcessWorkingSetSize(HANDLE process, SIZE_T minset, SIZE_T maxset)
Definition: process.c:360
HRESULT RegisterApplicationRestart(PCWSTR pwzCommandLine, DWORD dwFlags)
Definition: process.c:533
BOOL GetNumaProximityNode(ULONG proximity_id, PUCHAR node_number)
Definition: process.c:719
BOOL GetProcessWorkingSetSize(HANDLE process, SIZE_T *minset, SIZE_T *maxset)
Definition: process.c:368
SYSTEM_BASIC_INFORMATION system_info
Definition: process.c:52
BOOL GetNumaAvailableMemoryNodeEx(USHORT node, PULONGLONG available_bytes)
Definition: process.c:682
BOOL IsDebuggerPresent(void)
Definition: debug.c:177
DWORD SearchPathA(LPCSTR path, LPCSTR name, LPCSTR ext, DWORD buflen, LPSTR buffer, LPSTR *lastpart)
Definition: file.c:2633
BOOL AreFileApisANSI(void)
Definition: file.c:488
HMODULE GetModuleHandleA(LPCSTR module)
Definition: loader.c:340
HANDLE CreateActCtxW(PCACTCTXW ctx)
Definition: loader.c:1133
BOOL FindActCtxSectionStringW(DWORD flags, const GUID *ext_guid, ULONG id, LPCWSTR str, PACTCTX_SECTION_KEYED_DATA info)
Definition: loader.c:1167
BOOL GetProcessWorkingSetSizeEx(HANDLE process, SIZE_T *minset, SIZE_T *maxset, DWORD *flags)
Definition: process.c:889
BOOL DuplicateHandle(HANDLE source_process, HANDLE source, HANDLE dest_process, HANDLE *dest, DWORD access, BOOL inherit, DWORD options)
Definition: process.c:656
BOOL CreateProcessA(const char *app_name, char *cmd_line, SECURITY_ATTRIBUTES *process_attr, SECURITY_ATTRIBUTES *thread_attr, BOOL inherit, DWORD flags, void *env, const char *cur_dir, STARTUPINFOA *startup_info, PROCESS_INFORMATION *info)
Definition: process.c:628
BOOL SetProcessWorkingSetSizeEx(HANDLE process, SIZE_T minset, SIZE_T maxset, DWORD flags)
Definition: process.c:1182
BOOL CloseHandle(HANDLE handle)
Definition: process.c:390
size_t strlen(const char *str)
Definition: string.c:1502
void * memcpy(void *dst, const void *src, size_t n)
Definition: string.c:2580
char * strcpy(char *dst, const char *src)
Definition: string.c:1263
void * memset(void *dst, int c, size_t n)
Definition: string.c:2588
void RtlExitUserProcess(DWORD status)
Definition: loader.c:3185
PIMAGE_NT_HEADERS RtlImageNtHeader(HMODULE hModule)
Definition: loader.c:3395
NTSTATUS NtQueryInformationProcess(HANDLE handle, PROCESSINFOCLASS class, void *info, ULONG size, ULONG *ret_len)
Definition: process.c:1178
NTSTATUS NtSetInformationProcess(HANDLE handle, PROCESSINFOCLASS class, void *info, ULONG size)
Definition: process.c:1591
unsigned int UINT
Definition: dxgicommon.idl:20
long BOOL
Definition: dxgitype.idl:24
NTSTATUS status
Definition: except.c:81
#define WINE_DEFAULT_DEBUG_CHANNEL(ch)
Definition: debug.h:499
BYTE flags
Definition: ioports.c:48
FARPROC GetProcAddress(HMODULE hModule, LPCSTR function)
Definition: module.c:348
static BOOL set_ntstatus(NTSTATUS status)
INT MultiByteToWideChar(UINT codepage, DWORD flags, const char *src, INT srclen, WCHAR *dst, INT dstlen)
Definition: locale.c:5510
GUID guid
Definition: version.c:141
struct version_info info
Definition: version.c:140
const IMAGE_NT_HEADERS * nt
Definition: loader.c:73
const char * filename
Definition: loader.c:74
DWORD dwFlags
Definition: msctf.idl:612
static short search(int val, const short *table, int size)
Definition: msg711.c:255
static void size_t len
NTSTATUS NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS class, void *info, ULONG size, ULONG *ret_size)
Definition: system.c:2062
PSecurityUserData *typedef PSECPKG_EXTENDED_INFORMATION *typedef PVOID
Definition: ntsecpkg.h:378
GUID PUCHAR *typedef GUID PUCHAR
Definition: ntsecpkg.h:396
PSecurityUserData *typedef PSECPKG_EXTENDED_INFORMATION *typedef ULONG
Definition: ntsecpkg.h:377
static ALenum param
Definition: openal.c:51
#define DUP_HANDLE_CLOSE_SOURCE
#define DUP_HANDLE_SAME_ACCESS
#define DUP_HANDLE_MAKE_GLOBAL
#define MAX_PATH
Definition: shobjidl.idl:1319
LPSTR lpCmdShow
Definition: process.c:48
LPSTR lpCmdLine
Definition: process.c:47
DWORD dwReserved
Definition: process.c:49
LPSTR lpEnvAddress
Definition: process.c:46
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: winnt.h:3247
DWORD dwFlags
Definition: winbase.h:610
DWORD cb
Definition: winbase.h:599
WORD wShowWindow
Definition: winbase.h:611
Definition: inflate.c:134
Definition: filter.c:184
Definition: token.c:125
Definition: list.h:27
Definition: name.c:36
Definition: ticket.c:41
LPCSTR lpApplicationName
Definition: winbase.h:1289
ULONG cbSize
Definition: winbase.h:1282
LPCSTR lpAssemblyDirectory
Definition: winbase.h:1287
HMODULE hModule
Definition: winbase.h:1290
DWORD dwFlags
Definition: winbase.h:1283
LPCSTR lpSource
Definition: winbase.h:1284
LANGID wLangId
Definition: winbase.h:1286
USHORT wProcessorArchitecture
Definition: winbase.h:1285
LPCSTR lpResourceName
Definition: winbase.h:1288
USHORT wProcessorArchitecture
Definition: winbase.h:1297
DWORD dwFlags
Definition: winbase.h:1295
LPCWSTR lpAssemblyDirectory
Definition: winbase.h:1299
HMODULE hModule
Definition: winbase.h:1302
LPCWSTR lpApplicationName
Definition: winbase.h:1301
ULONG cbSize
Definition: winbase.h:1294
LPCWSTR lpSource
Definition: winbase.h:1296
LANGID wLangId
Definition: winbase.h:1298
LPCWSTR lpResourceName
Definition: winbase.h:1300
#define NULL
Definition: ungif.h:66
#define TRUE
Definition: ungif.h:59
#define FALSE
Definition: ungif.h:62
typedef VOID(WINAPI *PKDEFERRED_ROUTINE)(struct _KDPC *
DECLSPEC_IMPORT DWORD WINAPI GetLastError(void)
#define PROCESS_DEP_ENABLE
Definition: winbase.h:1574
#define ACTCTX_FLAG_HMODULE_VALID
Definition: winbase.h:1265
DECLSPEC_IMPORT DWORD WINAPI GetCurrentProcessId(void)
#define STARTF_USESHOWWINDOW
Definition: winbase.h:587
#define ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID
Definition: winbase.h:1258
DECLSPEC_IMPORT HANDLE WINAPI GetCurrentProcess(void)
#define INVALID_HANDLE_VALUE
Definition: winbase.h:336
DECLSPEC_IMPORT BOOL WINAPI HeapFree(HANDLE, DWORD, LPVOID)
DECLSPEC_IMPORT VOID WINAPI SetLastError(DWORD)
#define ACTCTX_FLAG_APPLICATION_NAME_VALID
Definition: winbase.h:1263
#define ACTCTX_FLAG_RESOURCE_NAME_VALID
Definition: winbase.h:1261
#define ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID
Definition: winbase.h:1260
enum _RTL_UMS_THREAD_INFO_CLASS UMS_THREAD_INFO_CLASS
Definition: winbase.h:1746
DECLSPEC_IMPORT HANDLE WINAPI GetProcessHeap(void)
#define ACTCTX_FLAG_LANGID_VALID
Definition: winbase.h:1259
@ OptIn
Definition: winbase.h:1570
enum _DEP_SYSTEM_POLICY_TYPE DEP_SYSTEM_POLICY_TYPE
#define WAIT_FAILED
Definition: winbase.h:1174
#define PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION
Definition: winbase.h:1575
DECLSPEC_IMPORT LPVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T) __WINE_ALLOC_SIZE(3)
DWORD(WINAPI * APPLICATION_RECOVERY_CALLBACK)(PVOID)
Definition: winbase.h:1042
unsigned short WORD
Definition: windef.h:251
int * PBOOL
Definition: windef.h:249
unsigned char BYTE
Definition: windef.h:250
unsigned int * LPDWORD
Definition: windef.h:261
unsigned char UCHAR
Definition: windef.h:238
unsigned int DWORD
Definition: windef.h:261
unsigned short USHORT
Definition: windef.h:239
unsigned short * PUSHORT
Definition: windef.h:239
processor
Definition: winegcc.c:155
#define ERROR_NOT_ENOUGH_MEMORY
Definition: winerror.h:118
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: winerror.h:199
#define S_OK
Definition: winerror.h:2569
#define ERROR_INVALID_PARAMETER
Definition: winerror.h:178
#define E_FAIL
Definition: winerror.h:2583
#define ERROR_INVALID_FUNCTION
Definition: winerror.h:111
#define ERROR_FILE_NOT_FOUND
Definition: winerror.h:112
#define CP_ACP
Definition: winnls.h:358
#define IMAGE_SUBSYSTEM_WINDOWS_CUI
Definition: winnt.h:3125
const CHAR * LPCSTR
Definition: winnt.h:502
const WCHAR * LPCWSTR
Definition: winnt.h:513
CHAR * LPSTR
Definition: winnt.h:501
unsigned short WCHAR
Definition: winnt.h:468
#define DECLSPEC_HOTPATCH
Definition: winnt.h:184
unsigned long long * PULONGLONG
Definition: winnt.h:485
struct _TEB * NtCurrentTeb(void)
WCHAR * LPWSTR
Definition: winnt.h:512
const WCHAR * PCWSTR
Definition: winnt.h:513
#define MEM_EXECUTE_OPTION_DISABLE
Definition: winternl.h:1210
#define MEM_EXECUTE_OPTION_PERMANENT
Definition: winternl.h:1213
#define MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION
Definition: winternl.h:1212
@ ProcessAffinityMask
Definition: winternl.h:1184
@ ProcessBasicInformation
Definition: winternl.h:1163
@ ProcessExecuteFlags
Definition: winternl.h:1197
@ ProcessIoCounters
Definition: winternl.h:1165
@ SystemBasicInformation
Definition: winternl.h:1221
char * cmdline
Definition: wmc.c:118