ReactOS 0.4.16-dev-2135-g2f5a67f
winehacks.h File Reference

Go to the source code of this file.

Classes

struct  _PROCESS_MACHINE_INFORMATION
 

Macros

#define RTL_CONSTANT_STRING(s)   { sizeof(s) - sizeof(s[0]), sizeof(s), (void*)s }
 
#define NT_SUCCESS(Status)   (((NTSTATUS)(Status)) >= 0)
 

Typedefs

typedef voidHPCON
 
typedef enum _MACHINE_ATTRIBUTES MACHINE_ATTRIBUTES
 
typedef struct _PROCESS_MACHINE_INFORMATION PROCESS_MACHINE_INFORMATION
 

Enumerations

enum  _MACHINE_ATTRIBUTES { UserEnabled = 0x00000001 , KernelEnabled = 0x00000002 , Wow64Container = 0x00000004 }
 

Functions

WINBASEAPI BOOL WINAPI CloseConsoleHandle (HANDLE)
 
WINBASEAPI HANDLE WINAPI DuplicateConsoleHandle (HANDLE, DWORD, BOOL, DWORD)
 
WINBASEAPI HANDLE WINAPI GetConsoleInputWaitHandle (void)
 

Macro Definition Documentation

◆ NT_SUCCESS

#define NT_SUCCESS (   Status)    (((NTSTATUS)(Status)) >= 0)

Definition at line 11 of file winehacks.h.

◆ RTL_CONSTANT_STRING

#define RTL_CONSTANT_STRING (   s)    { sizeof(s) - sizeof(s[0]), sizeof(s), (void*)s }

Definition at line 10 of file winehacks.h.

Typedef Documentation

◆ HPCON

typedef void* HPCON

Definition at line 14 of file winehacks.h.

◆ MACHINE_ATTRIBUTES

◆ PROCESS_MACHINE_INFORMATION

Enumeration Type Documentation

◆ _MACHINE_ATTRIBUTES

Enumerator
UserEnabled 
KernelEnabled 
Wow64Container 

Definition at line 16 of file winehacks.h.

17{
18 UserEnabled = 0x00000001,
19 KernelEnabled = 0x00000002,
20 Wow64Container = 0x00000004,
@ KernelEnabled
Definition: winehacks.h:19
@ Wow64Container
Definition: winehacks.h:20
@ UserEnabled
Definition: winehacks.h:18
enum _MACHINE_ATTRIBUTES MACHINE_ATTRIBUTES

Function Documentation

◆ CloseConsoleHandle()

WINBASEAPI BOOL WINAPI CloseConsoleHandle ( HANDLE  hHandle)

Definition at line 1144 of file console.c.

1145{
1146 CONSOLE_API_MESSAGE ApiMessage;
1147 PCONSOLE_CLOSEHANDLE CloseHandleRequest = &ApiMessage.Data.CloseHandleRequest;
1148
1149 CloseHandleRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle;
1150 CloseHandleRequest->Handle = hHandle;
1151
1153 NULL,
1155 sizeof(*CloseHandleRequest));
1156 if (!NT_SUCCESS(ApiMessage.Status))
1157 {
1158 BaseSetLastNTError(ApiMessage.Status);
1159 return FALSE;
1160 }
1161
1162 return TRUE;
1163}
#define NtCurrentPeb()
Definition: FLS.c:22
@ ConsolepCloseHandle
Definition: conmsg.h:55
#define CONSRV_SERVERDLL_INDEX
Definition: conmsg.h:15
#define CSR_CREATE_API_NUMBER(ServerId, ApiId)
Definition: csrmsg.h:37
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:167
NTSTATUS NTAPI CsrClientCallServer(_Inout_ PCSR_API_MESSAGE ApiMessage, _Inout_opt_ PCSR_CAPTURE_BUFFER CaptureBuffer, _In_ CSR_API_NUMBER ApiNumber, _In_ ULONG DataLength)
Definition: connect.c:366
CONSOLE_CLOSEHANDLE CloseHandleRequest
Definition: conmsg.h:935
union _CONSOLE_API_MESSAGE::@3761 Data
HANDLE ConsoleHandle
Definition: conmsg.h:626
NTSTATUS Status
Definition: csrmsg.h:110

Referenced by CloseHandle(), and test_DuplicateConsoleHandle().

◆ DuplicateConsoleHandle()

WINBASEAPI HANDLE WINAPI DuplicateConsoleHandle ( HANDLE  hSourceHandle,
DWORD  dwDesiredAccess,
BOOL  bInheritHandle,
DWORD  dwOptions 
)

Definition at line 424 of file console.c.

428{
429 CONSOLE_API_MESSAGE ApiMessage;
430 PCONSOLE_DUPLICATEHANDLE DuplicateHandleRequest = &ApiMessage.Data.DuplicateHandleRequest;
431
434 (dwDesiredAccess & ~(GENERIC_READ | GENERIC_WRITE))) )
435 {
438 }
439
440 DuplicateHandleRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle;
441 DuplicateHandleRequest->SourceHandle = hSourceHandle;
442 DuplicateHandleRequest->DesiredAccess = dwDesiredAccess;
443 DuplicateHandleRequest->InheritHandle = bInheritHandle;
444 DuplicateHandleRequest->Options = dwOptions;
445
447 NULL,
449 sizeof(*DuplicateHandleRequest));
450 if (!NT_SUCCESS(ApiMessage.Status))
451 {
452 BaseSetLastNTError(ApiMessage.Status);
454 }
455
456 return DuplicateHandleRequest->TargetHandle;
457}
@ ConsolepDuplicateHandle
Definition: conmsg.h:52
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GENERIC_READ
Definition: compat.h:135
#define GENERIC_WRITE
Definition: nt_native.h:90
static BOOL bInheritHandle
Definition: pipe.c:82
DWORD dwOptions
Definition: solitaire.cpp:25
CONSOLE_DUPLICATEHANDLE DuplicateHandleRequest
Definition: conmsg.h:937
#define DUPLICATE_SAME_ACCESS
#define DUPLICATE_CLOSE_SOURCE

Referenced by DuplicateHandle(), and test_DuplicateConsoleHandle().

◆ GetConsoleInputWaitHandle()