mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
- Some more PSDK compatibility fixes
- Misc cleanup... svn path=/trunk/; revision=16792
This commit is contained in:
parent
b12a9db3c1
commit
ad3464c9a6
10 changed files with 147 additions and 155 deletions
|
@ -51,7 +51,7 @@ typedef long (__stdcall * _SEHFilter_t)
|
||||||
struct __SEHPortableFrame *
|
struct __SEHPortableFrame *
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef __declspec(noreturn) void (__stdcall * _SEHHandler_t)
|
typedef void (__stdcall * _SEHHandler_t)
|
||||||
(
|
(
|
||||||
struct __SEHPortableTryLevel *
|
struct __SEHPortableTryLevel *
|
||||||
);
|
);
|
||||||
|
|
|
@ -59,6 +59,9 @@
|
||||||
#define SYMBOLIC_LINK_QUERY 0x0001
|
#define SYMBOLIC_LINK_QUERY 0x0001
|
||||||
#define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
|
#define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
|
||||||
|
|
||||||
|
/* Duplication Flags */
|
||||||
|
#define DUPLICATE_SAME_ATTRIBUTES 0x00000004
|
||||||
|
|
||||||
/* I/O Control Codes for communicating with Mailslots */
|
/* I/O Control Codes for communicating with Mailslots */
|
||||||
#define FSCTL_MAILSLOT_PEEK \
|
#define FSCTL_MAILSLOT_PEEK \
|
||||||
CTL_CODE(FILE_DEVICE_MAILSLOT, 0, METHOD_NEITHER, FILE_READ_DATA)
|
CTL_CODE(FILE_DEVICE_MAILSLOT, 0, METHOD_NEITHER, FILE_READ_DATA)
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "lpctypes.h"
|
#include "lpctypes.h"
|
||||||
#include "zwtypes.h"
|
#include "zwtypes.h"
|
||||||
#include "kdtypes.h"
|
#include "kdtypes.h"
|
||||||
|
#define _WMIKM_
|
||||||
#include <evntrace.h>
|
#include <evntrace.h>
|
||||||
|
|
||||||
/* FUNCTION TYPES ************************************************************/
|
/* FUNCTION TYPES ************************************************************/
|
||||||
|
|
|
@ -1,118 +1,118 @@
|
||||||
#ifndef _HELPER_H
|
#ifndef _HELPER_H
|
||||||
#define _HELPER_H
|
#define _HELPER_H
|
||||||
|
|
||||||
#define ROUNDUP(a,b) ((((a)+(b)-1)/(b))*(b))
|
#define ROUNDUP(a,b) ((((a)+(b)-1)/(b))*(b))
|
||||||
#define ROUNDDOWN(a,b) (((a)/(b))*(b))
|
#define ROUNDDOWN(a,b) (((a)/(b))*(b))
|
||||||
#define ROUND_UP ROUNDUP
|
#define ROUND_UP ROUNDUP
|
||||||
#define ROUND_DOWN ROUNDDOWN
|
#define ROUND_DOWN ROUNDDOWN
|
||||||
#define PAGE_ROUND_DOWN(x) (((ULONG)x)&(~(PAGE_SIZE-1)))
|
#define PAGE_ROUND_DOWN(x) (((ULONG)x)&(~(PAGE_SIZE-1)))
|
||||||
#define PAGE_ROUND_UP(x) ( (((ULONG)x)%PAGE_SIZE) ? ((((ULONG)x)&(~(PAGE_SIZE-1)))+PAGE_SIZE) : ((ULONG)x) )
|
#define PAGE_ROUND_UP(x) ( (((ULONG)x)%PAGE_SIZE) ? ((((ULONG)x)&(~(PAGE_SIZE-1)))+PAGE_SIZE) : ((ULONG)x) )
|
||||||
#define ABS_VALUE(V) (((V) < 0) ? -(V) : (V))
|
#define ABS_VALUE(V) (((V) < 0) ? -(V) : (V))
|
||||||
#define RtlRosMin(X,Y) (((X) < (Y))? (X) : (Y))
|
#define RtlRosMin(X,Y) (((X) < (Y))? (X) : (Y))
|
||||||
#define RtlRosMin3(X,Y,Z) (((X) < (Y)) ? RtlRosMin(X,Z) : RtlRosMin(Y,Z))
|
#define RtlRosMin3(X,Y,Z) (((X) < (Y)) ? RtlRosMin(X,Z) : RtlRosMin(Y,Z))
|
||||||
#define KEBUGCHECKEX(a,b,c,d,e) DbgPrint("KeBugCheckEx at %s:%i\n",__FILE__,__LINE__), KeBugCheckEx(a,b,c,d,e)
|
#define KEBUGCHECKEX(a,b,c,d,e) DbgPrint("KeBugCheckEx at %s:%i\n",__FILE__,__LINE__), KeBugCheckEx(a,b,c,d,e)
|
||||||
#define KEBUGCHECK(a) DbgPrint("KeBugCheck at %s:%i\n",__FILE__,__LINE__), KeBugCheck(a)
|
#define KEBUGCHECK(a) DbgPrint("KeBugCheck at %s:%i\n",__FILE__,__LINE__), KeBugCheck(a)
|
||||||
#define EXPORTED __declspec(dllexport)
|
#define EXPORTED __declspec(dllexport)
|
||||||
#define IMPORTED __declspec(dllimport)
|
#define IMPORTED __declspec(dllimport)
|
||||||
#define LIST_FOR_EACH(entry, head) \
|
#define LIST_FOR_EACH(entry, head) \
|
||||||
for(entry = (head)->Flink; entry != (head); entry = entry->Flink)
|
for(entry = (head)->Flink; entry != (head); entry = entry->Flink)
|
||||||
#define LIST_FOR_EACH_SAFE(tmp_entry, head, ptr, type, field) \
|
#define LIST_FOR_EACH_SAFE(tmp_entry, head, ptr, type, field) \
|
||||||
for ((tmp_entry)=(head)->Flink; (tmp_entry)!=(head) && \
|
for ((tmp_entry)=(head)->Flink; (tmp_entry)!=(head) && \
|
||||||
((ptr) = CONTAINING_RECORD(tmp_entry,type,field)) && \
|
((ptr) = CONTAINING_RECORD(tmp_entry,type,field)) && \
|
||||||
((tmp_entry) = (tmp_entry)->Flink); )
|
((tmp_entry) = (tmp_entry)->Flink); )
|
||||||
#define OPTHDROFFSET(a) ((LPVOID)((BYTE *)a + \
|
#define OPTHDROFFSET(a) ((LPVOID)((BYTE *)a + \
|
||||||
((PIMAGE_DOS_HEADER)a)->e_lfanew + \
|
((PIMAGE_DOS_HEADER)a)->e_lfanew + \
|
||||||
sizeof (IMAGE_NT_SIGNATURE) + \
|
sizeof (IMAGE_NT_SIGNATURE) + \
|
||||||
sizeof (IMAGE_FILE_HEADER)))
|
sizeof (IMAGE_FILE_HEADER)))
|
||||||
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
|
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
|
||||||
#define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m)))
|
#define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m)))
|
||||||
#define NTSTAT_SEVERITY_SHIFT 30
|
#define NTSTAT_SEVERITY_SHIFT 30
|
||||||
#define NTSTAT_SEVERITY_MASK 0x00000003
|
#define NTSTAT_SEVERITY_MASK 0x00000003
|
||||||
#define NTSTAT_FACILITY_SHIFT 16
|
#define NTSTAT_FACILITY_SHIFT 16
|
||||||
#define NTSTAT_FACILITY_MASK 0x00000FFF
|
#define NTSTAT_FACILITY_MASK 0x00000FFF
|
||||||
#define NTSTAT_CUSTOMER_MASK 0x20000000
|
#define NTSTAT_CUSTOMER_MASK 0x20000000
|
||||||
#define NT_SEVERITY(StatCode) (((StatCode) >> NTSTAT_SEVERITY_SHIFT) & NTSTAT_SEVERITY_MASK)
|
#define NT_SEVERITY(StatCode) (((StatCode) >> NTSTAT_SEVERITY_SHIFT) & NTSTAT_SEVERITY_MASK)
|
||||||
#define NT_FACILITY(StatCode) (((StatCode) >> NTSTAT_FACILITY_SHIFT) & NTSTAT_FACILITY_MASK)
|
#define NT_FACILITY(StatCode) (((StatCode) >> NTSTAT_FACILITY_SHIFT) & NTSTAT_FACILITY_MASK)
|
||||||
#define NT_CUSTOMER(StatCode) ((StatCode) & NTSTAT_CUSTOMER_MASK)
|
#define NT_CUSTOMER(StatCode) ((StatCode) & NTSTAT_CUSTOMER_MASK)
|
||||||
#define RELATIVE_TIME(wait) (-(wait))
|
#define RELATIVE_TIME(wait) (-(wait))
|
||||||
#define NANOS_TO_100NS(nanos) (((LONGLONG)(nanos)) / 100)
|
#define NANOS_TO_100NS(nanos) (((LONGLONG)(nanos)) / 100)
|
||||||
#define MICROS_TO_100NS(micros) (((LONGLONG)(micros)) * NANOS_TO_100NS(1000))
|
#define MICROS_TO_100NS(micros) (((LONGLONG)(micros)) * NANOS_TO_100NS(1000))
|
||||||
#define MILLIS_TO_100NS(milli) (((LONGLONG)(milli)) * MICROS_TO_100NS(1000))
|
#define MILLIS_TO_100NS(milli) (((LONGLONG)(milli)) * MICROS_TO_100NS(1000))
|
||||||
#define SECONDS_TO_100NS(seconds) (((LONGLONG)(seconds)) * MILLIS_TO_100NS(1000))
|
#define SECONDS_TO_100NS(seconds) (((LONGLONG)(seconds)) * MILLIS_TO_100NS(1000))
|
||||||
#define MINUTES_TO_100NS(minutes) (((LONGLONG)(minutes)) * SECONDS_TO_100NS(60))
|
#define MINUTES_TO_100NS(minutes) (((LONGLONG)(minutes)) * SECONDS_TO_100NS(60))
|
||||||
#define HOURS_TO_100NS(hours) (((LONGLONG)(hours)) * MINUTES_TO_100NS(60))
|
#define HOURS_TO_100NS(hours) (((LONGLONG)(hours)) * MINUTES_TO_100NS(60))
|
||||||
#define UNICODIZE1(x) L##x
|
#define UNICODIZE1(x) L##x
|
||||||
#define UNICODIZE(x) UNICODIZE1(x)
|
#define UNICODIZE(x) UNICODIZE1(x)
|
||||||
#define InsertAscendingListFIFO(ListHead, Type, ListEntryField, NewEntry, SortField)\
|
#define InsertAscendingListFIFO(ListHead, Type, ListEntryField, NewEntry, SortField)\
|
||||||
{\
|
{\
|
||||||
PLIST_ENTRY current;\
|
PLIST_ENTRY current;\
|
||||||
\
|
\
|
||||||
current = (ListHead)->Flink;\
|
current = (ListHead)->Flink;\
|
||||||
while (current != (ListHead))\
|
while (current != (ListHead))\
|
||||||
{\
|
{\
|
||||||
if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >\
|
if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >\
|
||||||
(NewEntry)->SortField)\
|
(NewEntry)->SortField)\
|
||||||
{\
|
{\
|
||||||
break;\
|
break;\
|
||||||
}\
|
}\
|
||||||
current = current->Flink;\
|
current = current->Flink;\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
InsertTailList(current, &((NewEntry)->ListEntryField));\
|
InsertTailList(current, &((NewEntry)->ListEntryField));\
|
||||||
}
|
}
|
||||||
|
|
||||||
#define InsertDescendingListFIFO(ListHead, Type, ListEntryField, NewEntry, SortField)\
|
#define InsertDescendingListFIFO(ListHead, Type, ListEntryField, NewEntry, SortField)\
|
||||||
{\
|
{\
|
||||||
PLIST_ENTRY current;\
|
PLIST_ENTRY current;\
|
||||||
\
|
\
|
||||||
current = (ListHead)->Flink;\
|
current = (ListHead)->Flink;\
|
||||||
while (current != (ListHead))\
|
while (current != (ListHead))\
|
||||||
{\
|
{\
|
||||||
if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField <\
|
if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField <\
|
||||||
(NewEntry)->SortField)\
|
(NewEntry)->SortField)\
|
||||||
{\
|
{\
|
||||||
break;\
|
break;\
|
||||||
}\
|
}\
|
||||||
current = current->Flink;\
|
current = current->Flink;\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
InsertTailList(current, &((NewEntry)->ListEntryField));\
|
InsertTailList(current, &((NewEntry)->ListEntryField));\
|
||||||
}
|
}
|
||||||
|
|
||||||
#define InsertAscendingList(ListHead, Type, ListEntryField, NewEntry, SortField)\
|
#define InsertAscendingList(ListHead, Type, ListEntryField, NewEntry, SortField)\
|
||||||
{\
|
{\
|
||||||
PLIST_ENTRY current;\
|
PLIST_ENTRY current;\
|
||||||
\
|
\
|
||||||
current = (ListHead)->Flink;\
|
current = (ListHead)->Flink;\
|
||||||
while (current != (ListHead))\
|
while (current != (ListHead))\
|
||||||
{\
|
{\
|
||||||
if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >=\
|
if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >=\
|
||||||
(NewEntry)->SortField)\
|
(NewEntry)->SortField)\
|
||||||
{\
|
{\
|
||||||
break;\
|
break;\
|
||||||
}\
|
}\
|
||||||
current = current->Flink;\
|
current = current->Flink;\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
InsertTailList(current, &((NewEntry)->ListEntryField));\
|
InsertTailList(current, &((NewEntry)->ListEntryField));\
|
||||||
}
|
}
|
||||||
|
|
||||||
#define InsertDescendingList(ListHead, Type, ListEntryField, NewEntry, SortField)\
|
#define InsertDescendingList(ListHead, Type, ListEntryField, NewEntry, SortField)\
|
||||||
{\
|
{\
|
||||||
PLIST_ENTRY current;\
|
PLIST_ENTRY current;\
|
||||||
\
|
\
|
||||||
current = (ListHead)->Flink;\
|
current = (ListHead)->Flink;\
|
||||||
while (current != (ListHead))\
|
while (current != (ListHead))\
|
||||||
{\
|
{\
|
||||||
if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField <=\
|
if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField <=\
|
||||||
(NewEntry)->SortField)\
|
(NewEntry)->SortField)\
|
||||||
{\
|
{\
|
||||||
break;\
|
break;\
|
||||||
}\
|
}\
|
||||||
current = current->Flink;\
|
current = current->Flink;\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
InsertTailList(current, &((NewEntry)->ListEntryField));\
|
InsertTailList(current, &((NewEntry)->ListEntryField));\
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
/* PSDK/NDK Headers */
|
/* PSDK/NDK Headers */
|
||||||
#define NTOS_MODE_USER
|
#define NTOS_MODE_USER
|
||||||
#define _KERNEL32_
|
#define _KERNEL32_
|
||||||
#define _WMIKM_
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <ndk/ntndk.h>
|
#include <ndk/ntndk.h>
|
||||||
|
|
||||||
|
|
|
@ -574,7 +574,7 @@ COMMDCB_PARAM_HANDLER(xon)
|
||||||
/* FUNCTIONS */
|
/* FUNCTIONS */
|
||||||
#define COMMDCB_PARAM(__P__) \
|
#define COMMDCB_PARAM(__P__) \
|
||||||
{ \
|
{ \
|
||||||
RTL_CONSTANT_STRING(L""#__P__ ), \
|
RTL_CONSTANT_STRING(L""UNICODIZE(#__P__ )), \
|
||||||
(ULONG_PTR)&COMMDCB_ ## __P__ ## Param \
|
(ULONG_PTR)&COMMDCB_ ## __P__ ## Param \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include <k32.h>
|
#include <k32.h>
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include "../include/debug.h"
|
||||||
|
|
||||||
#define CMD_STRING L"cmd /c "
|
#define CMD_STRING L"cmd /c "
|
||||||
|
|
||||||
|
@ -648,9 +648,7 @@ CreateProcessA(LPCSTR lpApplicationName,
|
||||||
lpStartupInfo, lpProcessInformation);
|
lpStartupInfo, lpProcessInformation);
|
||||||
|
|
||||||
/* Copy Startup Info */
|
/* Copy Startup Info */
|
||||||
DPRINT("Foo\n");
|
|
||||||
RtlMoveMemory(&StartupInfo, lpStartupInfo, sizeof(*lpStartupInfo));
|
RtlMoveMemory(&StartupInfo, lpStartupInfo, sizeof(*lpStartupInfo));
|
||||||
DPRINT("Foo\n");
|
|
||||||
|
|
||||||
/* Initialize all strings to nothing */
|
/* Initialize all strings to nothing */
|
||||||
LiveCommandLine.Buffer = NULL;
|
LiveCommandLine.Buffer = NULL;
|
||||||
|
@ -664,26 +662,22 @@ CreateProcessA(LPCSTR lpApplicationName,
|
||||||
/* Convert the Command line */
|
/* Convert the Command line */
|
||||||
if (lpCommandLine)
|
if (lpCommandLine)
|
||||||
{
|
{
|
||||||
DPRINT("Foo\n");
|
|
||||||
/* If it's too long, then we'll have a problem */
|
/* If it's too long, then we'll have a problem */
|
||||||
if ((strlen(lpCommandLine) + 1) * sizeof(WCHAR) <
|
if ((strlen(lpCommandLine) + 1) * sizeof(WCHAR) <
|
||||||
NtCurrentTeb()->StaticUnicodeString.MaximumLength)
|
NtCurrentTeb()->StaticUnicodeString.MaximumLength)
|
||||||
{
|
{
|
||||||
/* Cache it in the TEB */
|
/* Cache it in the TEB */
|
||||||
DPRINT("Foo\n");
|
|
||||||
CommandLine = Basep8BitStringToCachedUnicodeString(lpCommandLine);
|
CommandLine = Basep8BitStringToCachedUnicodeString(lpCommandLine);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Use a dynamic version */
|
/* Use a dynamic version */
|
||||||
DPRINT("Foo\n");
|
|
||||||
Basep8BitStringToLiveUnicodeString(&LiveCommandLine,
|
Basep8BitStringToLiveUnicodeString(&LiveCommandLine,
|
||||||
lpCommandLine);
|
lpCommandLine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINT("Foo\n");
|
|
||||||
/* The logic below will use CommandLine, so we must make it valid */
|
/* The logic below will use CommandLine, so we must make it valid */
|
||||||
CommandLine = &DummyString;
|
CommandLine = &DummyString;
|
||||||
}
|
}
|
||||||
|
@ -691,13 +685,11 @@ CreateProcessA(LPCSTR lpApplicationName,
|
||||||
/* Convert the Name and Directory */
|
/* Convert the Name and Directory */
|
||||||
if (lpApplicationName)
|
if (lpApplicationName)
|
||||||
{
|
{
|
||||||
DPRINT("Foo\n");
|
|
||||||
Basep8BitStringToLiveUnicodeString(&ApplicationName,
|
Basep8BitStringToLiveUnicodeString(&ApplicationName,
|
||||||
lpApplicationName);
|
lpApplicationName);
|
||||||
}
|
}
|
||||||
if (lpCurrentDirectory)
|
if (lpCurrentDirectory)
|
||||||
{
|
{
|
||||||
DPRINT("Foo\n");
|
|
||||||
Basep8BitStringToLiveUnicodeString(&CurrentDirectory,
|
Basep8BitStringToLiveUnicodeString(&CurrentDirectory,
|
||||||
lpCurrentDirectory);
|
lpCurrentDirectory);
|
||||||
}
|
}
|
||||||
|
@ -705,19 +697,16 @@ CreateProcessA(LPCSTR lpApplicationName,
|
||||||
/* Now convert Startup Strings */
|
/* Now convert Startup Strings */
|
||||||
if (lpStartupInfo->lpReserved)
|
if (lpStartupInfo->lpReserved)
|
||||||
{
|
{
|
||||||
DPRINT("Foo\n");
|
|
||||||
BasepAnsiStringToHeapUnicodeString(lpStartupInfo->lpReserved,
|
BasepAnsiStringToHeapUnicodeString(lpStartupInfo->lpReserved,
|
||||||
&StartupInfo.lpReserved);
|
&StartupInfo.lpReserved);
|
||||||
}
|
}
|
||||||
if (lpStartupInfo->lpDesktop)
|
if (lpStartupInfo->lpDesktop)
|
||||||
{
|
{
|
||||||
DPRINT("Foo\n");
|
|
||||||
BasepAnsiStringToHeapUnicodeString(lpStartupInfo->lpDesktop,
|
BasepAnsiStringToHeapUnicodeString(lpStartupInfo->lpDesktop,
|
||||||
&StartupInfo.lpDesktop);
|
&StartupInfo.lpDesktop);
|
||||||
}
|
}
|
||||||
if (lpStartupInfo->lpTitle)
|
if (lpStartupInfo->lpTitle)
|
||||||
{
|
{
|
||||||
DPRINT("Foo\n");
|
|
||||||
BasepAnsiStringToHeapUnicodeString(lpStartupInfo->lpTitle,
|
BasepAnsiStringToHeapUnicodeString(lpStartupInfo->lpTitle,
|
||||||
&StartupInfo.lpTitle);
|
&StartupInfo.lpTitle);
|
||||||
}
|
}
|
||||||
|
@ -778,6 +767,11 @@ CreateProcessW(LPCWSTR lpApplicationName,
|
||||||
PROCESS_BASIC_INFORMATION ProcessBasicInfo;
|
PROCESS_BASIC_INFORMATION ProcessBasicInfo;
|
||||||
STARTUPINFOW StartupInfo;
|
STARTUPINFOW StartupInfo;
|
||||||
ULONG Dummy;
|
ULONG Dummy;
|
||||||
|
LPWSTR BatchCommandLine;
|
||||||
|
ULONG CmdLineLength;
|
||||||
|
UNICODE_STRING CommandLineString;
|
||||||
|
LPWSTR TempBuffer;
|
||||||
|
PWCHAR Extension;
|
||||||
LPWSTR QuotedCmdLine = NULL;
|
LPWSTR QuotedCmdLine = NULL;
|
||||||
LPWSTR ScanString;
|
LPWSTR ScanString;
|
||||||
LPWSTR NullBuffer;
|
LPWSTR NullBuffer;
|
||||||
|
@ -811,7 +805,7 @@ CreateProcessW(LPCWSTR lpApplicationName,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fail on this flag, it's only valid with the WithLogonW function */
|
/* Fail on this flag, it's only valid with the WithLogonW function */
|
||||||
if (dwCreationFlags & CREATE_WITH_USERPROFILE)
|
if (dwCreationFlags & CREATE_PRESERVE_CODE_AUTHZ_LEVEL)
|
||||||
{
|
{
|
||||||
DPRINT1("Invalid flag used\n");
|
DPRINT1("Invalid flag used\n");
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
@ -835,13 +829,13 @@ CreateProcessW(LPCWSTR lpApplicationName,
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
DPRINT("Foo\n");
|
|
||||||
/*
|
/*
|
||||||
* We're going to modify and mask out flags and stuff in lpStartupInfo,
|
* We're going to modify and mask out flags and stuff in lpStartupInfo,
|
||||||
* so we'll use our own local copy for that.
|
* so we'll use our own local copy for that.
|
||||||
*/
|
*/
|
||||||
StartupInfo = *lpStartupInfo;
|
StartupInfo = *lpStartupInfo;
|
||||||
DPRINT("Foo\n");
|
|
||||||
/* FIXME: Use default Separate/Shared VDM Flag */
|
/* FIXME: Use default Separate/Shared VDM Flag */
|
||||||
|
|
||||||
/* If we are inside a Job, use Separate VDM so it won't escape the Job */
|
/* If we are inside a Job, use Separate VDM so it won't escape the Job */
|
||||||
|
@ -854,7 +848,7 @@ CreateProcessW(LPCWSTR lpApplicationName,
|
||||||
CREATE_SEPARATE_WOW_VDM;
|
CREATE_SEPARATE_WOW_VDM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DPRINT("Foo\n");
|
|
||||||
/*
|
/*
|
||||||
* According to some sites, ShellExecuteEx uses an undocumented flag to
|
* According to some sites, ShellExecuteEx uses an undocumented flag to
|
||||||
* send private handle data (such as HMONITOR or HICON). See:
|
* send private handle data (such as HMONITOR or HICON). See:
|
||||||
|
@ -866,21 +860,21 @@ CreateProcessW(LPCWSTR lpApplicationName,
|
||||||
{
|
{
|
||||||
StartupInfo.dwFlags &= ~STARTF_USESTDHANDLES;
|
StartupInfo.dwFlags &= ~STARTF_USESTDHANDLES;
|
||||||
}
|
}
|
||||||
DPRINT("Foo\n");
|
|
||||||
/* Start by zeroing out the fields */
|
/* Start by zeroing out the fields */
|
||||||
RtlZeroMemory(lpProcessInformation, sizeof(PROCESS_INFORMATION));
|
RtlZeroMemory(lpProcessInformation, sizeof(PROCESS_INFORMATION));
|
||||||
DPRINT("Foo\n");
|
|
||||||
/* Easy stuff first, convert the process priority class */
|
/* Easy stuff first, convert the process priority class */
|
||||||
PriorityClass.Foreground = FALSE;
|
PriorityClass.Foreground = FALSE;
|
||||||
PriorityClass.PriorityClass = BasepConvertPriorityClass(dwCreationFlags);
|
PriorityClass.PriorityClass = BasepConvertPriorityClass(dwCreationFlags);
|
||||||
DPRINT("Foo\n");
|
|
||||||
/* Convert the environment */
|
/* Convert the environment */
|
||||||
if(lpEnvironment && !(dwCreationFlags & CREATE_UNICODE_ENVIRONMENT))
|
if(lpEnvironment && !(dwCreationFlags & CREATE_UNICODE_ENVIRONMENT))
|
||||||
{
|
{
|
||||||
lpEnvironment = BasepConvertUnicodeEnvironment(lpEnvironment);
|
lpEnvironment = BasepConvertUnicodeEnvironment(lpEnvironment);
|
||||||
if (!lpEnvironment) return FALSE;
|
if (!lpEnvironment) return FALSE;
|
||||||
}
|
}
|
||||||
DPRINT("Foo\n");
|
|
||||||
/* Get the application name and do all the proper formating necessary */
|
/* Get the application name and do all the proper formating necessary */
|
||||||
GetAppName:
|
GetAppName:
|
||||||
/* See if we have an application name (oh please let us have one!) */
|
/* See if we have an application name (oh please let us have one!) */
|
||||||
|
@ -907,7 +901,7 @@ GetAppName:
|
||||||
/* Advance past quote */
|
/* Advance past quote */
|
||||||
ScanString++;
|
ScanString++;
|
||||||
lpApplicationName = ScanString;
|
lpApplicationName = ScanString;
|
||||||
DPRINT("Foo\n");
|
|
||||||
/* Find the closing quote */
|
/* Find the closing quote */
|
||||||
while (*ScanString)
|
while (*ScanString)
|
||||||
{
|
{
|
||||||
|
@ -918,7 +912,7 @@ GetAppName:
|
||||||
FoundQuotes = TRUE;
|
FoundQuotes = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
DPRINT("Foo\n");
|
|
||||||
/* Keep looking */
|
/* Keep looking */
|
||||||
ScanString++;
|
ScanString++;
|
||||||
NullBuffer = ScanString;
|
NullBuffer = ScanString;
|
||||||
|
@ -930,7 +924,7 @@ GetAppName:
|
||||||
WhiteScan:
|
WhiteScan:
|
||||||
/* Reset the pointer */
|
/* Reset the pointer */
|
||||||
lpApplicationName = lpCommandLine;
|
lpApplicationName = lpCommandLine;
|
||||||
DPRINT("Foo\n");
|
|
||||||
/* Find whitespace of Tab */
|
/* Find whitespace of Tab */
|
||||||
while (*ScanString)
|
while (*ScanString)
|
||||||
{
|
{
|
||||||
|
@ -940,7 +934,7 @@ GetAppName:
|
||||||
NullBuffer = ScanString;
|
NullBuffer = ScanString;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
DPRINT("Foo\n");
|
|
||||||
/* Keep looking */
|
/* Keep looking */
|
||||||
ScanString++;
|
ScanString++;
|
||||||
NullBuffer = ScanString;
|
NullBuffer = ScanString;
|
||||||
|
@ -1078,8 +1072,8 @@ GetAppName:
|
||||||
case STATUS_INVALID_IMAGE_PROTECT:
|
case STATUS_INVALID_IMAGE_PROTECT:
|
||||||
case STATUS_INVALID_IMAGE_NOT_MZ:
|
case STATUS_INVALID_IMAGE_NOT_MZ:
|
||||||
|
|
||||||
/* If it's a DOS app, use VDM */
|
/* If it's a DOS app, use VDM
|
||||||
//if ((BasepCheckDosApp(&ApplicationName)))
|
if ((BasepCheckDosApp(&ApplicationName))) */
|
||||||
{
|
{
|
||||||
DPRINT1("Launching VDM...\n");
|
DPRINT1("Launching VDM...\n");
|
||||||
RtlFreeHeap(GetProcessHeap(), 0, NameBuffer);
|
RtlFreeHeap(GetProcessHeap(), 0, NameBuffer);
|
||||||
|
@ -1097,12 +1091,8 @@ GetAppName:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* It's a batch file */
|
/* It's a batch file */
|
||||||
LPWSTR BatchCommandLine;
|
Extension = &ApplicationName.Buffer[ApplicationName.Length /
|
||||||
ULONG CmdLineLength;
|
sizeof(WCHAR) - 4];
|
||||||
UNICODE_STRING CommandLineString;
|
|
||||||
LPWSTR TempBuffer;
|
|
||||||
PWCHAR Extension =
|
|
||||||
&ApplicationName.Buffer[ApplicationName.Length / sizeof(WCHAR) - 4];
|
|
||||||
|
|
||||||
/* Make sure the extensions are correct */
|
/* Make sure the extensions are correct */
|
||||||
if (_wcsnicmp(Extension, L".bat", 4) && _wcsnicmp(Extension, L".cmd", 4))
|
if (_wcsnicmp(Extension, L".bat", 4) && _wcsnicmp(Extension, L".cmd", 4))
|
||||||
|
|
|
@ -68,7 +68,7 @@ void __stdcall _SEHLocalUnwind
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
__declspec(noreturn) void __cdecl _SEHCallHandler
|
void __cdecl _SEHCallHandler
|
||||||
(
|
(
|
||||||
_SEHPortableFrame_t * frame,
|
_SEHPortableFrame_t * frame,
|
||||||
_SEHPortableTryLevel_t * trylevel
|
_SEHPortableTryLevel_t * trylevel
|
||||||
|
|
|
@ -172,7 +172,7 @@ extern "C" {
|
||||||
#define BELOW_NORMAL_PRIORITY_CLASS 0x00004000
|
#define BELOW_NORMAL_PRIORITY_CLASS 0x00004000
|
||||||
#define ABOVE_NORMAL_PRIORITY_CLASS 0x00008000
|
#define ABOVE_NORMAL_PRIORITY_CLASS 0x00008000
|
||||||
#define CREATE_BREAKAWAY_FROM_JOB 0x01000000
|
#define CREATE_BREAKAWAY_FROM_JOB 0x01000000
|
||||||
#define CREATE_WITH_USERPROFILE 0x02000000
|
#define CREATE_PRESERVE_CODE_AUTHZ_LEVEL 0x02000000
|
||||||
#define CREATE_DEFAULT_ERROR_MODE 0x04000000
|
#define CREATE_DEFAULT_ERROR_MODE 0x04000000
|
||||||
#define CREATE_NO_WINDOW 0x08000000
|
#define CREATE_NO_WINDOW 0x08000000
|
||||||
#define PROFILE_USER 0x10000000
|
#define PROFILE_USER 0x10000000
|
||||||
|
|
|
@ -355,7 +355,6 @@ typedef DWORD FLONG;
|
||||||
/* also in ddk/winddk.h */
|
/* also in ddk/winddk.h */
|
||||||
#define DUPLICATE_CLOSE_SOURCE 0x00000001
|
#define DUPLICATE_CLOSE_SOURCE 0x00000001
|
||||||
#define DUPLICATE_SAME_ACCESS 0x00000002
|
#define DUPLICATE_SAME_ACCESS 0x00000002
|
||||||
#define DUPLICATE_SAME_ATTRIBUTES 0x00000004
|
|
||||||
/* end winddk.k */
|
/* end winddk.k */
|
||||||
|
|
||||||
#define MAILSLOT_NO_MESSAGE ((DWORD)-1)
|
#define MAILSLOT_NO_MESSAGE ((DWORD)-1)
|
||||||
|
|
Loading…
Reference in a new issue