4 * Copyright 1996, 1998 Alexandre Julliard
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.
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.
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
22 #include "wine/port.h"
31 #ifdef HAVE_SYS_TIME_H
32 # include <sys/time.h>
34 #ifdef HAVE_SYS_IOCTL_H
35 #include <sys/ioctl.h>
37 #ifdef HAVE_SYS_SOCKET_H
38 #include <sys/socket.h>
40 #include <sys/types.h>
41 #ifdef HAVE_SYS_WAIT_H
42 # include <sys/wait.h>
49 #define WIN32_NO_STATUS
53 #include "kernel_private.h"
55 #include "wine/exception.h"
56 #include "wine/server.h"
57 #include "wine/unicode.h"
59 #include "wine/debug.h"
61 WINE_DEFAULT_DEBUG_CHANNEL(process
);
62 WINE_DECLARE_DEBUG_CHANNEL(relay
);
72 HMODULE kernel32_handle
= 0;
73 SYSTEM_BASIC_INFORMATION system_info
= { 0 };
75 const WCHAR DIR_Windows
[] = {'C',':','\\','w','i','n','d','o','w','s',0};
76 const WCHAR DIR_System
[] = {'C',':','\\','w','i','n','d','o','w','s',
77 '\\','s','y','s','t','e','m','3','2',0};
80 #define PDB32_DEBUGGED 0x0001 /* Process is being debugged */
81 #define PDB32_WIN16_PROC 0x0008 /* Win16 process */
82 #define PDB32_DOS_PROC 0x0010 /* Dos process */
83 #define PDB32_CONSOLE_PROC 0x0020 /* Console process */
84 #define PDB32_FILE_APIS_OEM 0x0040 /* File APIs are OEM */
85 #define PDB32_WIN32S_PROC 0x8000 /* Win32s process */
89 extern DWORD
call_process_entry( PEB
*peb
, LPTHREAD_START_ROUTINE entry
);
90 __ASM_GLOBAL_FUNC( call_process_entry
,
92 __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
93 __ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
95 __ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
97 __ASM_CFI(".cfi_rel_offset %ebx,-4\n\t")
98 "movl 8(%ebp),%ebx\n\t"
99 /* deliberately mis-align the stack by 8, Doom 3 needs this */
100 "pushl 4(%ebp)\n\t" /* Driller expects readable address at this offset */
104 "leal -4(%ebp),%esp\n\t"
106 __ASM_CFI(".cfi_same_value %ebx\n\t")
108 __ASM_CFI(".cfi_def_cfa %esp,4\n\t")
109 __ASM_CFI(".cfi_same_value %ebp\n\t")
112 __ASM_GLOBAL_FUNC( __wine_start_process
,
114 __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
115 __ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
117 __ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
118 "pushl %ebx\n\t" /* arg */
119 "pushl %eax\n\t" /* entry */
120 "call " __ASM_NAME("start_process") )
122 static inline DWORD
call_process_entry( PEB
*peb
, LPTHREAD_START_ROUTINE entry
)
128 /***********************************************************************
129 * __wine_start_process
131 * Startup routine of a new process. Runs on the new process stack.
134 void CDECL
start_process( LPTHREAD_START_ROUTINE entry
, PEB
*peb
)
136 void CDECL
__wine_start_process( LPTHREAD_START_ROUTINE entry
, PEB
*peb
)
143 ERR( "%s doesn't have an entry point, it cannot be executed\n",
144 debugstr_w(peb
->ProcessParameters
->ImagePathName
.Buffer
) );
148 TRACE_(relay
)( "\1Starting process %s (entryproc=%p)\n",
149 debugstr_w(peb
->ProcessParameters
->ImagePathName
.Buffer
), entry
);
153 if (!CheckRemoteDebuggerPresent( GetCurrentProcess(), &being_debugged
))
154 being_debugged
= FALSE
;
156 SetLastError( 0 ); /* clear error code */
157 if (being_debugged
) DbgBreakPoint();
158 ExitThread( call_process_entry( peb
, entry
));
160 __EXCEPT(UnhandledExceptionFilter
)
162 TerminateProcess( GetCurrentProcess(), GetExceptionCode() );
165 abort(); /* should not be reached */
169 /***********************************************************************
172 * Wrapper to call WaitForInputIdle USER function
174 typedef DWORD (WINAPI
*WaitForInputIdle_ptr
)( HANDLE hProcess
, DWORD dwTimeOut
);
176 static DWORD
wait_input_idle( HANDLE process
, DWORD timeout
)
178 HMODULE mod
= GetModuleHandleA( "user32.dll" );
181 WaitForInputIdle_ptr ptr
= (WaitForInputIdle_ptr
)GetProcAddress( mod
, "WaitForInputIdle" );
182 if (ptr
) return ptr( process
, timeout
);
188 /***********************************************************************
189 * WinExec (KERNEL32.@)
191 UINT WINAPI DECLSPEC_HOTPATCH
WinExec( LPCSTR lpCmdLine
, UINT nCmdShow
)
193 PROCESS_INFORMATION info
;
194 STARTUPINFOA startup
;
198 memset( &startup
, 0, sizeof(startup
) );
199 startup
.cb
= sizeof(startup
);
200 startup
.dwFlags
= STARTF_USESHOWWINDOW
;
201 startup
.wShowWindow
= nCmdShow
;
203 /* cmdline needs to be writable for CreateProcess */
204 if (!(cmdline
= HeapAlloc( GetProcessHeap(), 0, strlen(lpCmdLine
)+1 ))) return 0;
205 strcpy( cmdline
, lpCmdLine
);
207 if (CreateProcessA( NULL
, cmdline
, NULL
, NULL
, FALSE
,
208 0, NULL
, NULL
, &startup
, &info
))
210 /* Give 30 seconds to the app to come up */
211 if (wait_input_idle( info
.hProcess
, 30000 ) == WAIT_FAILED
)
212 WARN("WaitForInputIdle failed: Error %d\n", GetLastError() );
214 /* Close off the handles */
215 CloseHandle( info
.hThread
);
216 CloseHandle( info
.hProcess
);
218 else if ((ret
= GetLastError()) >= 32)
220 FIXME("Strange error set by CreateProcess: %d\n", ret
);
223 HeapFree( GetProcessHeap(), 0, cmdline
);
228 /**********************************************************************
229 * LoadModule (KERNEL32.@)
231 DWORD WINAPI
LoadModule( LPCSTR name
, LPVOID paramBlock
)
233 LOADPARMS32
*params
= paramBlock
;
234 PROCESS_INFORMATION info
;
235 STARTUPINFOA startup
;
238 char filename
[MAX_PATH
];
241 if (!name
) return ERROR_FILE_NOT_FOUND
;
243 if (!SearchPathA( NULL
, name
, ".exe", sizeof(filename
), filename
, NULL
) &&
244 !SearchPathA( NULL
, name
, NULL
, sizeof(filename
), filename
, NULL
))
245 return GetLastError();
247 len
= (BYTE
)params
->lpCmdLine
[0];
248 if (!(cmdline
= HeapAlloc( GetProcessHeap(), 0, strlen(filename
) + len
+ 2 )))
249 return ERROR_NOT_ENOUGH_MEMORY
;
251 strcpy( cmdline
, filename
);
252 p
= cmdline
+ strlen(cmdline
);
254 memcpy( p
, params
->lpCmdLine
+ 1, len
);
257 memset( &startup
, 0, sizeof(startup
) );
258 startup
.cb
= sizeof(startup
);
259 if (params
->lpCmdShow
)
261 startup
.dwFlags
= STARTF_USESHOWWINDOW
;
262 startup
.wShowWindow
= ((WORD
*)params
->lpCmdShow
)[1];
265 if (CreateProcessA( filename
, cmdline
, NULL
, NULL
, FALSE
, 0,
266 params
->lpEnvAddress
, NULL
, &startup
, &info
))
268 /* Give 30 seconds to the app to come up */
269 if (wait_input_idle( info
.hProcess
, 30000 ) == WAIT_FAILED
)
270 WARN("WaitForInputIdle failed: Error %d\n", GetLastError() );
272 /* Close off the handles */
273 CloseHandle( info
.hThread
);
274 CloseHandle( info
.hProcess
);
276 else if ((ret
= GetLastError()) >= 32)
278 FIXME("Strange error set by CreateProcess: %u\n", ret
);
282 HeapFree( GetProcessHeap(), 0, cmdline
);
287 /***********************************************************************
288 * ExitProcess (KERNEL32.@)
290 * Exits the current process.
293 * status [I] Status code to exit with.
299 __ASM_STDCALL_FUNC( ExitProcess
, 4, /* Shrinker depend on this particular ExitProcess implementation */
301 ".byte 0x8B, 0xEC\n\t" /* movl %esp, %ebp */
302 ".byte 0x6A, 0x00\n\t" /* pushl $0 */
303 ".byte 0x68, 0x00, 0x00, 0x00, 0x00\n\t" /* pushl $0 - 4 bytes immediate */
305 "call " __ASM_STDCALL("RtlExitUserProcess",4) "\n\t"
310 void WINAPI
ExitProcess( DWORD status
)
312 RtlExitUserProcess( status
);
317 /***********************************************************************
318 * GetExitCodeProcess [KERNEL32.@]
320 * Gets termination status of specified process.
323 * hProcess [in] Handle to the process.
324 * lpExitCode [out] Address to receive termination status.
330 BOOL WINAPI
GetExitCodeProcess( HANDLE hProcess
, LPDWORD lpExitCode
)
332 PROCESS_BASIC_INFORMATION pbi
;
334 if (!set_ntstatus( NtQueryInformationProcess( hProcess
, ProcessBasicInformation
, &pbi
, sizeof(pbi
), NULL
)))
336 if (lpExitCode
) *lpExitCode
= pbi
.ExitStatus
;
341 /**************************************************************************
342 * FatalExit (KERNEL32.@)
344 void WINAPI
FatalExit( int code
)
346 WARN( "FatalExit\n" );
351 /***********************************************************************
352 * GetProcessFlags (KERNEL32.@)
354 DWORD WINAPI
GetProcessFlags( DWORD processid
)
356 IMAGE_NT_HEADERS
*nt
;
359 if (processid
&& processid
!= GetCurrentProcessId()) return 0;
361 if ((nt
= RtlImageNtHeader( NtCurrentTeb()->Peb
->ImageBaseAddress
)))
363 if (nt
->OptionalHeader
.Subsystem
== IMAGE_SUBSYSTEM_WINDOWS_CUI
)
364 flags
|= PDB32_CONSOLE_PROC
;
366 if (!AreFileApisANSI()) flags
|= PDB32_FILE_APIS_OEM
;
367 if (IsDebuggerPresent()) flags
|= PDB32_DEBUGGED
;
372 /***********************************************************************
373 * ConvertToGlobalHandle (KERNEL32.@)
375 HANDLE WINAPI
ConvertToGlobalHandle(HANDLE hSrc
)
377 HANDLE ret
= INVALID_HANDLE_VALUE
;
378 DuplicateHandle( GetCurrentProcess(), hSrc
, GetCurrentProcess(), &ret
, 0, FALSE
,
379 DUP_HANDLE_MAKE_GLOBAL
| DUP_HANDLE_SAME_ACCESS
| DUP_HANDLE_CLOSE_SOURCE
);
384 /***********************************************************************
385 * SetHandleContext (KERNEL32.@)
387 BOOL WINAPI
SetHandleContext(HANDLE hnd
,DWORD context
)
389 FIXME("(%p,%d), stub. In case this got called by WSOCK32/WS2_32: "
390 "the external WINSOCK DLLs won't work with WINE, don't use them.\n",hnd
,context
);
391 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
396 /***********************************************************************
397 * GetHandleContext (KERNEL32.@)
399 DWORD WINAPI
GetHandleContext(HANDLE hnd
)
401 FIXME("(%p), stub. In case this got called by WSOCK32/WS2_32: "
402 "the external WINSOCK DLLs won't work with WINE, don't use them.\n",hnd
);
403 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
408 /***********************************************************************
409 * CreateSocketHandle (KERNEL32.@)
411 HANDLE WINAPI
CreateSocketHandle(void)
413 FIXME("(), stub. In case this got called by WSOCK32/WS2_32: "
414 "the external WINSOCK DLLs won't work with WINE, don't use them.\n");
415 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
416 return INVALID_HANDLE_VALUE
;
420 /***********************************************************************
421 * SetProcessAffinityMask (KERNEL32.@)
423 BOOL WINAPI
SetProcessAffinityMask( HANDLE hProcess
, DWORD_PTR affmask
)
425 return set_ntstatus( NtSetInformationProcess( hProcess
, ProcessAffinityMask
,
426 &affmask
, sizeof(DWORD_PTR
) ));
430 /**********************************************************************
431 * GetProcessAffinityMask (KERNEL32.@)
433 BOOL WINAPI
GetProcessAffinityMask( HANDLE hProcess
, PDWORD_PTR process_mask
, PDWORD_PTR system_mask
)
437 if (!set_ntstatus( NtQueryInformationProcess( hProcess
, ProcessAffinityMask
,
438 process_mask
, sizeof(*process_mask
), NULL
)))
443 SYSTEM_BASIC_INFORMATION info
;
445 if (!set_ntstatus( NtQuerySystemInformation( SystemBasicInformation
, &info
, sizeof(info
), NULL
)))
447 *system_mask
= info
.ActiveProcessorsAffinityMask
;
453 /***********************************************************************
454 * SetProcessWorkingSetSize [KERNEL32.@]
455 * Sets the min/max working set sizes for a specified process.
458 * process [I] Handle to the process of interest
459 * minset [I] Specifies minimum working set size
460 * maxset [I] Specifies maximum working set size
466 BOOL WINAPI
SetProcessWorkingSetSize(HANDLE process
, SIZE_T minset
, SIZE_T maxset
)
468 return SetProcessWorkingSetSizeEx(process
, minset
, maxset
, 0);
471 /***********************************************************************
472 * GetProcessWorkingSetSize (KERNEL32.@)
474 BOOL WINAPI
GetProcessWorkingSetSize(HANDLE process
, SIZE_T
*minset
, SIZE_T
*maxset
)
476 return GetProcessWorkingSetSizeEx(process
, minset
, maxset
, NULL
);
480 /******************************************************************
481 * GetProcessIoCounters (KERNEL32.@)
483 BOOL WINAPI
GetProcessIoCounters(HANDLE hProcess
, PIO_COUNTERS ioc
)
485 return set_ntstatus( NtQueryInformationProcess(hProcess
, ProcessIoCounters
, ioc
, sizeof(*ioc
), NULL
));
488 /***********************************************************************
489 * RegisterServiceProcess (KERNEL32.@)
491 * A service process calls this function to ensure that it continues to run
492 * even after a user logged off.
494 DWORD WINAPI
RegisterServiceProcess(DWORD dwProcessId
, DWORD dwType
)
496 /* I don't think that Wine needs to do anything in this function */
497 return 1; /* success */
501 /***********************************************************************
502 * GetCurrentProcess (KERNEL32.@)
504 * Get a handle to the current process.
510 * A handle representing the current process.
512 HANDLE WINAPI
KERNEL32_GetCurrentProcess(void)
514 return (HANDLE
)~(ULONG_PTR
)0;
518 /***********************************************************************
519 * CreateActCtxA (KERNEL32.@)
521 HANDLE WINAPI DECLSPEC_HOTPATCH
CreateActCtxA( const ACTCTXA
*actctx
)
525 HANDLE ret
= INVALID_HANDLE_VALUE
;
526 LPWSTR src
= NULL
, assdir
= NULL
, resname
= NULL
, appname
= NULL
;
528 TRACE("%p %08x\n", actctx
, actctx
? actctx
->dwFlags
: 0);
530 if (!actctx
|| actctx
->cbSize
!= sizeof(*actctx
))
532 SetLastError(ERROR_INVALID_PARAMETER
);
533 return INVALID_HANDLE_VALUE
;
536 actw
.cbSize
= sizeof(actw
);
537 actw
.dwFlags
= actctx
->dwFlags
;
538 if (actctx
->lpSource
)
540 len
= MultiByteToWideChar(CP_ACP
, 0, actctx
->lpSource
, -1, NULL
, 0);
541 src
= HeapAlloc(GetProcessHeap(), 0, len
* sizeof(WCHAR
));
542 if (!src
) return INVALID_HANDLE_VALUE
;
543 MultiByteToWideChar(CP_ACP
, 0, actctx
->lpSource
, -1, src
, len
);
547 if (actw
.dwFlags
& ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID
)
548 actw
.wProcessorArchitecture
= actctx
->wProcessorArchitecture
;
549 if (actw
.dwFlags
& ACTCTX_FLAG_LANGID_VALID
)
550 actw
.wLangId
= actctx
->wLangId
;
551 if (actw
.dwFlags
& ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID
)
553 len
= MultiByteToWideChar(CP_ACP
, 0, actctx
->lpAssemblyDirectory
, -1, NULL
, 0);
554 assdir
= HeapAlloc(GetProcessHeap(), 0, len
* sizeof(WCHAR
));
555 if (!assdir
) goto done
;
556 MultiByteToWideChar(CP_ACP
, 0, actctx
->lpAssemblyDirectory
, -1, assdir
, len
);
557 actw
.lpAssemblyDirectory
= assdir
;
559 if (actw
.dwFlags
& ACTCTX_FLAG_RESOURCE_NAME_VALID
)
561 if ((ULONG_PTR
)actctx
->lpResourceName
>> 16)
563 len
= MultiByteToWideChar(CP_ACP
, 0, actctx
->lpResourceName
, -1, NULL
, 0);
564 resname
= HeapAlloc(GetProcessHeap(), 0, len
* sizeof(WCHAR
));
565 if (!resname
) goto done
;
566 MultiByteToWideChar(CP_ACP
, 0, actctx
->lpResourceName
, -1, resname
, len
);
567 actw
.lpResourceName
= resname
;
569 else actw
.lpResourceName
= (LPCWSTR
)actctx
->lpResourceName
;
571 if (actw
.dwFlags
& ACTCTX_FLAG_APPLICATION_NAME_VALID
)
573 len
= MultiByteToWideChar(CP_ACP
, 0, actctx
->lpApplicationName
, -1, NULL
, 0);
574 appname
= HeapAlloc(GetProcessHeap(), 0, len
* sizeof(WCHAR
));
575 if (!appname
) goto done
;
576 MultiByteToWideChar(CP_ACP
, 0, actctx
->lpApplicationName
, -1, appname
, len
);
577 actw
.lpApplicationName
= appname
;
579 if (actw
.dwFlags
& ACTCTX_FLAG_HMODULE_VALID
)
580 actw
.hModule
= actctx
->hModule
;
582 ret
= CreateActCtxW(&actw
);
585 HeapFree(GetProcessHeap(), 0, src
);
586 HeapFree(GetProcessHeap(), 0, assdir
);
587 HeapFree(GetProcessHeap(), 0, resname
);
588 HeapFree(GetProcessHeap(), 0, appname
);
592 /***********************************************************************
593 * FindActCtxSectionStringA (KERNEL32.@)
595 BOOL WINAPI
FindActCtxSectionStringA( DWORD flags
, const GUID
*guid
, ULONG id
, const char *search
,
596 ACTCTX_SECTION_KEYED_DATA
*info
)
602 TRACE("%08x %s %u %s %p\n", flags
, debugstr_guid(guid
), id
, debugstr_a(search
), info
);
604 if (!search
|| !info
)
606 SetLastError(ERROR_INVALID_PARAMETER
);
609 len
= MultiByteToWideChar(CP_ACP
, 0, search
, -1, NULL
, 0);
610 searchW
= HeapAlloc(GetProcessHeap(), 0, len
* sizeof(WCHAR
));
611 MultiByteToWideChar(CP_ACP
, 0, search
, -1, searchW
, len
);
612 ret
= FindActCtxSectionStringW( flags
, guid
, id
, searchW
, info
);
613 HeapFree(GetProcessHeap(), 0, searchW
);
618 /***********************************************************************
619 * CmdBatNotification (KERNEL32.@)
621 * Notifies the system that a batch file has started or finished.
624 * bBatchRunning [I] TRUE if a batch file has started or
625 * FALSE if a batch file has finished executing.
630 BOOL WINAPI
CmdBatNotification( BOOL bBatchRunning
)
632 FIXME("%d\n", bBatchRunning
);
636 /***********************************************************************
637 * RegisterApplicationRestart (KERNEL32.@)
639 HRESULT WINAPI
RegisterApplicationRestart(PCWSTR pwzCommandLine
, DWORD dwFlags
)
641 FIXME("(%s,%d)\n", debugstr_w(pwzCommandLine
), dwFlags
);
646 /**********************************************************************
647 * WTSGetActiveConsoleSessionId (KERNEL32.@)
649 DWORD WINAPI
WTSGetActiveConsoleSessionId(void)
652 if (!once
++) FIXME("stub\n");
653 /* Return current session id. */
654 return NtCurrentTeb()->Peb
->SessionId
;
657 /**********************************************************************
658 * GetSystemDEPPolicy (KERNEL32.@)
660 DEP_SYSTEM_POLICY_TYPE WINAPI
GetSystemDEPPolicy(void)
666 /**********************************************************************
667 * SetProcessDEPPolicy (KERNEL32.@)
669 BOOL WINAPI
SetProcessDEPPolicy(DWORD newDEP
)
671 FIXME("(%d): stub\n", newDEP
);
672 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
676 /**********************************************************************
677 * ApplicationRecoveryFinished (KERNEL32.@)
679 VOID WINAPI
ApplicationRecoveryFinished(BOOL success
)
682 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
685 /**********************************************************************
686 * ApplicationRecoveryInProgress (KERNEL32.@)
688 HRESULT WINAPI
ApplicationRecoveryInProgress(PBOOL canceled
)
690 FIXME(":%p stub\n", canceled
);
691 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
695 /**********************************************************************
696 * RegisterApplicationRecoveryCallback (KERNEL32.@)
698 HRESULT WINAPI
RegisterApplicationRecoveryCallback(APPLICATION_RECOVERY_CALLBACK callback
, PVOID param
, DWORD pingint
, DWORD flags
)
700 FIXME("%p, %p, %d, %d: stub, faking success\n", callback
, param
, pingint
, flags
);
704 /***********************************************************************
705 * GetActiveProcessorGroupCount (KERNEL32.@)
707 WORD WINAPI
GetActiveProcessorGroupCount(void)
709 FIXME("semi-stub, always returning 1\n");
713 /***********************************************************************
714 * GetActiveProcessorCount (KERNEL32.@)
716 DWORD WINAPI
GetActiveProcessorCount(WORD group
)
718 DWORD cpus
= system_info
.NumberOfProcessors
;
720 FIXME("semi-stub, returning %u\n", cpus
);
724 /***********************************************************************
725 * GetMaximumProcessorCount (KERNEL32.@)
727 DWORD WINAPI
GetMaximumProcessorCount(WORD group
)
729 DWORD cpus
= system_info
.NumberOfProcessors
;
731 FIXME("semi-stub, returning %u\n", cpus
);
735 /***********************************************************************
736 * GetEnabledXStateFeatures (KERNEL32.@)
738 DWORD64 WINAPI
GetEnabledXStateFeatures(void)
744 /***********************************************************************
745 * GetFirmwareEnvironmentVariableA (KERNEL32.@)
747 DWORD WINAPI
GetFirmwareEnvironmentVariableA(LPCSTR name
, LPCSTR guid
, PVOID buffer
, DWORD size
)
749 FIXME("stub: %s %s %p %u\n", debugstr_a(name
), debugstr_a(guid
), buffer
, size
);
750 SetLastError(ERROR_INVALID_FUNCTION
);
754 /***********************************************************************
755 * GetFirmwareEnvironmentVariableW (KERNEL32.@)
757 DWORD WINAPI
GetFirmwareEnvironmentVariableW(LPCWSTR name
, LPCWSTR guid
, PVOID buffer
, DWORD size
)
759 FIXME("stub: %s %s %p %u\n", debugstr_w(name
), debugstr_w(guid
), buffer
, size
);
760 SetLastError(ERROR_INVALID_FUNCTION
);
764 /**********************************************************************
765 * GetNumaNodeProcessorMask (KERNEL32.@)
767 BOOL WINAPI
GetNumaNodeProcessorMask(UCHAR node
, PULONGLONG mask
)
769 FIXME("(%c %p): stub\n", node
, mask
);
770 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
774 /**********************************************************************
775 * GetNumaAvailableMemoryNode (KERNEL32.@)
777 BOOL WINAPI
GetNumaAvailableMemoryNode(UCHAR node
, PULONGLONG available_bytes
)
779 FIXME("(%c %p): stub\n", node
, available_bytes
);
780 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
784 /**********************************************************************
785 * GetNumaAvailableMemoryNodeEx (KERNEL32.@)
787 BOOL WINAPI
GetNumaAvailableMemoryNodeEx(USHORT node
, PULONGLONG available_bytes
)
789 FIXME("(%hu %p): stub\n", node
, available_bytes
);
790 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
794 /***********************************************************************
795 * GetNumaProcessorNode (KERNEL32.@)
797 BOOL WINAPI
GetNumaProcessorNode(UCHAR processor
, PUCHAR node
)
799 TRACE("(%d, %p)\n", processor
, node
);
801 if (processor
< system_info
.NumberOfProcessors
)
808 SetLastError(ERROR_INVALID_PARAMETER
);
812 /***********************************************************************
813 * GetNumaProcessorNodeEx (KERNEL32.@)
815 BOOL WINAPI
GetNumaProcessorNodeEx(PPROCESSOR_NUMBER processor
, PUSHORT node_number
)
817 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
821 /***********************************************************************
822 * GetNumaProximityNode (KERNEL32.@)
824 BOOL WINAPI
GetNumaProximityNode(ULONG proximity_id
, PUCHAR node_number
)
826 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
830 /**********************************************************************
831 * GetProcessDEPPolicy (KERNEL32.@)
833 BOOL WINAPI
GetProcessDEPPolicy(HANDLE process
, LPDWORD flags
, PBOOL permanent
)
837 TRACE("(%p %p %p)\n", process
, flags
, permanent
);
839 if (!set_ntstatus( NtQueryInformationProcess( GetCurrentProcess(), ProcessExecuteFlags
,
840 &dep_flags
, sizeof(dep_flags
), NULL
)))
846 if (dep_flags
& MEM_EXECUTE_OPTION_DISABLE
)
847 *flags
|= PROCESS_DEP_ENABLE
;
848 if (dep_flags
& MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION
)
849 *flags
|= PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION
;
852 if (permanent
) *permanent
= (dep_flags
& MEM_EXECUTE_OPTION_PERMANENT
) != 0;
856 /***********************************************************************
857 * UnregisterApplicationRestart (KERNEL32.@)
859 HRESULT WINAPI
UnregisterApplicationRestart(void)
862 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
866 /***********************************************************************
867 * CreateUmsCompletionList (KERNEL32.@)
869 BOOL WINAPI
CreateUmsCompletionList(PUMS_COMPLETION_LIST
*list
)
871 FIXME( "%p: stub\n", list
);
872 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
876 /***********************************************************************
877 * CreateUmsThreadContext (KERNEL32.@)
879 BOOL WINAPI
CreateUmsThreadContext(PUMS_CONTEXT
*ctx
)
881 FIXME( "%p: stub\n", ctx
);
882 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
886 /***********************************************************************
887 * DeleteUmsCompletionList (KERNEL32.@)
889 BOOL WINAPI
DeleteUmsCompletionList(PUMS_COMPLETION_LIST list
)
891 FIXME( "%p: stub\n", list
);
892 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
896 /***********************************************************************
897 * DeleteUmsThreadContext (KERNEL32.@)
899 BOOL WINAPI
DeleteUmsThreadContext(PUMS_CONTEXT ctx
)
901 FIXME( "%p: stub\n", ctx
);
902 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
906 /***********************************************************************
907 * DequeueUmsCompletionListItems (KERNEL32.@)
909 BOOL WINAPI
DequeueUmsCompletionListItems(void *list
, DWORD timeout
, PUMS_CONTEXT
*ctx
)
911 FIXME( "%p,%08x,%p: stub\n", list
, timeout
, ctx
);
912 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
916 /***********************************************************************
917 * EnterUmsSchedulingMode (KERNEL32.@)
919 BOOL WINAPI
EnterUmsSchedulingMode(UMS_SCHEDULER_STARTUP_INFO
*info
)
921 FIXME( "%p: stub\n", info
);
922 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
926 /***********************************************************************
927 * ExecuteUmsThread (KERNEL32.@)
929 BOOL WINAPI
ExecuteUmsThread(PUMS_CONTEXT ctx
)
931 FIXME( "%p: stub\n", ctx
);
932 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
936 /***********************************************************************
937 * GetCurrentUmsThread (KERNEL32.@)
939 PUMS_CONTEXT WINAPI
GetCurrentUmsThread(void)
942 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
946 /***********************************************************************
947 * GetNextUmsListItem (KERNEL32.@)
949 PUMS_CONTEXT WINAPI
GetNextUmsListItem(PUMS_CONTEXT ctx
)
951 FIXME( "%p: stub\n", ctx
);
952 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
956 /***********************************************************************
957 * GetUmsCompletionListEvent (KERNEL32.@)
959 BOOL WINAPI
GetUmsCompletionListEvent(PUMS_COMPLETION_LIST list
, HANDLE
*event
)
961 FIXME( "%p,%p: stub\n", list
, event
);
962 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
966 /***********************************************************************
967 * QueryUmsThreadInformation (KERNEL32.@)
969 BOOL WINAPI
QueryUmsThreadInformation(PUMS_CONTEXT ctx
, UMS_THREAD_INFO_CLASS
class,
970 void *buf
, ULONG length
, ULONG
*ret_length
)
972 FIXME( "%p,%08x,%p,%08x,%p: stub\n", ctx
, class, buf
, length
, ret_length
);
973 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
977 /***********************************************************************
978 * SetUmsThreadInformation (KERNEL32.@)
980 BOOL WINAPI
SetUmsThreadInformation(PUMS_CONTEXT ctx
, UMS_THREAD_INFO_CLASS
class,
981 void *buf
, ULONG length
)
983 FIXME( "%p,%08x,%p,%08x: stub\n", ctx
, class, buf
, length
);
984 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
988 /***********************************************************************
989 * UmsThreadYield (KERNEL32.@)
991 BOOL WINAPI
UmsThreadYield(void *param
)
993 FIXME( "%p: stub\n", param
);
994 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);