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
30 #define WIN32_NO_STATUS
35 #include "kernel_private.h"
39 #include "wine/debug.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(process
);
43 static const struct _KUSER_SHARED_DATA
*user_shared_data
= (struct _KUSER_SHARED_DATA
*)0x7ffe0000;
53 SYSTEM_BASIC_INFORMATION system_info
= { 0 };
56 #define PDB32_DEBUGGED 0x0001 /* Process is being debugged */
57 #define PDB32_WIN16_PROC 0x0008 /* Win16 process */
58 #define PDB32_DOS_PROC 0x0010 /* Dos process */
59 #define PDB32_CONSOLE_PROC 0x0020 /* Console process */
60 #define PDB32_FILE_APIS_OEM 0x0040 /* File APIs are OEM */
61 #define PDB32_WIN32S_PROC 0x8000 /* Win32s process */
64 /***********************************************************************
67 * Wrapper to call WaitForInputIdle USER function
69 typedef DWORD (WINAPI
*WaitForInputIdle_ptr
)( HANDLE hProcess
, DWORD dwTimeOut
);
71 static DWORD
wait_input_idle( HANDLE process
, DWORD timeout
)
73 HMODULE mod
= GetModuleHandleA( "user32.dll" );
76 WaitForInputIdle_ptr ptr
= (WaitForInputIdle_ptr
)GetProcAddress( mod
, "WaitForInputIdle" );
77 if (ptr
) return ptr( process
, timeout
);
83 /***********************************************************************
84 * WinExec (KERNEL32.@)
86 UINT WINAPI DECLSPEC_HOTPATCH
WinExec( LPCSTR lpCmdLine
, UINT nCmdShow
)
88 PROCESS_INFORMATION info
;
93 memset( &startup
, 0, sizeof(startup
) );
94 startup
.cb
= sizeof(startup
);
95 startup
.dwFlags
= STARTF_USESHOWWINDOW
;
96 startup
.wShowWindow
= nCmdShow
;
98 /* cmdline needs to be writable for CreateProcess */
99 if (!(cmdline
= HeapAlloc( GetProcessHeap(), 0, strlen(lpCmdLine
)+1 ))) return 0;
100 strcpy( cmdline
, lpCmdLine
);
102 if (CreateProcessA( NULL
, cmdline
, NULL
, NULL
, FALSE
,
103 0, NULL
, NULL
, &startup
, &info
))
105 /* Give 30 seconds to the app to come up */
106 if (wait_input_idle( info
.hProcess
, 30000 ) == WAIT_FAILED
)
107 WARN("WaitForInputIdle failed: Error %ld\n", GetLastError() );
109 /* Close off the handles */
110 CloseHandle( info
.hThread
);
111 CloseHandle( info
.hProcess
);
113 else if ((ret
= GetLastError()) >= 32)
115 FIXME("Strange error set by CreateProcess: %d\n", ret
);
118 HeapFree( GetProcessHeap(), 0, cmdline
);
123 /**********************************************************************
124 * LoadModule (KERNEL32.@)
126 DWORD WINAPI
LoadModule( LPCSTR name
, LPVOID paramBlock
)
128 LOADPARMS32
*params
= paramBlock
;
129 PROCESS_INFORMATION info
;
130 STARTUPINFOA startup
;
133 char filename
[MAX_PATH
];
136 if (!name
) return ERROR_FILE_NOT_FOUND
;
138 if (!SearchPathA( NULL
, name
, ".exe", sizeof(filename
), filename
, NULL
) &&
139 !SearchPathA( NULL
, name
, NULL
, sizeof(filename
), filename
, NULL
))
140 return GetLastError();
142 len
= (BYTE
)params
->lpCmdLine
[0];
143 if (!(cmdline
= HeapAlloc( GetProcessHeap(), 0, strlen(filename
) + len
+ 2 )))
144 return ERROR_NOT_ENOUGH_MEMORY
;
146 strcpy( cmdline
, filename
);
147 p
= cmdline
+ strlen(cmdline
);
149 memcpy( p
, params
->lpCmdLine
+ 1, len
);
152 memset( &startup
, 0, sizeof(startup
) );
153 startup
.cb
= sizeof(startup
);
154 if (params
->lpCmdShow
)
156 startup
.dwFlags
= STARTF_USESHOWWINDOW
;
157 startup
.wShowWindow
= ((WORD
*)params
->lpCmdShow
)[1];
160 if (CreateProcessA( filename
, cmdline
, NULL
, NULL
, FALSE
, 0,
161 params
->lpEnvAddress
, NULL
, &startup
, &info
))
163 /* Give 30 seconds to the app to come up */
164 if (wait_input_idle( info
.hProcess
, 30000 ) == WAIT_FAILED
)
165 WARN("WaitForInputIdle failed: Error %ld\n", GetLastError() );
167 /* Close off the handles */
168 CloseHandle( info
.hThread
);
169 CloseHandle( info
.hProcess
);
171 else if ((ret
= GetLastError()) >= 32)
173 FIXME("Strange error set by CreateProcess: %lu\n", ret
);
177 HeapFree( GetProcessHeap(), 0, cmdline
);
182 /***********************************************************************
183 * ExitProcess (KERNEL32.@)
185 * Exits the current process.
188 * status [I] Status code to exit with.
194 __ASM_STDCALL_FUNC( ExitProcess
, 4, /* Shrinker depend on this particular ExitProcess implementation */
196 ".byte 0x8B, 0xEC\n\t" /* movl %esp, %ebp */
197 ".byte 0x6A, 0x00\n\t" /* pushl $0 */
198 ".byte 0x68, 0x00, 0x00, 0x00, 0x00\n\t" /* pushl $0 - 4 bytes immediate */
200 "call " __ASM_STDCALL("RtlExitUserProcess",4) "\n\t"
205 void WINAPI
ExitProcess( DWORD status
)
207 RtlExitUserProcess( status
);
212 /***********************************************************************
213 * GetExitCodeProcess [KERNEL32.@]
215 * Gets termination status of specified process.
218 * hProcess [in] Handle to the process.
219 * lpExitCode [out] Address to receive termination status.
225 BOOL WINAPI
GetExitCodeProcess( HANDLE hProcess
, LPDWORD lpExitCode
)
227 PROCESS_BASIC_INFORMATION pbi
;
229 if (!set_ntstatus( NtQueryInformationProcess( hProcess
, ProcessBasicInformation
, &pbi
, sizeof(pbi
), NULL
)))
231 if (lpExitCode
) *lpExitCode
= pbi
.ExitStatus
;
236 /**************************************************************************
237 * FatalExit (KERNEL32.@)
239 void WINAPI
FatalExit( int code
)
241 WARN( "FatalExit\n" );
246 /***********************************************************************
247 * GetProcessFlags (KERNEL32.@)
249 DWORD WINAPI
GetProcessFlags( DWORD processid
)
251 IMAGE_NT_HEADERS
*nt
;
254 if (processid
&& processid
!= GetCurrentProcessId()) return 0;
256 if ((nt
= RtlImageNtHeader( NtCurrentTeb()->Peb
->ImageBaseAddress
)))
258 if (nt
->OptionalHeader
.Subsystem
== IMAGE_SUBSYSTEM_WINDOWS_CUI
)
259 flags
|= PDB32_CONSOLE_PROC
;
261 if (!AreFileApisANSI()) flags
|= PDB32_FILE_APIS_OEM
;
262 if (IsDebuggerPresent()) flags
|= PDB32_DEBUGGED
;
267 /***********************************************************************
268 * ConvertToGlobalHandle (KERNEL32.@)
270 HANDLE WINAPI
ConvertToGlobalHandle(HANDLE hSrc
)
272 HANDLE ret
= INVALID_HANDLE_VALUE
;
273 DuplicateHandle( GetCurrentProcess(), hSrc
, GetCurrentProcess(), &ret
, 0, FALSE
,
274 DUPLICATE_MAKE_GLOBAL
| DUPLICATE_SAME_ACCESS
| DUPLICATE_CLOSE_SOURCE
);
279 /***********************************************************************
280 * SetHandleContext (KERNEL32.@)
282 BOOL WINAPI
SetHandleContext(HANDLE hnd
,DWORD context
)
284 FIXME("(%p,%ld), stub. In case this got called by WSOCK32/WS2_32: "
285 "the external WINSOCK DLLs won't work with WINE, don't use them.\n",hnd
,context
);
286 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
291 /***********************************************************************
292 * GetHandleContext (KERNEL32.@)
294 DWORD WINAPI
GetHandleContext(HANDLE hnd
)
296 FIXME("(%p), stub. In case this got called by WSOCK32/WS2_32: "
297 "the external WINSOCK DLLs won't work with WINE, don't use them.\n",hnd
);
298 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
303 /***********************************************************************
304 * CreateSocketHandle (KERNEL32.@)
306 HANDLE WINAPI
CreateSocketHandle(void)
308 FIXME("(), stub. In case this got called by WSOCK32/WS2_32: "
309 "the external WINSOCK DLLs won't work with WINE, don't use them.\n");
310 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
311 return INVALID_HANDLE_VALUE
;
315 /***********************************************************************
316 * SetProcessAffinityMask (KERNEL32.@)
318 BOOL WINAPI
SetProcessAffinityMask( HANDLE hProcess
, DWORD_PTR affmask
)
320 return set_ntstatus( NtSetInformationProcess( hProcess
, ProcessAffinityMask
,
321 &affmask
, sizeof(DWORD_PTR
) ));
325 /**********************************************************************
326 * GetProcessAffinityMask (KERNEL32.@)
328 BOOL WINAPI
GetProcessAffinityMask( HANDLE hProcess
, PDWORD_PTR process_mask
, PDWORD_PTR system_mask
)
332 if (!set_ntstatus( NtQueryInformationProcess( hProcess
, ProcessAffinityMask
,
333 process_mask
, sizeof(*process_mask
), NULL
)))
338 SYSTEM_BASIC_INFORMATION info
;
340 if (!set_ntstatus( NtQuerySystemInformation( SystemBasicInformation
, &info
, sizeof(info
), NULL
)))
342 *system_mask
= info
.ActiveProcessorsAffinityMask
;
348 /***********************************************************************
349 * SetProcessWorkingSetSize [KERNEL32.@]
350 * Sets the min/max working set sizes for a specified process.
353 * process [I] Handle to the process of interest
354 * minset [I] Specifies minimum working set size
355 * maxset [I] Specifies maximum working set size
361 BOOL WINAPI
SetProcessWorkingSetSize(HANDLE process
, SIZE_T minset
, SIZE_T maxset
)
363 return SetProcessWorkingSetSizeEx(process
, minset
, maxset
, 0);
366 /***********************************************************************
367 * GetProcessWorkingSetSize (KERNEL32.@)
369 BOOL WINAPI
GetProcessWorkingSetSize(HANDLE process
, SIZE_T
*minset
, SIZE_T
*maxset
)
371 return GetProcessWorkingSetSizeEx(process
, minset
, maxset
, NULL
);
375 /******************************************************************
376 * GetProcessIoCounters (KERNEL32.@)
378 BOOL WINAPI
GetProcessIoCounters(HANDLE hProcess
, PIO_COUNTERS ioc
)
380 return set_ntstatus( NtQueryInformationProcess(hProcess
, ProcessIoCounters
, ioc
, sizeof(*ioc
), NULL
));
383 /***********************************************************************
384 * RegisterServiceProcess (KERNEL32.@)
386 * A service process calls this function to ensure that it continues to run
387 * even after a user logged off.
389 DWORD WINAPI
RegisterServiceProcess(DWORD dwProcessId
, DWORD dwType
)
391 /* I don't think that Wine needs to do anything in this function */
392 return 1; /* success */
396 /***********************************************************************
397 * GetCurrentProcess (KERNEL32.@)
399 * Get a handle to the current process.
405 * A handle representing the current process.
407 HANDLE WINAPI
KERNEL32_GetCurrentProcess(void)
409 return (HANDLE
)~(ULONG_PTR
)0;
413 /***********************************************************************
414 * CreateActCtxA (KERNEL32.@)
416 HANDLE WINAPI DECLSPEC_HOTPATCH
CreateActCtxA( const ACTCTXA
*actctx
)
420 HANDLE ret
= INVALID_HANDLE_VALUE
;
421 LPWSTR src
= NULL
, assdir
= NULL
, resname
= NULL
, appname
= NULL
;
423 TRACE("%p %08lx\n", actctx
, actctx
? actctx
->dwFlags
: 0);
425 if (!actctx
|| actctx
->cbSize
!= sizeof(*actctx
))
427 SetLastError(ERROR_INVALID_PARAMETER
);
428 return INVALID_HANDLE_VALUE
;
431 actw
.cbSize
= sizeof(actw
);
432 actw
.dwFlags
= actctx
->dwFlags
;
433 if (actctx
->lpSource
)
435 len
= MultiByteToWideChar(CP_ACP
, 0, actctx
->lpSource
, -1, NULL
, 0);
436 src
= HeapAlloc(GetProcessHeap(), 0, len
* sizeof(WCHAR
));
437 if (!src
) return INVALID_HANDLE_VALUE
;
438 MultiByteToWideChar(CP_ACP
, 0, actctx
->lpSource
, -1, src
, len
);
442 if (actw
.dwFlags
& ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID
)
443 actw
.wProcessorArchitecture
= actctx
->wProcessorArchitecture
;
444 if (actw
.dwFlags
& ACTCTX_FLAG_LANGID_VALID
)
445 actw
.wLangId
= actctx
->wLangId
;
446 if (actw
.dwFlags
& ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID
)
448 len
= MultiByteToWideChar(CP_ACP
, 0, actctx
->lpAssemblyDirectory
, -1, NULL
, 0);
449 assdir
= HeapAlloc(GetProcessHeap(), 0, len
* sizeof(WCHAR
));
450 if (!assdir
) goto done
;
451 MultiByteToWideChar(CP_ACP
, 0, actctx
->lpAssemblyDirectory
, -1, assdir
, len
);
452 actw
.lpAssemblyDirectory
= assdir
;
454 if (actw
.dwFlags
& ACTCTX_FLAG_RESOURCE_NAME_VALID
)
456 if ((ULONG_PTR
)actctx
->lpResourceName
>> 16)
458 len
= MultiByteToWideChar(CP_ACP
, 0, actctx
->lpResourceName
, -1, NULL
, 0);
459 resname
= HeapAlloc(GetProcessHeap(), 0, len
* sizeof(WCHAR
));
460 if (!resname
) goto done
;
461 MultiByteToWideChar(CP_ACP
, 0, actctx
->lpResourceName
, -1, resname
, len
);
462 actw
.lpResourceName
= resname
;
464 else actw
.lpResourceName
= (LPCWSTR
)actctx
->lpResourceName
;
466 if (actw
.dwFlags
& ACTCTX_FLAG_APPLICATION_NAME_VALID
)
468 len
= MultiByteToWideChar(CP_ACP
, 0, actctx
->lpApplicationName
, -1, NULL
, 0);
469 appname
= HeapAlloc(GetProcessHeap(), 0, len
* sizeof(WCHAR
));
470 if (!appname
) goto done
;
471 MultiByteToWideChar(CP_ACP
, 0, actctx
->lpApplicationName
, -1, appname
, len
);
472 actw
.lpApplicationName
= appname
;
474 if (actw
.dwFlags
& ACTCTX_FLAG_HMODULE_VALID
)
475 actw
.hModule
= actctx
->hModule
;
477 ret
= CreateActCtxW(&actw
);
480 HeapFree(GetProcessHeap(), 0, src
);
481 HeapFree(GetProcessHeap(), 0, assdir
);
482 HeapFree(GetProcessHeap(), 0, resname
);
483 HeapFree(GetProcessHeap(), 0, appname
);
487 /***********************************************************************
488 * FindActCtxSectionStringA (KERNEL32.@)
490 BOOL WINAPI
FindActCtxSectionStringA( DWORD flags
, const GUID
*guid
, ULONG id
, const char *search
,
491 ACTCTX_SECTION_KEYED_DATA
*info
)
497 TRACE("%08lx %s %lu %s %p\n", flags
, debugstr_guid(guid
), id
, debugstr_a(search
), info
);
499 if (!search
|| !info
)
501 SetLastError(ERROR_INVALID_PARAMETER
);
504 len
= MultiByteToWideChar(CP_ACP
, 0, search
, -1, NULL
, 0);
505 searchW
= HeapAlloc(GetProcessHeap(), 0, len
* sizeof(WCHAR
));
506 MultiByteToWideChar(CP_ACP
, 0, search
, -1, searchW
, len
);
507 ret
= FindActCtxSectionStringW( flags
, guid
, id
, searchW
, info
);
508 HeapFree(GetProcessHeap(), 0, searchW
);
513 /***********************************************************************
514 * CmdBatNotification (KERNEL32.@)
516 * Notifies the system that a batch file has started or finished.
519 * bBatchRunning [I] TRUE if a batch file has started or
520 * FALSE if a batch file has finished executing.
525 BOOL WINAPI
CmdBatNotification( BOOL bBatchRunning
)
527 FIXME("%d\n", bBatchRunning
);
531 /***********************************************************************
532 * RegisterApplicationRestart (KERNEL32.@)
534 HRESULT WINAPI
RegisterApplicationRestart(PCWSTR pwzCommandLine
, DWORD dwFlags
)
536 FIXME("(%s,%ld)\n", debugstr_w(pwzCommandLine
), dwFlags
);
541 /**********************************************************************
542 * WTSGetActiveConsoleSessionId (KERNEL32.@)
544 DWORD WINAPI
WTSGetActiveConsoleSessionId(void)
547 if (!once
++) FIXME("stub\n");
548 /* Return current session id. */
549 return NtCurrentTeb()->Peb
->SessionId
;
552 /**********************************************************************
553 * GetSystemDEPPolicy (KERNEL32.@)
555 DEP_SYSTEM_POLICY_TYPE WINAPI
GetSystemDEPPolicy(void)
557 return user_shared_data
->NXSupportPolicy
;
560 /**********************************************************************
561 * SetProcessDEPPolicy (KERNEL32.@)
563 BOOL WINAPI
SetProcessDEPPolicy( DWORD flags
)
567 TRACE("%#lx\n", flags
);
569 if (flags
& PROCESS_DEP_ENABLE
)
570 dep_flags
|= MEM_EXECUTE_OPTION_DISABLE
| MEM_EXECUTE_OPTION_PERMANENT
;
571 if (flags
& PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION
)
572 dep_flags
|= MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION
;
574 return set_ntstatus( NtSetInformationProcess( GetCurrentProcess(), ProcessExecuteFlags
,
575 &dep_flags
, sizeof(dep_flags
) ) );
578 /**********************************************************************
579 * ApplicationRecoveryFinished (KERNEL32.@)
581 VOID WINAPI
ApplicationRecoveryFinished(BOOL success
)
584 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
587 /**********************************************************************
588 * ApplicationRecoveryInProgress (KERNEL32.@)
590 HRESULT WINAPI
ApplicationRecoveryInProgress(PBOOL canceled
)
592 FIXME(":%p stub\n", canceled
);
593 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
597 /**********************************************************************
598 * RegisterApplicationRecoveryCallback (KERNEL32.@)
600 HRESULT WINAPI
RegisterApplicationRecoveryCallback(APPLICATION_RECOVERY_CALLBACK callback
, PVOID param
, DWORD pingint
, DWORD flags
)
602 FIXME("%p, %p, %ld, %ld: stub, faking success\n", callback
, param
, pingint
, flags
);
606 static SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*get_logical_processor_info(void)
609 SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*info
;
611 GetLogicalProcessorInformationEx( RelationGroup
, NULL
, &size
);
612 if (GetLastError() != ERROR_INSUFFICIENT_BUFFER
) return NULL
;
613 if (!(info
= HeapAlloc( GetProcessHeap(), 0, size
))) return NULL
;
614 if (!GetLogicalProcessorInformationEx( RelationGroup
, info
, &size
))
616 HeapFree( GetProcessHeap(), 0, info
);
623 /***********************************************************************
624 * GetActiveProcessorGroupCount (KERNEL32.@)
626 WORD WINAPI
GetActiveProcessorGroupCount(void)
629 SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*info
;
633 if (!(info
= get_logical_processor_info())) return 0;
635 groups
= info
->Group
.ActiveGroupCount
;
637 HeapFree(GetProcessHeap(), 0, info
);
641 /***********************************************************************
642 * GetActiveProcessorCount (KERNEL32.@)
644 DWORD WINAPI
GetActiveProcessorCount(WORD group
)
647 SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*info
;
649 TRACE("(0x%x)\n", group
);
651 if (!(info
= get_logical_processor_info())) return 0;
653 if (group
== ALL_PROCESSOR_GROUPS
)
655 for (group
= 0; group
< info
->Group
.ActiveGroupCount
; group
++)
656 cpus
+= info
->Group
.GroupInfo
[group
].ActiveProcessorCount
;
660 if (group
< info
->Group
.ActiveGroupCount
)
661 cpus
= info
->Group
.GroupInfo
[group
].ActiveProcessorCount
;
664 HeapFree(GetProcessHeap(), 0, info
);
668 /***********************************************************************
669 * GetMaximumProcessorCount (KERNEL32.@)
671 DWORD WINAPI
GetMaximumProcessorCount(WORD group
)
674 SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*info
;
676 TRACE("(0x%x)\n", group
);
678 if (!(info
= get_logical_processor_info())) return 0;
680 if (group
== ALL_PROCESSOR_GROUPS
)
682 for (group
= 0; group
< info
->Group
.MaximumGroupCount
; group
++)
683 cpus
+= info
->Group
.GroupInfo
[group
].MaximumProcessorCount
;
687 if (group
< info
->Group
.MaximumGroupCount
)
688 cpus
= info
->Group
.GroupInfo
[group
].MaximumProcessorCount
;
691 HeapFree(GetProcessHeap(), 0, info
);
695 /***********************************************************************
696 * GetMaximumProcessorGroupCount (KERNEL32.@)
698 WORD WINAPI
GetMaximumProcessorGroupCount(void)
701 SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*info
;
705 if (!(info
= get_logical_processor_info())) return 0;
707 groups
= info
->Group
.MaximumGroupCount
;
709 HeapFree(GetProcessHeap(), 0, info
);
713 /***********************************************************************
714 * GetFirmwareEnvironmentVariableA (KERNEL32.@)
716 DWORD WINAPI
GetFirmwareEnvironmentVariableA(LPCSTR name
, LPCSTR guid
, PVOID buffer
, DWORD size
)
718 FIXME("stub: %s %s %p %lu\n", debugstr_a(name
), debugstr_a(guid
), buffer
, size
);
719 SetLastError(ERROR_INVALID_FUNCTION
);
723 /***********************************************************************
724 * GetFirmwareEnvironmentVariableW (KERNEL32.@)
726 DWORD WINAPI
GetFirmwareEnvironmentVariableW(LPCWSTR name
, LPCWSTR guid
, PVOID buffer
, DWORD size
)
728 FIXME("stub: %s %s %p %lu\n", debugstr_w(name
), debugstr_w(guid
), buffer
, size
);
729 SetLastError(ERROR_INVALID_FUNCTION
);
733 /***********************************************************************
734 * SetFirmwareEnvironmentVariableW (KERNEL32.@)
736 BOOL WINAPI
SetFirmwareEnvironmentVariableW(const WCHAR
*name
, const WCHAR
*guid
, void *buffer
, DWORD size
)
738 FIXME("stub: %s %s %p %lu\n", debugstr_w(name
), debugstr_w(guid
), buffer
, size
);
739 SetLastError(ERROR_INVALID_FUNCTION
);
743 /***********************************************************************
744 * GetFirmwareType (KERNEL32.@)
746 BOOL WINAPI
GetFirmwareType(FIRMWARE_TYPE
*type
)
751 *type
= FirmwareTypeUnknown
;
755 /**********************************************************************
756 * GetNumaNodeProcessorMask (KERNEL32.@)
758 BOOL WINAPI
GetNumaNodeProcessorMask(UCHAR node
, PULONGLONG mask
)
760 FIXME("(%c %p): stub\n", node
, mask
);
761 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
765 /**********************************************************************
766 * GetNumaAvailableMemoryNode (KERNEL32.@)
768 BOOL WINAPI
GetNumaAvailableMemoryNode(UCHAR node
, PULONGLONG available_bytes
)
770 FIXME("(%c %p): stub\n", node
, available_bytes
);
771 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
775 /**********************************************************************
776 * GetNumaAvailableMemoryNodeEx (KERNEL32.@)
778 BOOL WINAPI
GetNumaAvailableMemoryNodeEx(USHORT node
, PULONGLONG available_bytes
)
780 FIXME("(%hu %p): stub\n", node
, available_bytes
);
781 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
785 /***********************************************************************
786 * GetNumaProcessorNode (KERNEL32.@)
788 BOOL WINAPI
GetNumaProcessorNode(UCHAR processor
, PUCHAR node
)
790 TRACE("(%d, %p)\n", processor
, node
);
792 if (processor
< system_info
.NumberOfProcessors
)
799 SetLastError(ERROR_INVALID_PARAMETER
);
803 /***********************************************************************
804 * GetNumaProcessorNodeEx (KERNEL32.@)
806 BOOL WINAPI
GetNumaProcessorNodeEx(PPROCESSOR_NUMBER processor
, PUSHORT node_number
)
808 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
812 /***********************************************************************
813 * GetNumaProximityNode (KERNEL32.@)
815 BOOL WINAPI
GetNumaProximityNode(ULONG proximity_id
, PUCHAR node_number
)
817 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
821 /**********************************************************************
822 * GetProcessDEPPolicy (KERNEL32.@)
824 BOOL WINAPI
GetProcessDEPPolicy(HANDLE process
, LPDWORD flags
, PBOOL permanent
)
828 TRACE("(%p %p %p)\n", process
, flags
, permanent
);
830 if (!set_ntstatus( NtQueryInformationProcess( GetCurrentProcess(), ProcessExecuteFlags
,
831 &dep_flags
, sizeof(dep_flags
), NULL
)))
837 if (dep_flags
& MEM_EXECUTE_OPTION_DISABLE
)
838 *flags
|= PROCESS_DEP_ENABLE
;
839 if (dep_flags
& MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION
)
840 *flags
|= PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION
;
843 if (permanent
) *permanent
= (dep_flags
& MEM_EXECUTE_OPTION_PERMANENT
) != 0;
847 /***********************************************************************
848 * UnregisterApplicationRestart (KERNEL32.@)
850 HRESULT WINAPI
UnregisterApplicationRestart(void)
853 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
857 /***********************************************************************
858 * CreateUmsCompletionList (KERNEL32.@)
860 BOOL WINAPI
CreateUmsCompletionList(PUMS_COMPLETION_LIST
*list
)
862 FIXME( "%p: stub\n", list
);
863 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
867 /***********************************************************************
868 * CreateUmsThreadContext (KERNEL32.@)
870 BOOL WINAPI
CreateUmsThreadContext(PUMS_CONTEXT
*ctx
)
872 FIXME( "%p: stub\n", ctx
);
873 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
877 /***********************************************************************
878 * DeleteUmsCompletionList (KERNEL32.@)
880 BOOL WINAPI
DeleteUmsCompletionList(PUMS_COMPLETION_LIST list
)
882 FIXME( "%p: stub\n", list
);
883 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
887 /***********************************************************************
888 * DeleteUmsThreadContext (KERNEL32.@)
890 BOOL WINAPI
DeleteUmsThreadContext(PUMS_CONTEXT ctx
)
892 FIXME( "%p: stub\n", ctx
);
893 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
897 /***********************************************************************
898 * DequeueUmsCompletionListItems (KERNEL32.@)
900 BOOL WINAPI
DequeueUmsCompletionListItems(void *list
, DWORD timeout
, PUMS_CONTEXT
*ctx
)
902 FIXME( "%p,%08lx,%p: stub\n", list
, timeout
, ctx
);
903 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
907 /***********************************************************************
908 * EnterUmsSchedulingMode (KERNEL32.@)
910 BOOL WINAPI
EnterUmsSchedulingMode(UMS_SCHEDULER_STARTUP_INFO
*info
)
912 FIXME( "%p: stub\n", info
);
913 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
917 /***********************************************************************
918 * ExecuteUmsThread (KERNEL32.@)
920 BOOL WINAPI
ExecuteUmsThread(PUMS_CONTEXT ctx
)
922 FIXME( "%p: stub\n", ctx
);
923 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
927 /***********************************************************************
928 * GetCurrentUmsThread (KERNEL32.@)
930 PUMS_CONTEXT WINAPI
GetCurrentUmsThread(void)
933 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
937 /***********************************************************************
938 * GetNextUmsListItem (KERNEL32.@)
940 PUMS_CONTEXT WINAPI
GetNextUmsListItem(PUMS_CONTEXT ctx
)
942 FIXME( "%p: stub\n", ctx
);
943 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
947 /***********************************************************************
948 * GetUmsCompletionListEvent (KERNEL32.@)
950 BOOL WINAPI
GetUmsCompletionListEvent(PUMS_COMPLETION_LIST list
, HANDLE
*event
)
952 FIXME( "%p,%p: stub\n", list
, event
);
953 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
957 /***********************************************************************
958 * QueryUmsThreadInformation (KERNEL32.@)
960 BOOL WINAPI
QueryUmsThreadInformation(PUMS_CONTEXT ctx
, UMS_THREAD_INFO_CLASS
class,
961 void *buf
, ULONG length
, ULONG
*ret_length
)
963 FIXME( "%p,%08x,%p,%08lx,%p: stub\n", ctx
, class, buf
, length
, ret_length
);
964 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
968 /***********************************************************************
969 * SetUmsThreadInformation (KERNEL32.@)
971 BOOL WINAPI
SetUmsThreadInformation(PUMS_CONTEXT ctx
, UMS_THREAD_INFO_CLASS
class,
972 void *buf
, ULONG length
)
974 FIXME( "%p,%08x,%p,%08lx: stub\n", ctx
, class, buf
, length
);
975 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
979 /***********************************************************************
980 * UmsThreadYield (KERNEL32.@)
982 BOOL WINAPI
UmsThreadYield(void *param
)
984 FIXME( "%p: stub\n", param
);
985 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);