Merge branch 'master' of https://github.com/FreeRDP/FreeRDP into android_sound

This commit is contained in:
Armin Novak 2013-09-27 11:46:48 +02:00
commit 2269cbe155
36 changed files with 2084 additions and 658 deletions

View File

@ -123,7 +123,14 @@ if(CMAKE_COMPILER_IS_GNUCC)
else() else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
endif() endif()
else()
if(CMAKE_POSITION_INDEPENDENT_CODE)
if(${CMAKE_VERSION} VERSION_LESS 2.8.9)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif()
endif()
endif() endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
CHECK_C_COMPILER_FLAG (-Wno-unused-result Wno-unused-result) CHECK_C_COMPILER_FLAG (-Wno-unused-result Wno-unused-result)
if(Wno-unused-result) if(Wno-unused-result)
@ -197,7 +204,7 @@ if(WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUNICODE -D_UNICODE") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUNICODE -D_UNICODE")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_WIN32_WINNT=0x0501") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_WIN32_WINNT=0x0501")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWIN32_LEAN_AND_MEAN") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWIN32_LEAN_AND_MEAN")
endif() endif()
if(IOS) if(IOS)
@ -232,26 +239,22 @@ endif()
# Mac OS X # Mac OS X
if(APPLE) if(APPLE)
if(IOS) if(IOS)
if (NOT FREERDP_IOS_EXTERNAL_SSL_PATH) if (NOT FREERDP_IOS_EXTERNAL_SSL_PATH)
message(STATUS "FREERDP_IOS_EXTERNAL_SSL_PATH not set! Required if openssl is not found in the iOS SDK (which usually isn't") message(STATUS "FREERDP_IOS_EXTERNAL_SSL_PATH not set! Required if openssl is not found in the iOS SDK (which usually isn't")
endif()
set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${FREERDP_IOS_EXTERNAL_SSL_PATH})
set_property(GLOBAL PROPERTY XCODE_ATTRIBUTE_SKIP_INSTALL YES)
else()
if(NOT DEFINED CMAKE_OSX_DEPLOYMENT_TARGET OR CMAKE_OSX_DEPLOYMENT_TARGET MATCHES "")
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6 CACHE STRING "OSX deployment target" FORCE)
endif() endif()
set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${FREERDP_IOS_EXTERNAL_SSL_PATH})
set_property(GLOBAL PROPERTY XCODE_ATTRIBUTE_SKIP_INSTALL YES)
else(IOS)
if(NOT DEFINED CMAKE_OSX_ARCHITECTURES) if(NOT DEFINED CMAKE_OSX_ARCHITECTURES)
set(CMAKE_OSX_ARCHITECTURES i386 x86_64) set(CMAKE_OSX_ARCHITECTURES i386 x86_64)
endif() endif()
if(IS_DIRECTORY /opt/local/include) if(IS_DIRECTORY /opt/local/include)
include_directories(/opt/local/include) include_directories(/opt/local/include)
link_directories(/opt/local/lib) link_directories(/opt/local/lib)
endif() endif()
endif() endif(IOS)
# Temporarily disabled, causes the cmake script to be reexecuted, causing the compilation to fail. # Temporarily disabled, causes the cmake script to be reexecuted, causing the compilation to fail.
# Workaround: specify the parameter in the command-line # Workaround: specify the parameter in the command-line
@ -259,11 +262,11 @@ if(APPLE)
# set(CMAKE_C_COMPILER "clang") # set(CMAKE_C_COMPILER "clang")
# endif() # endif()
if (WITH_VERBOSE) if (WITH_VERBOSE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -v") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -v")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -v") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -v")
endif() endif()
endif() endif(APPLE)
# Android # Android
if(ANDROID) if(ANDROID)

View File

@ -453,8 +453,6 @@ static void rdpsnd_alsa_set_volume(rdpsndDevicePlugin* device, UINT32 value)
long volume_max; long volume_max;
long volume_left; long volume_left;
long volume_right; long volume_right;
int percent_left;
int percent_right;
snd_mixer_elem_t* elem; snd_mixer_elem_t* elem;
rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*) device; rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*) device;
@ -464,9 +462,6 @@ static void rdpsnd_alsa_set_volume(rdpsndDevicePlugin* device, UINT32 value)
left = (value & 0xFFFF); left = (value & 0xFFFF);
right = ((value >> 16) & 0xFFFF); right = ((value >> 16) & 0xFFFF);
percent_left = (left * 100) / 0xFFFF;
percent_right = (right * 100) / 0xFFFF;
for (elem = snd_mixer_first_elem(alsa->mixer_handle); elem; elem = snd_mixer_elem_next(elem)) for (elem = snd_mixer_first_elem(alsa->mixer_handle); elem; elem = snd_mixer_elem_next(elem))
{ {
if (snd_mixer_selem_has_playback_volume(elem)) if (snd_mixer_selem_has_playback_volume(elem))
@ -613,8 +608,6 @@ static void rdpsnd_alsa_wave_play(rdpsndDevicePlugin* device, RDPSND_WAVE* wave)
wave->wTimeStampB = wave->wTimeStampA + wave->wLatency; wave->wTimeStampB = wave->wTimeStampA + wave->wLatency;
//fprintf(stderr, "wTimeStampA: %d wTimeStampB: %d wLatency: %d\n", wave->wTimeStampA, wave->wTimeStampB, wave->wLatency); //fprintf(stderr, "wTimeStampA: %d wTimeStampB: %d wLatency: %d\n", wave->wTimeStampA, wave->wTimeStampB, wave->wLatency);
device->WaveConfirm(device, wave);
} }
static COMMAND_LINE_ARGUMENT_A rdpsnd_alsa_args[] = static COMMAND_LINE_ARGUMENT_A rdpsnd_alsa_args[] =
@ -633,7 +626,7 @@ static int rdpsnd_alsa_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV*
flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON; flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON;
status = CommandLineParseArgumentsA(args->argc, (const char**) args->argv, rdpsnd_alsa_args, flags, alsa, NULL, NULL); status = CommandLineParseArgumentsA(args->argc, (const char**) args->argv, rdpsnd_alsa_args, flags, alsa, NULL, NULL);
if (status) if (status < 0)
return status; return status;
arg = rdpsnd_alsa_args; arg = rdpsnd_alsa_args;

View File

@ -548,9 +548,10 @@ static void rdpsnd_pulse_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV
status = CommandLineParseArgumentsA(args->argc, (const char**) args->argv, status = CommandLineParseArgumentsA(args->argc, (const char**) args->argv,
rdpsnd_pulse_args, flags, pulse, NULL, NULL); rdpsnd_pulse_args, flags, pulse, NULL, NULL);
if (status < 0)
return;
arg = rdpsnd_pulse_args; arg = rdpsnd_pulse_args;
do do
{ {
if (!(arg->Flags & COMMAND_LINE_VALUE_PRESENT)) if (!(arg->Flags & COMMAND_LINE_VALUE_PRESENT))

View File

@ -447,8 +447,8 @@ static void rdpsnd_recv_wave_pdu(rdpsndPlugin* rdpsnd, wStream* s)
{ {
wave->wTimeStampB = rdpsnd->wTimeStamp + wave->wAudioLength + TIME_DELAY_MS; wave->wTimeStampB = rdpsnd->wTimeStamp + wave->wAudioLength + TIME_DELAY_MS;
wave->wLocalTimeB = wave->wLocalTimeA + wave->wAudioLength + TIME_DELAY_MS; wave->wLocalTimeB = wave->wLocalTimeA + wave->wAudioLength + TIME_DELAY_MS;
rdpsnd->device->WaveConfirm(rdpsnd->device, wave);
} }
rdpsnd->device->WaveConfirm(rdpsnd->device, wave);
} }
static void rdpsnd_recv_close_pdu(rdpsndPlugin* rdpsnd) static void rdpsnd_recv_close_pdu(rdpsndPlugin* rdpsnd)
@ -599,6 +599,8 @@ static void rdpsnd_process_addin_args(rdpsndPlugin* rdpsnd, ADDIN_ARGV* args)
status = CommandLineParseArgumentsA(args->argc, (const char**) args->argv, status = CommandLineParseArgumentsA(args->argc, (const char**) args->argv,
rdpsnd_args, flags, rdpsnd, NULL, NULL); rdpsnd_args, flags, rdpsnd, NULL, NULL);
if (status < 0)
return;
arg = rdpsnd_args; arg = rdpsnd_args;

View File

@ -315,7 +315,7 @@ int DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints)
{ {
char* name; char* name;
char* path; char* path;
int i, length; int i, length, ck;
RDPDR_SMARTCARD* device; RDPDR_SMARTCARD* device;
SMARTCARD_DEVICE* smartcard; SMARTCARD_DEVICE* smartcard;
@ -323,41 +323,49 @@ int DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints)
name = device->Name; name = device->Name;
path = device->Path; path = device->Path;
if (name) /* TODO: check if server supports sc redirect (version 5.1) */
smartcard = (SMARTCARD_DEVICE*) malloc(sizeof(SMARTCARD_DEVICE));
ZeroMemory(smartcard, sizeof(SMARTCARD_DEVICE));
smartcard->device.type = RDPDR_DTYP_SMARTCARD;
smartcard->device.name = "SCARD";
smartcard->device.IRPRequest = smartcard_irp_request;
smartcard->device.Free = smartcard_free;
length = strlen(smartcard->device.name);
smartcard->device.data = Stream_New(NULL, length + 1);
Stream_Write(smartcard->device.data, "SCARD", 6);
smartcard->name = NULL;
smartcard->path = NULL;
if (path)
{ {
/* TODO: check if server supports sc redirect (version 5.1) */
smartcard = (SMARTCARD_DEVICE*) malloc(sizeof(SMARTCARD_DEVICE));
ZeroMemory(smartcard, sizeof(SMARTCARD_DEVICE));
smartcard->device.type = RDPDR_DTYP_SMARTCARD;
smartcard->device.name = "SCARD";
smartcard->device.IRPRequest = smartcard_irp_request;
smartcard->device.Free = smartcard_free;
length = strlen(smartcard->device.name);
smartcard->device.data = Stream_New(NULL, length + 1);
for (i = 0; i <= length; i++)
Stream_Write_UINT8(smartcard->device.data, name[i] < 0 ? '_' : name[i]);
smartcard->path = path; smartcard->path = path;
smartcard->name = name;
smartcard->pIrpList = (PSLIST_HEADER) _aligned_malloc(sizeof(SLIST_HEADER), MEMORY_ALLOCATION_ALIGNMENT);
InitializeSListHead(smartcard->pIrpList);
smartcard->irpEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
smartcard->stopEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
smartcard->thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) smartcard_thread_func,
smartcard, CREATE_SUSPENDED, NULL);
smartcard->CompletionIds = list_new();
smartcard->CompletionIdsMutex = CreateMutex(NULL, FALSE, NULL);
pEntryPoints->RegisterDevice(pEntryPoints->devman, (DEVICE*) smartcard);
ResumeThread(smartcard->thread);
} }
else if (name)
{
if (1 == sscanf(name, "%d", &ck))
smartcard->path = name;
else
smartcard->name = name;
}
smartcard->pIrpList = (PSLIST_HEADER) _aligned_malloc(sizeof(SLIST_HEADER), MEMORY_ALLOCATION_ALIGNMENT);
InitializeSListHead(smartcard->pIrpList);
smartcard->irpEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
smartcard->stopEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
smartcard->thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) smartcard_thread_func,
smartcard, CREATE_SUSPENDED, NULL);
smartcard->CompletionIds = list_new();
smartcard->CompletionIdsMutex = CreateMutex(NULL, FALSE, NULL);
pEntryPoints->RegisterDevice(pEntryPoints->devman, (DEVICE*) smartcard);
ResumeThread(smartcard->thread);
return 0; return 0;
} }

File diff suppressed because it is too large Load Diff

View File

@ -151,7 +151,7 @@ endif()
COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/$(CONFIGURATION)/${MODULE_OUTPUT_NAME}.framework/Versions/${MACOSX_BUNDLE_SHORT_VERSION_STRING}/Resources) COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/$(CONFIGURATION)/${MODULE_OUTPUT_NAME}.framework/Versions/${MACOSX_BUNDLE_SHORT_VERSION_STRING}/Resources)
# Compile the .xib files using the 'ibtool' program with the destination being the app package # Compile the .xib files using the 'ibtool' program with the destination being the app package
foreach(xib ${${MODULE_NAME}_XIBS}) foreach(xib ${${MODULE_PREFIX}_XIBS})
get_filename_component(XIB_WE ${xib} NAME_WE) get_filename_component(XIB_WE ${xib} NAME_WE)
add_custom_command (TARGET ${MODULE_NAME} POST_BUILD add_custom_command (TARGET ${MODULE_NAME} POST_BUILD

View File

@ -138,7 +138,21 @@ struct rgba_data
e.embed = TRUE; e.embed = TRUE;
e.handle = (void*) self; e.handle = (void*) self;
PubSub_OnEmbedWindow(context->pubSub, context, &e); PubSub_OnEmbedWindow(context->pubSub, context, &e);
[self setViewSize :instance->settings->DesktopWidth :instance->settings->DesktopHeight];
NSScreen *screen = [[NSScreen screens] objectAtIndex:0];
NSRect screenFrame = [screen frame];
if(instance->settings->Fullscreen)
{
instance->settings->DesktopWidth = screenFrame.size.width;
instance->settings->DesktopHeight = screenFrame.size.height;
}
[self setViewSize :instance->settings->DesktopWidth :instance->settings->DesktopHeight];
if(instance->settings->Fullscreen)
[[self window] toggleFullScreen:nil];
mfc->thread = CreateThread(NULL, 0, mac_client_thread, (void*) context, 0, &mfc->mainThreadId); mfc->thread = CreateThread(NULL, 0, mac_client_thread, (void*) context, 0, &mfc->mainThreadId);
@ -472,20 +486,23 @@ DWORD mac_client_thread(void* param)
NSPoint loc = [event locationInWindow]; NSPoint loc = [event locationInWindow];
int x = (int) loc.x; int x = (int) loc.x;
int y = (int) loc.y; int y = (int) loc.y;
y = height - y; y = height - y;
flags = PTR_FLAGS_WHEEL; flags = PTR_FLAGS_WHEEL;
if ([event deltaY] < 0) /* 1 event = 120 units */
flags |= PTR_FLAGS_WHEEL_NEGATIVE | 0x0088; int units = [event deltaY] * 120;
else
flags |= 0x0078; /* send out all accumulated rotations */
while(units != 0)
x += (int) [event deltaX]; {
y += (int) [event deltaY]; /* limit to maximum value in WheelRotationMask (9bit signed value) */
int step = MIN(MAX(-256, units), 255);
instance->input->MouseEvent(instance->input, flags, x, y);
instance->input->MouseEvent(instance->input, flags | ((UINT16)step & WheelRotationMask), x, y);
units -= step;
}
} }
/** ********************************************************************* /** *********************************************************************
@ -748,34 +765,25 @@ DWORD mac_client_thread(void* param)
// store current dimensions // store current dimensions
width = w; width = w;
height = h; height = h;
// compute difference between window and client area
NSRect outerRect = [[self window] frame];
NSRect innerRect = [self frame];
int widthDiff = outerRect.size.width - innerRect.size.width;
int heightDiff = outerRect.size.height - innerRect.size.height;
// we are not in RemoteApp mode, disable resizing
outerRect.size.width = w + widthDiff;
outerRect.size.height = h + heightDiff;
[[self window] setMaxSize:outerRect.size];
[[self window] setMinSize:outerRect.size];
@try
{
[[self window] setFrame:outerRect display:YES];
}
@catch (NSException * e) {
NSLog(@"Exception: %@", e);
}
@finally {
}
// set client area to specified dimensions // set client area to specified dimensions
NSRect innerRect;
innerRect.origin.x = 0;
innerRect.origin.y = 0;
innerRect.size.width = w; innerRect.size.width = w;
innerRect.size.height = h; innerRect.size.height = h;
[self setFrame:innerRect]; [self setFrame:innerRect];
// calculate window of same size, but keep position
NSRect outerRect = [[self window] frame];
outerRect.size = [[self window] frameRectForContentRect:innerRect].size;
// we are not in RemoteApp mode, disable larger than resolution
[[self window] setContentMaxSize:innerRect.size];
// set window to given area
[[self window] setFrame:outerRect display:YES];
} }
/************************************************************************ /************************************************************************

View File

@ -239,7 +239,7 @@
<int key="NSCellFlags2">272630784</int> <int key="NSCellFlags2">272630784</int>
<string key="NSContents"/> <string key="NSContents"/>
<reference key="NSSupport" ref="461722316"/> <reference key="NSSupport" ref="461722316"/>
<string key="NSPlaceholderString">billg</string> <string key="NSPlaceholderString">Username</string>
<string key="NSCellIdentifier">_NS:9</string> <string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="385178766"/> <reference key="NSControlView" ref="385178766"/>
<bool key="NSDrawsBackground">YES</bool> <bool key="NSDrawsBackground">YES</bool>

View File

@ -9,6 +9,7 @@
#import "AppDelegate.h" #import "AppDelegate.h"
#import "MacFreeRDP/mfreerdp.h" #import "MacFreeRDP/mfreerdp.h"
#import "MacFreeRDP/mf_client.h" #import "MacFreeRDP/mf_client.h"
#import <freerdp/client/cmdline.h>
static AppDelegate* _singleDelegate = nil; static AppDelegate* _singleDelegate = nil;
void AppDelegate_EmbedWindowEventHandler(void* context, EmbedWindowEventArgs* e); void AppDelegate_EmbedWindowEventHandler(void* context, EmbedWindowEventArgs* e);
@ -90,6 +91,7 @@ void AppDelegate_ErrorInfoEventHandler(void* ctx, ErrorInfoEventArgs* e);
} }
status = freerdp_client_parse_command_line(context, argc, argv); status = freerdp_client_parse_command_line(context, argc, argv);
status = freerdp_client_command_line_status_print(context->argc, context->argv, context->settings, status);
return status; return status;
} }

View File

@ -33,6 +33,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <tchar.h> #include <tchar.h>
#include <assert.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef _MSC_VER #ifdef _MSC_VER

View File

@ -23,8 +23,10 @@
#include <freerdp/client.h> #include <freerdp/client.h>
#include <freerdp/addin.h>
#include <freerdp/client/file.h> #include <freerdp/client/file.h>
#include <freerdp/client/cmdline.h> #include <freerdp/client/cmdline.h>
#include <freerdp/client/channels.h>
int freerdp_client_common_new(freerdp* instance, rdpContext* context) int freerdp_client_common_new(freerdp* instance, rdpContext* context)
{ {
@ -59,6 +61,8 @@ rdpContext* freerdp_client_context_new(RDP_CLIENT_ENTRY_POINTS* pEntryPoints)
context->instance = instance; context->instance = instance;
context->settings = instance->settings; context->settings = instance->settings;
freerdp_register_addin_provider(freerdp_channels_load_static_addin_entry, 0);
return context; return context;
} }
@ -113,7 +117,7 @@ int freerdp_client_parse_command_line(rdpContext* context, int argc, char** argv
if (settings->ConnectionFile) if (settings->ConnectionFile)
{ {
return freerdp_client_parse_connection_file(context, settings->ConnectionFile); status = freerdp_client_parse_connection_file(context, settings->ConnectionFile);
} }
return status; return status;
@ -134,35 +138,37 @@ int freerdp_client_parse_connection_file(rdpContext* context, const char* filena
int freerdp_client_parse_connection_file_buffer(rdpContext* context, BYTE* buffer, size_t size) int freerdp_client_parse_connection_file_buffer(rdpContext* context, BYTE* buffer, size_t size)
{ {
rdpFile* file; rdpFile* file;
int status = -1; int status = -1;
file = freerdp_client_rdp_file_new(); file = freerdp_client_rdp_file_new();
if (freerdp_client_parse_rdp_file_buffer(file, buffer, size)
&& freerdp_client_populate_settings_from_rdp_file(file, context->settings)) if (freerdp_client_parse_rdp_file_buffer(file, buffer, size)
{ && freerdp_client_populate_settings_from_rdp_file(file, context->settings))
status = 0; {
} status = 0;
}
freerdp_client_rdp_file_free(file); freerdp_client_rdp_file_free(file);
return status; return status;
} }
int freerdp_client_write_connection_file(rdpContext* context, const char* filename, BOOL unicode) int freerdp_client_write_connection_file(rdpContext* context, const char* filename, BOOL unicode)
{ {
rdpFile* file; rdpFile* file;
int status = -1; int status = -1;
file = freerdp_client_rdp_file_new(); file = freerdp_client_rdp_file_new();
if (freerdp_client_populate_rdp_file_from_settings(file, context->settings))
{
if (freerdp_client_write_rdp_file(file, filename, unicode))
{
status = 0;
}
}
freerdp_client_rdp_file_free(file); if (freerdp_client_populate_rdp_file_from_settings(file, context->settings))
{
if (freerdp_client_write_rdp_file(file, filename, unicode))
{
status = 0;
}
}
return status; freerdp_client_rdp_file_free(file);
return status;
} }

View File

@ -86,7 +86,7 @@ COMMAND_LINE_ARGUMENT_A args[] =
{ "clipboard", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Redirect clipboard" }, { "clipboard", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Redirect clipboard" },
{ "serial", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, "tty", "Redirect serial device" }, { "serial", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, "tty", "Redirect serial device" },
{ "parallel", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "Redirect parallel device" }, { "parallel", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "Redirect parallel device" },
{ "smartcard", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "Redirect smartcard device" }, { "smartcard", COMMAND_LINE_VALUE_OPTIONAL, NULL, NULL, NULL, -1, NULL, "Redirect smartcard device" },
{ "printer", COMMAND_LINE_VALUE_OPTIONAL, NULL, NULL, NULL, -1, NULL, "Redirect printer device" }, { "printer", COMMAND_LINE_VALUE_OPTIONAL, NULL, NULL, NULL, -1, NULL, "Redirect printer device" },
{ "usb", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "Redirect USB device" }, { "usb", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "Redirect USB device" },
{ "multitouch", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Redirect multitouch input" }, { "multitouch", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Redirect multitouch input" },
@ -319,15 +319,15 @@ int freerdp_client_add_device_channel(rdpSettings* settings, int count, char** p
{ {
RDPDR_SMARTCARD* smartcard; RDPDR_SMARTCARD* smartcard;
if (count < 2) if (count < 1)
return -1; return -1;
smartcard = (RDPDR_SMARTCARD*) malloc(sizeof(RDPDR_SMARTCARD)); smartcard = (RDPDR_SMARTCARD*) malloc(sizeof(RDPDR_SMARTCARD));
ZeroMemory(smartcard, sizeof(RDPDR_SMARTCARD)); ZeroMemory(smartcard, sizeof(RDPDR_SMARTCARD));
smartcard->Type = RDPDR_DTYP_SMARTCARD; smartcard->Type = RDPDR_DTYP_SMARTCARD;
smartcard->Name = _strdup(params[1]); if (count > 1)
smartcard->Name = _strdup(params[1]);
if (count > 2) if (count > 2)
smartcard->Path = _strdup(params[2]); smartcard->Path = _strdup(params[2]);
@ -340,15 +340,17 @@ int freerdp_client_add_device_channel(rdpSettings* settings, int count, char** p
{ {
RDPDR_SERIAL* serial; RDPDR_SERIAL* serial;
if (count < 2) if (count < 1)
return -1; return -1;
serial = (RDPDR_SERIAL*) malloc(sizeof(RDPDR_SERIAL)); serial = (RDPDR_SERIAL*) malloc(sizeof(RDPDR_SERIAL));
ZeroMemory(serial, sizeof(RDPDR_SERIAL)); ZeroMemory(serial, sizeof(RDPDR_SERIAL));
serial->Type = RDPDR_DTYP_SERIAL; serial->Type = RDPDR_DTYP_SERIAL;
serial->Name = _strdup(params[1]); if (count > 1)
serial->Path = _strdup(params[2]); serial->Name = _strdup(params[1]);
if (count > 2)
serial->Path = _strdup(params[2]);
freerdp_device_collection_add(settings, (RDPDR_DEVICE*) serial); freerdp_device_collection_add(settings, (RDPDR_DEVICE*) serial);
settings->DeviceRedirection = TRUE; settings->DeviceRedirection = TRUE;
@ -359,15 +361,17 @@ int freerdp_client_add_device_channel(rdpSettings* settings, int count, char** p
{ {
RDPDR_PARALLEL* parallel; RDPDR_PARALLEL* parallel;
if (count < 2) if (count < 1)
return -1; return -1;
parallel = (RDPDR_PARALLEL*) malloc(sizeof(RDPDR_PARALLEL)); parallel = (RDPDR_PARALLEL*) malloc(sizeof(RDPDR_PARALLEL));
ZeroMemory(parallel, sizeof(RDPDR_PARALLEL)); ZeroMemory(parallel, sizeof(RDPDR_PARALLEL));
parallel->Type = RDPDR_DTYP_PARALLEL; parallel->Type = RDPDR_DTYP_PARALLEL;
parallel->Name = _strdup(params[1]); if (count > 1)
parallel->Path = _strdup(params[2]); parallel->Name = _strdup(params[1]);
if (count > 1)
parallel->Path = _strdup(params[2]);
freerdp_device_collection_add(settings, (RDPDR_DEVICE*) parallel); freerdp_device_collection_add(settings, (RDPDR_DEVICE*) parallel);
settings->DeviceRedirection = TRUE; settings->DeviceRedirection = TRUE;
@ -424,6 +428,9 @@ char** freerdp_command_line_parse_comma_separated_values(char* list, int* count)
nArgs = nCommas = 0; nArgs = nCommas = 0;
if (!list)
return NULL;
for (index = 0; list[index]; index++) for (index = 0; list[index]; index++)
nCommas += (list[index] == ',') ? 1 : 0; nCommas += (list[index] == ',') ? 1 : 0;
@ -856,6 +863,26 @@ int freerdp_map_keyboard_layout_name_to_id(char* name)
return 0; return 0;
} }
int freerdp_detect_command_line_pre_filter(void* context, int index, int argc, LPCSTR* argv)
{
int length;
if (index == 1)
{
length = strlen(argv[index]);
if (length > 4)
{
if (_stricmp(&(argv[index])[length - 4], ".rdp") == 0)
{
return 1;
}
}
}
return 0;
}
int freerdp_detect_windows_style_command_line_syntax(int argc, char** argv, int* count) int freerdp_detect_windows_style_command_line_syntax(int argc, char** argv, int* count)
{ {
int status; int status;
@ -869,7 +896,10 @@ int freerdp_detect_windows_style_command_line_syntax(int argc, char** argv, int*
*count = 0; *count = 0;
detect_status = 0; detect_status = 0;
CommandLineClearArgumentsA(args); CommandLineClearArgumentsA(args);
status = CommandLineParseArgumentsA(argc, (const char**) argv, args, flags, NULL, NULL, NULL);
status = CommandLineParseArgumentsA(argc, (const char**) argv, args, flags,
NULL, freerdp_detect_command_line_pre_filter, NULL);
if (status < 0) if (status < 0)
return status; return status;
@ -904,7 +934,10 @@ int freerdp_detect_posix_style_command_line_syntax(int argc, char** argv, int* c
*count = 0; *count = 0;
detect_status = 0; detect_status = 0;
CommandLineClearArgumentsA(args); CommandLineClearArgumentsA(args);
status = CommandLineParseArgumentsA(argc, (const char**) argv, args, flags, NULL, NULL, NULL);
status = CommandLineParseArgumentsA(argc, (const char**) argv, args, flags,
NULL, freerdp_detect_command_line_pre_filter, NULL);
if (status < 0) if (status < 0)
return status; return status;
@ -949,9 +982,10 @@ BOOL freerdp_client_detect_command_line(int argc, char** argv, DWORD* flags)
*flags = COMMAND_LINE_SEPARATOR_COLON; *flags = COMMAND_LINE_SEPARATOR_COLON;
*flags |= COMMAND_LINE_SIGIL_SLASH | COMMAND_LINE_SIGIL_PLUS_MINUS; *flags |= COMMAND_LINE_SIGIL_SLASH | COMMAND_LINE_SIGIL_PLUS_MINUS;
} }
/* Ignore legacy parsing in case there is an error in the command line. */
else if (old_cli_status >= 0) else if (old_cli_status >= 0)
{ {
/* Ignore legacy parsing in case there is an error in the command line. */
if ((old_cli_status == 1) || ((old_cli_count > posix_cli_count) && (old_cli_status != -1))) if ((old_cli_status == 1) || ((old_cli_count > posix_cli_count) && (old_cli_status != -1)))
{ {
*flags = COMMAND_LINE_SEPARATOR_SPACE; *flags = COMMAND_LINE_SEPARATOR_SPACE;
@ -1034,8 +1068,6 @@ int freerdp_client_parse_command_line_arguments(int argc, char** argv, rdpSettin
BOOL compatibility; BOOL compatibility;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
freerdp_register_addin_provider(freerdp_channels_load_static_addin_entry, 0);
compatibility = freerdp_client_detect_command_line(argc, argv, &flags); compatibility = freerdp_client_detect_command_line(argc, argv, &flags);
if (compatibility) if (compatibility)
@ -1046,8 +1078,10 @@ int freerdp_client_parse_command_line_arguments(int argc, char** argv, rdpSettin
else else
{ {
CommandLineClearArgumentsA(args); CommandLineClearArgumentsA(args);
status = CommandLineParseArgumentsA(argc, (const char**) argv, args, flags, settings, status = CommandLineParseArgumentsA(argc, (const char**) argv, args, flags, settings,
freerdp_client_command_line_pre_filter, freerdp_client_command_line_post_filter); freerdp_client_command_line_pre_filter, freerdp_client_command_line_post_filter);
if (status < 0) if (status < 0)
return status; return status;
} }
@ -1432,7 +1466,6 @@ int freerdp_client_parse_command_line_arguments(int argc, char** argv, rdpSettin
settings->RemoteFxCodec = TRUE; settings->RemoteFxCodec = TRUE;
settings->FastPathOutput = TRUE; settings->FastPathOutput = TRUE;
settings->ColorDepth = 32; settings->ColorDepth = 32;
settings->PerformanceFlags = PERF_FLAG_NONE;
settings->LargePointerFlag = TRUE; settings->LargePointerFlag = TRUE;
settings->FrameMarkerCommandEnabled = TRUE; settings->FrameMarkerCommandEnabled = TRUE;
} }
@ -1639,25 +1672,7 @@ int freerdp_client_parse_command_line_arguments(int argc, char** argv, rdpSettin
} }
while ((arg = CommandLineFindNextArgumentA(arg)) != NULL); while ((arg = CommandLineFindNextArgumentA(arg)) != NULL);
settings->PerformanceFlags = PERF_FLAG_NONE; freerdp_performance_flags_make(settings);
if (settings->AllowFontSmoothing)
settings->PerformanceFlags |= PERF_ENABLE_FONT_SMOOTHING;
if (settings->AllowDesktopComposition)
settings->PerformanceFlags |= PERF_ENABLE_DESKTOP_COMPOSITION;
if (settings->DisableWallpaper)
settings->PerformanceFlags |= PERF_DISABLE_WALLPAPER;
if (settings->DisableFullWindowDrag)
settings->PerformanceFlags |= PERF_DISABLE_FULLWINDOWDRAG;
if (settings->DisableMenuAnims)
settings->PerformanceFlags |= PERF_DISABLE_MENUANIMATIONS;
if (settings->DisableThemes)
settings->PerformanceFlags |= PERF_DISABLE_THEMING;
if (settings->GatewayEnabled) if (settings->GatewayEnabled)
{ {

View File

@ -536,6 +536,7 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
else else
{ {
settings->PerformanceFlags = type; settings->PerformanceFlags = type;
freerdp_performance_flags_split(settings);
} }
fprintf(stderr, "-x %s -> /network:", arg->Value); fprintf(stderr, "-x %s -> /network:", arg->Value);

View File

@ -42,7 +42,7 @@
#include <winpr/crt.h> #include <winpr/crt.h>
#define DEBUG_CLIENT_FILE 1 //#define DEBUG_CLIENT_FILE 1
static BYTE BOM_UTF16_LE[2] = { 0xFF, 0xFE }; static BYTE BOM_UTF16_LE[2] = { 0xFF, 0xFE };
static WCHAR CR_LF_STR_W[] = { '\r', '\n', '\0' }; static WCHAR CR_LF_STR_W[] = { '\r', '\n', '\0' };
@ -269,6 +269,18 @@ BOOL freerdp_client_rdp_file_set_string(rdpFile* file, char* name, char* value)
return TRUE; return TRUE;
} }
void freerdp_client_add_option(rdpFile* file, char* option)
{
while ((file->argc + 1) > file->argSize)
{
file->argSize *= 2;
file->argv = (char**) realloc(file->argv, file->argSize * sizeof(char*));
}
file->argv[file->argc] = _strdup(option);
(file->argc)++;
}
void freerdp_client_parse_rdp_file_string_unicode(rdpFile* file, WCHAR* name, WCHAR* value) void freerdp_client_parse_rdp_file_string_unicode(rdpFile* file, WCHAR* name, WCHAR* value)
{ {
int length; int length;
@ -296,6 +308,21 @@ void freerdp_client_parse_rdp_file_string_ascii(rdpFile* file, char* name, char*
freerdp_client_rdp_file_set_string(file, name, value); freerdp_client_rdp_file_set_string(file, name, value);
} }
void freerdp_client_parse_rdp_file_option_unicode(rdpFile* file, WCHAR* option)
{
char* optionA = NULL;
ConvertFromUnicode(CP_UTF8, 0, option, -1, &optionA, 0, NULL, NULL);
freerdp_client_add_option(file, optionA);
free(optionA);
}
void freerdp_client_parse_rdp_file_option_ascii(rdpFile* file, char* option)
{
freerdp_client_add_option(file, option);
}
BOOL freerdp_client_parse_rdp_file_buffer_ascii(rdpFile* file, BYTE* buffer, size_t size) BOOL freerdp_client_parse_rdp_file_buffer_ascii(rdpFile* file, BYTE* buffer, size_t size)
{ {
int length; int length;
@ -317,6 +344,12 @@ BOOL freerdp_client_parse_rdp_file_buffer_ascii(rdpFile* file, BYTE* buffer, siz
beg = line; beg = line;
end = &line[length - 1]; end = &line[length - 1];
if (beg[0] == '/')
{
freerdp_client_parse_rdp_file_option_ascii(file, line);
goto next_line; /* FreeRDP option */
}
d1 = strchr(line, ':'); d1 = strchr(line, ':');
if (!d1) if (!d1)
@ -383,6 +416,13 @@ BOOL freerdp_client_parse_rdp_file_buffer_unicode(rdpFile* file, BYTE* buffer, s
beg = line; beg = line;
end = &line[length - 1]; end = &line[length - 1];
if (beg[0] == '/')
{
/* FreeRDP option */
freerdp_client_parse_rdp_file_option_unicode(file, line);
goto next_line;
}
d1 = _wcschr(line, ':'); d1 = _wcschr(line, ':');
if (!d1) if (!d1)
@ -533,16 +573,16 @@ BOOL freerdp_client_populate_rdp_file_from_settings(rdpFile* file, rdpSettings*
return TRUE; return TRUE;
} }
BOOL freerdp_client_write_rdp_file(rdpFile* file, const char* name, BOOL unicode) BOOL freerdp_client_write_rdp_file(rdpFile* file, const char* name, BOOL unicode)
{ {
int rc = 0; int rc = 0;
char* buffer; char* buffer;
int len, len2; int len, len2;
FILE* fp = NULL; FILE* fp = NULL;
WCHAR* unicodestr = NULL; WCHAR* unicodestr = NULL;
len = freerdp_client_write_rdp_file_buffer(file, NULL, 0); len = freerdp_client_write_rdp_file_buffer(file, NULL, 0);
if (len <= 0) if (len <= 0)
{ {
fprintf(stderr, "freerdp_client_write_rdp_file: Error determining buffer size.\n"); fprintf(stderr, "freerdp_client_write_rdp_file: Error determining buffer size.\n");
@ -551,9 +591,11 @@ BOOL freerdp_client_write_rdp_file(rdpFile* file, const char* name, BOOL unicode
buffer = (char*) malloc((len + 1) * sizeof(char)); buffer = (char*) malloc((len + 1) * sizeof(char));
len2 = freerdp_client_write_rdp_file_buffer(file, buffer, len + 1); len2 = freerdp_client_write_rdp_file_buffer(file, buffer, len + 1);
if (len2 == len) if (len2 == len)
{ {
fp = fopen(name, "w+b"); fp = fopen(name, "w+b");
if (fp != NULL) if (fp != NULL)
{ {
if (unicode) if (unicode)
@ -564,22 +606,22 @@ BOOL freerdp_client_write_rdp_file(rdpFile* file, const char* name, BOOL unicode
fwrite(BOM_UTF16_LE, sizeof(BYTE), 2, fp); fwrite(BOM_UTF16_LE, sizeof(BYTE), 2, fp);
fwrite(unicodestr, 2, len, fp); fwrite(unicodestr, 2, len, fp);
free(unicodestr); free(unicodestr);
} }
else else
{ {
fwrite(buffer, 1, len, fp); fwrite(buffer, 1, len, fp);
} }
rc = fflush(fp); rc = fflush(fp);
rc = fclose(fp); rc = fclose(fp);
} }
} }
if (buffer != NULL) if (buffer != NULL)
free(buffer); free(buffer);
return (rc == 0); return (rc == 0);
} }
#define WRITE_RDP_FILE_DECLARE(_file, _buffer, _size) \ #define WRITE_RDP_FILE_DECLARE(_file, _buffer, _size) \
@ -665,7 +707,6 @@ size_t freerdp_client_write_rdp_file_buffer(rdpFile* file, char* buffer, size_t
WRITE_RDP_FILE_VALUE_RETURN WRITE_RDP_FILE_VALUE_RETURN
} }
BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* settings) BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* settings)
{ {
if (~((size_t) file->Domain)) if (~((size_t) file->Domain))
@ -679,12 +720,13 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings*
freerdp_parse_username(file->Username, &user, &domain); freerdp_parse_username(file->Username, &user, &domain);
freerdp_set_param_string(settings, FreeRDP_Username, user); freerdp_set_param_string(settings, FreeRDP_Username, user);
if (domain != NULL) if (domain)
freerdp_set_param_string(settings, FreeRDP_Domain, domain); freerdp_set_param_string(settings, FreeRDP_Domain, domain);
if (user) if (user)
free(user); free(user);
if(domain)
if (domain)
free(domain); free(domain);
} }
@ -712,12 +754,52 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings*
if (~((size_t) file->ShellWorkingDirectory)) if (~((size_t) file->ShellWorkingDirectory))
freerdp_set_param_string(settings, FreeRDP_ShellWorkingDirectory, file->ShellWorkingDirectory); freerdp_set_param_string(settings, FreeRDP_ShellWorkingDirectory, file->ShellWorkingDirectory);
if (~file->ScreenModeId)
{
/**
* Screen Mode Id:
* http://technet.microsoft.com/en-us/library/ff393692/
*
* This setting corresponds to the selection in the Display
* configuration slider on the Display tab under Options in RDC.
*
* Values:
*
* 0: The remote session will appear in a window.
* 1: The remote session will appear full screen.
*/
freerdp_set_param_bool(settings, FreeRDP_Fullscreen,
(file->ScreenModeId == 1) ? TRUE : FALSE);
}
if (~((size_t) file->LoadBalanceInfo)) if (~((size_t) file->LoadBalanceInfo))
{ {
settings->LoadBalanceInfo = (BYTE*) _strdup(file->LoadBalanceInfo); settings->LoadBalanceInfo = (BYTE*) _strdup(file->LoadBalanceInfo);
settings->LoadBalanceInfoLength = strlen((char*) settings->LoadBalanceInfo); settings->LoadBalanceInfoLength = strlen((char*) settings->LoadBalanceInfo);
} }
if (~file->AuthenticationLevel)
{
/**
* Authentication Level:
* http://technet.microsoft.com/en-us/library/ff393709/
*
* This setting corresponds to the selection in the If server authentication
* fails drop-down list on the Advanced tab under Options in RDC.
*
* Values:
*
* 0: If server authentication fails, connect to the computer without warning (Connect and dont warn me).
* 1: If server authentication fails, do not establish a connection (Do not connect).
* 2: If server authentication fails, show a warning and allow me to connect or refuse the connection (Warn me).
* 3: No authentication requirement is specified.
*/
freerdp_set_param_bool(settings, FreeRDP_IgnoreCertificate,
(file->AuthenticationLevel == 0) ? TRUE : FALSE);
}
if (~file->ConnectionType) if (~file->ConnectionType)
freerdp_set_param_uint32(settings, FreeRDP_ConnectionType, file->ConnectionType); freerdp_set_param_uint32(settings, FreeRDP_ConnectionType, file->ConnectionType);
@ -738,6 +820,9 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings*
} }
} }
if (~file->Compression)
freerdp_set_param_bool(settings, FreeRDP_CompressionEnabled, file->Compression);
if (~((size_t) file->GatewayHostname)) if (~((size_t) file->GatewayHostname))
freerdp_set_param_string(settings, FreeRDP_GatewayHostname, file->GatewayHostname); freerdp_set_param_string(settings, FreeRDP_GatewayHostname, file->GatewayHostname);
@ -774,6 +859,106 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings*
if (~file->UseMultiMon) if (~file->UseMultiMon)
freerdp_set_param_bool(settings, FreeRDP_UseMultimon, file->UseMultiMon); freerdp_set_param_bool(settings, FreeRDP_UseMultimon, file->UseMultiMon);
if (~file->AllowFontSmoothing)
freerdp_set_param_bool(settings, FreeRDP_AllowFontSmoothing, file->AllowFontSmoothing);
if (~file->DisableWallpaper)
freerdp_set_param_bool(settings, FreeRDP_DisableWallpaper, file->DisableWallpaper);
if (~file->DisableFullWindowDrag)
freerdp_set_param_bool(settings, FreeRDP_DisableFullWindowDrag, file->DisableFullWindowDrag);
if (~file->DisableMenuAnims)
freerdp_set_param_bool(settings, FreeRDP_DisableMenuAnims, file->DisableMenuAnims);
if (~file->DisableThemes)
freerdp_set_param_bool(settings, FreeRDP_DisableThemes, file->DisableThemes);
if (~file->AllowDesktopComposition)
freerdp_set_param_bool(settings, FreeRDP_DisableCursorShadow, file->AllowDesktopComposition);
if (~file->BitmapCachePersistEnable)
freerdp_set_param_bool(settings, FreeRDP_BitmapCachePersistEnabled, file->BitmapCachePersistEnable);
if (~file->DisableRemoteAppCapsCheck)
freerdp_set_param_bool(settings, FreeRDP_DisableRemoteAppCapsCheck, file->DisableRemoteAppCapsCheck);
if (~file->AutoReconnectionEnabled)
freerdp_set_param_bool(settings, FreeRDP_AutoReconnectionEnabled, file->AutoReconnectionEnabled);
if (~file->AutoReconnectMaxRetries)
freerdp_set_param_uint32(settings, FreeRDP_AutoReconnectMaxRetries, file->AutoReconnectMaxRetries);
if (~file->RedirectSmartCards)
freerdp_set_param_bool(settings, FreeRDP_RedirectSmartCards, file->RedirectSmartCards);
if (~file->RedirectClipboard)
freerdp_set_param_bool(settings, FreeRDP_RedirectClipboard, file->RedirectClipboard);
if (~file->RedirectPrinters)
freerdp_set_param_bool(settings, FreeRDP_RedirectPrinters, file->RedirectPrinters);
if (~file->RedirectDrives)
freerdp_set_param_bool(settings, FreeRDP_RedirectDrives, file->RedirectDrives);
if (~file->RedirectPosDevices)
{
freerdp_set_param_bool(settings, FreeRDP_RedirectSerialPorts, file->RedirectComPorts);
freerdp_set_param_bool(settings, FreeRDP_RedirectParallelPorts, file->RedirectComPorts);
}
if (~file->RedirectComPorts)
{
freerdp_set_param_bool(settings, FreeRDP_RedirectSerialPorts, file->RedirectComPorts);
freerdp_set_param_bool(settings, FreeRDP_RedirectParallelPorts, file->RedirectComPorts);
}
if (~file->RedirectDirectX)
{
/* What is this?! */
}
if (~((size_t) file->DevicesToRedirect))
{
/**
* Devices to redirect:
* http://technet.microsoft.com/en-us/library/ff393728/
*
* This setting corresponds to the selections for Other supported Plug and Play
* (PnP) devices under More on the Local Resources tab under Options in RDC.
*
* Values:
*
* '*':
* Redirect all supported Plug and Play devices.
*
* 'DynamicDevices':
* Redirect any supported Plug and Play devices that are connected later.
*
* The hardware ID for the supported Plug and Play device:
* Redirect the specified supported Plug and Play device.
*
* Examples:
* devicestoredirect:s:*
* devicestoredirect:s:DynamicDevices
* devicestoredirect:s:USB\VID_04A9&PID_30C1\6&4BD985D&0&2;,DynamicDevices
*
*/
freerdp_set_param_bool(settings, FreeRDP_RedirectDrives, TRUE);
}
if (~((size_t) file->DrivesToRedirect))
{
/*
* Drives to redirect:
*
* Very similar to DevicesToRedirect, but can contain a
* comma-separated list of drive letters to redirect.
*/
freerdp_set_param_bool(settings, FreeRDP_RedirectDrives, TRUE);
}
if (file->argc > 1)
{
freerdp_client_parse_command_line_arguments(file->argc, file->argv, settings);
}
return TRUE; return TRUE;
} }
@ -782,12 +967,35 @@ rdpFile* freerdp_client_rdp_file_new()
rdpFile* file; rdpFile* file;
file = (rdpFile*) malloc(sizeof(rdpFile)); file = (rdpFile*) malloc(sizeof(rdpFile));
FillMemory(file, sizeof(rdpFile), 0xFF);
if (file)
{
FillMemory(file, sizeof(rdpFile), 0xFF);
file->argc = 0;
file->argSize = 32;
file->argv = (char**) malloc(file->argSize * sizeof(char*));
freerdp_client_add_option(file, "freerdp");
}
return file; return file;
} }
void freerdp_client_rdp_file_free(rdpFile* file) void freerdp_client_rdp_file_free(rdpFile* file)
{ {
free(file); int i;
if (file)
{
if (file->argv)
{
for (i = 0; i < file->argc; i++)
free(file->argv[i]);
free(file->argv);
}
free(file);
}
} }

View File

@ -103,15 +103,6 @@ enum IRP_MN
}; };
/* DR_CREATE_REQ.CreateDisposition */ /* DR_CREATE_REQ.CreateDisposition */
enum FILE_CREATE_DISPOSITION
{
FILE_SUPERSEDE = 0x00000000,
FILE_OPEN = 0x00000001,
FILE_CREATE = 0x00000002,
FILE_OPEN_IF = 0x00000003,
FILE_OVERWRITE = 0x00000004,
FILE_OVERWRITE_IF = 0x00000005
};
/* DR_CREATE_REQ.CreateOptions [MS-SMB2] */ /* DR_CREATE_REQ.CreateOptions [MS-SMB2] */
@ -289,50 +280,6 @@ enum FILE_FS_DEVICE_FLAG
FILE_DEVICE_SECURE_OPEN = 0x00000100 FILE_DEVICE_SECURE_OPEN = 0x00000100
}; };
enum FILE_INFORMATION_CLASS
{
FileDirectoryInformation = 1,
FileFullDirectoryInformation,
FileBothDirectoryInformation,
FileBasicInformation,
FileStandardInformation,
FileInternalInformation,
FileEaInformation,
FileAccessInformation,
FileNameInformation,
FileRenameInformation,
FileLinkInformation,
FileNamesInformation,
FileDispositionInformation,
FilePositionInformation,
FileFullEaInformation,
FileModeInformation,
FileAlignmentInformation,
FileAllInformation,
FileAllocationInformation,
FileEndOfFileInformation,
FileAlternateNameInformation,
FileStreamInformation,
FilePipeInformation,
FilePipeLocalInformation,
FilePipeRemoteInformation,
FileMailslotQueryInformation,
FileMailslotSetInformation,
FileCompressionInformation,
FileObjectIdInformation,
FileUnknownInformation1,
FileMoveClusterInformation,
FileQuotaInformation,
FileReparsePointInformation,
FileNetworkOpenInformation,
FileAttributeTagInformation,
FileTrackingInformation,
FileIdBothDirectoryInformation,
FileIdFullDirectoryInformation,
FileValidDataLengthInformation,
FileShortNameInformation
};
enum FILE_FS_INFORMATION_CLASS enum FILE_FS_INFORMATION_CLASS
{ {
FileFsVolumeInformation = 1, FileFsVolumeInformation = 1,

View File

@ -129,6 +129,10 @@ struct rdp_file
LPSTR DrivesToRedirect; /* drivestoredirect */ LPSTR DrivesToRedirect; /* drivestoredirect */
LPSTR DevicesToRedirect; /* devicestoredirect */ LPSTR DevicesToRedirect; /* devicestoredirect */
LPSTR WinPosStr; /* winposstr */ LPSTR WinPosStr; /* winposstr */
int argc;
char** argv;
int argSize;
}; };
typedef struct rdp_file rdpFile; typedef struct rdp_file rdpFile;

View File

@ -1046,7 +1046,7 @@ struct rdp_settings
ALIGN64 char* RemoteApplicationCmdLine; /* 2118 */ ALIGN64 char* RemoteApplicationCmdLine; /* 2118 */
ALIGN64 DWORD RemoteApplicationExpandCmdLine; /* 2119 */ ALIGN64 DWORD RemoteApplicationExpandCmdLine; /* 2119 */
ALIGN64 DWORD RemoteApplicationExpandWorkingDir; /* 2120 */ ALIGN64 DWORD RemoteApplicationExpandWorkingDir; /* 2120 */
ALIGN64 DWORD DisableRemoteAppCapsCheck; /* 2121 */ ALIGN64 BOOL DisableRemoteAppCapsCheck; /* 2121 */
ALIGN64 UINT32 RemoteAppNumIconCaches; /* 2122 */ ALIGN64 UINT32 RemoteAppNumIconCaches; /* 2122 */
ALIGN64 UINT32 RemoteAppNumIconCacheEntries; /* 2123 */ ALIGN64 UINT32 RemoteAppNumIconCacheEntries; /* 2123 */
ALIGN64 BOOL RemoteAppLanguageBarSupported; /* 2124 */ ALIGN64 BOOL RemoteAppLanguageBarSupported; /* 2124 */
@ -1317,6 +1317,9 @@ FREERDP_API void freerdp_dynamic_channel_collection_add(rdpSettings* settings, A
FREERDP_API ADDIN_ARGV* freerdp_dynamic_channel_collection_find(rdpSettings* settings, const char* name); FREERDP_API ADDIN_ARGV* freerdp_dynamic_channel_collection_find(rdpSettings* settings, const char* name);
FREERDP_API void freerdp_dynamic_channel_collection_free(rdpSettings* settings); FREERDP_API void freerdp_dynamic_channel_collection_free(rdpSettings* settings);
FREERDP_API void freerdp_performance_flags_make(rdpSettings* settings);
FREERDP_API void freerdp_performance_flags_split(rdpSettings* settings);
FREERDP_API BOOL freerdp_get_param_bool(rdpSettings* settings, int id); FREERDP_API BOOL freerdp_get_param_bool(rdpSettings* settings, int id);
FREERDP_API int freerdp_set_param_bool(rdpSettings* settings, int id, BOOL param); FREERDP_API int freerdp_set_param_bool(rdpSettings* settings, int id, BOOL param);

View File

@ -24,16 +24,16 @@
#define DEBUG_NULL(fmt, ...) do { } while (0) #define DEBUG_NULL(fmt, ...) do { } while (0)
#define DEBUG_PRINT(_dbg_str, fmt, ...) do { \ #define DEBUG_PRINT(_dbg_str, fmt, ...) do { \
fprintf(stderr, _dbg_str, __FUNCTION__, __LINE__); \ fprintf(stderr, _dbg_str, __FUNCTION__, __FILE__, __LINE__); \
fprintf(stderr, fmt, ## __VA_ARGS__); \ fprintf(stderr, fmt, ## __VA_ARGS__); \
fprintf(stderr, "\n"); \ fprintf(stderr, "\n"); \
} while( 0 ) } while( 0 )
#define DEBUG_CLASS(_dbg_class, fmt, ...) DEBUG_PRINT("DBG_" #_dbg_class " %s (%d): ", fmt, ## __VA_ARGS__) #define DEBUG_CLASS(_dbg_class, fmt, ...) DEBUG_PRINT("DBG_" #_dbg_class " %s (%s:%d): ", fmt, ## __VA_ARGS__)
#define DEBUG_WARN(fmt, ...) DEBUG_PRINT("Warning %s (%d): ", fmt, ## __VA_ARGS__) #define DEBUG_WARN(fmt, ...) DEBUG_PRINT("Warning %s (%s:%d): ", fmt, ## __VA_ARGS__)
#ifdef WITH_DEBUG #ifdef WITH_DEBUG
#define DEBUG_MSG(fmt, ...) DEBUG_PRINT("DBG %s (%d): ", fmt, ## __VA_ARGS__) #define DEBUG_MSG(fmt, ...) DEBUG_PRINT("DBG %s (%s:%d): ", fmt, ## __VA_ARGS__)
#else #else
#define DEBUG_MSG(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__) #define DEBUG_MSG(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
#endif #endif

View File

@ -48,6 +48,7 @@ void update_process_glyph(rdpContext* context, BYTE* data, int* index,
if ((ulCharInc == 0) && (!(flAccel & SO_CHAR_INC_EQUAL_BM_BASE))) if ((ulCharInc == 0) && (!(flAccel & SO_CHAR_INC_EQUAL_BM_BASE)))
{ {
/* Contrary to fragments, the offset is added before the glyph. */
(*index)++; (*index)++;
offset = data[*index]; offset = data[*index];
@ -111,6 +112,12 @@ void update_process_glyph_fragments(rdpContext* context, BYTE* data, UINT32 leng
if (fragments != NULL) if (fragments != NULL)
{ {
for (n = 0; n < (int) size; n++)
{
update_process_glyph(context, fragments, &n, &x, &y, cacheId, ulCharInc, flAccel);
}
/* Contrary to glyphs, the offset is added after the fragment. */
if ((ulCharInc == 0) && (!(flAccel & SO_CHAR_INC_EQUAL_BM_BASE))) if ((ulCharInc == 0) && (!(flAccel & SO_CHAR_INC_EQUAL_BM_BASE)))
{ {
if (flAccel & SO_VERTICAL) if (flAccel & SO_VERTICAL)
@ -118,11 +125,6 @@ void update_process_glyph_fragments(rdpContext* context, BYTE* data, UINT32 leng
else else
x += data[index + 2]; x += data[index + 2];
} }
for (n = 0; n < (int) size; n++)
{
update_process_glyph(context, fragments, &n, &x, &y, cacheId, ulCharInc, flAccel);
}
} }
index += (index + 2 < (int) length) ? 3 : 2; index += (index + 2 < (int) length) ? 3 : 2;
@ -277,7 +279,7 @@ void update_gdi_fast_glyph(rdpContext* context, FAST_GLYPH_ORDER* fast_glyph)
if (y == -32768) if (y == -32768)
y = fast_glyph->bkTop; y = fast_glyph->bkTop;
if (fast_glyph->cbData > 1) if (fast_glyph->cbData > 1 && NULL != fast_glyph->glyphData.aj)
{ {
/* got option font that needs to go into cache */ /* got option font that needs to go into cache */
glyph_data = &fast_glyph->glyphData; glyph_data = &fast_glyph->glyphData;
@ -288,7 +290,8 @@ void update_gdi_fast_glyph(rdpContext* context, FAST_GLYPH_ORDER* fast_glyph)
glyph->cx = glyph_data->cx; glyph->cx = glyph_data->cx;
glyph->cy = glyph_data->cy; glyph->cy = glyph_data->cy;
glyph->cb = glyph_data->cb; glyph->cb = glyph_data->cb;
glyph->aj = glyph_data->aj; glyph->aj = malloc(glyph_data->cb);
CopyMemory(glyph->aj, glyph_data->aj, glyph->cb);
Glyph_New(context, glyph); Glyph_New(context, glyph);
glyph_cache_put(cache->glyph, fast_glyph->cacheId, fast_glyph->data[0], glyph); glyph_cache_put(cache->glyph, fast_glyph->cacheId, fast_glyph->data[0], glyph);
@ -368,16 +371,14 @@ rdpGlyph* glyph_cache_get(rdpGlyphCache* glyph_cache, UINT32 id, UINT32 index)
if (index > glyph_cache->glyphCache[id].number) if (index > glyph_cache->glyphCache[id].number)
{ {
fprintf(stderr, "invalid glyph cache index: %d in cache id: %d\n", index, id); fprintf(stderr, "index %d out of range for cache id: %d\n", index, id);
return NULL; return NULL;
} }
glyph = glyph_cache->glyphCache[id].entries[index]; glyph = glyph_cache->glyphCache[id].entries[index];
if (glyph == NULL) if (glyph == NULL)
{ fprintf(stderr, "no glyph found at cache index: %d in cache id: %d\n", index, id);
fprintf(stderr, "invalid glyph at cache index: %d in cache id: %d\n", index, id);
}
return glyph; return glyph;
} }
@ -419,9 +420,7 @@ void* glyph_cache_fragment_get(rdpGlyphCache* glyph_cache, UINT32 index, UINT32*
*size = (BYTE) glyph_cache->fragCache.entries[index].size; *size = (BYTE) glyph_cache->fragCache.entries[index].size;
if (fragment == NULL) if (fragment == NULL)
{
fprintf(stderr, "invalid glyph fragment at index:%d\n", index); fprintf(stderr, "invalid glyph fragment at index:%d\n", index);
}
return fragment; return fragment;
} }
@ -436,9 +435,7 @@ void glyph_cache_fragment_put(rdpGlyphCache* glyph_cache, UINT32 index, UINT32 s
glyph_cache->fragCache.entries[index].size = size; glyph_cache->fragCache.entries[index].size = size;
if (prevFragment != NULL) if (prevFragment != NULL)
{
free(prevFragment); free(prevFragment);
}
} }
void glyph_cache_register_callbacks(rdpUpdate* update) void glyph_cache_register_callbacks(rdpUpdate* update)

View File

@ -298,6 +298,44 @@ void freerdp_dynamic_channel_collection_free(rdpSettings* settings)
settings->DynamicChannelCount = 0; settings->DynamicChannelCount = 0;
} }
void freerdp_performance_flags_make(rdpSettings* settings)
{
settings->PerformanceFlags = PERF_FLAG_NONE;
if (settings->AllowFontSmoothing)
settings->PerformanceFlags |= PERF_ENABLE_FONT_SMOOTHING;
if (settings->AllowDesktopComposition)
settings->PerformanceFlags |= PERF_ENABLE_DESKTOP_COMPOSITION;
if (settings->DisableWallpaper)
settings->PerformanceFlags |= PERF_DISABLE_WALLPAPER;
if (settings->DisableFullWindowDrag)
settings->PerformanceFlags |= PERF_DISABLE_FULLWINDOWDRAG;
if (settings->DisableMenuAnims)
settings->PerformanceFlags |= PERF_DISABLE_MENUANIMATIONS;
if (settings->DisableThemes)
settings->PerformanceFlags |= PERF_DISABLE_THEMING;
}
void freerdp_performance_flags_split(rdpSettings* settings)
{
settings->AllowFontSmoothing = (settings->PerformanceFlags & PERF_ENABLE_FONT_SMOOTHING) ? TRUE : FALSE;
settings->AllowDesktopComposition = (settings->PerformanceFlags & PERF_ENABLE_DESKTOP_COMPOSITION) ? TRUE : FALSE;
settings->DisableWallpaper = (settings->PerformanceFlags & PERF_DISABLE_WALLPAPER) ? TRUE : FALSE;
settings->DisableFullWindowDrag = (settings->PerformanceFlags & PERF_DISABLE_FULLWINDOWDRAG) ? TRUE : FALSE;
settings->DisableMenuAnims = (settings->PerformanceFlags & PERF_DISABLE_MENUANIMATIONS) ? TRUE : FALSE;
settings->DisableThemes = (settings->PerformanceFlags & PERF_DISABLE_THEMING) ? TRUE : FALSE;
}
/** /**
* Partially Generated Code * Partially Generated Code
*/ */
@ -578,6 +616,10 @@ BOOL freerdp_get_param_bool(rdpSettings* settings, int id)
return settings->RemoteApplicationMode; return settings->RemoteApplicationMode;
break; break;
case FreeRDP_DisableRemoteAppCapsCheck:
return settings->DisableRemoteAppCapsCheck;
break;
case FreeRDP_RemoteAppLanguageBarSupported: case FreeRDP_RemoteAppLanguageBarSupported:
return settings->RemoteAppLanguageBarSupported; return settings->RemoteAppLanguageBarSupported;
break; break;
@ -1033,6 +1075,10 @@ int freerdp_set_param_bool(rdpSettings* settings, int id, BOOL param)
settings->RemoteApplicationMode = param; settings->RemoteApplicationMode = param;
break; break;
case FreeRDP_DisableRemoteAppCapsCheck:
settings->DisableRemoteAppCapsCheck = param;
break;
case FreeRDP_RemoteAppLanguageBarSupported: case FreeRDP_RemoteAppLanguageBarSupported:
settings->RemoteAppLanguageBarSupported = param; settings->RemoteAppLanguageBarSupported = param;
break; break;

View File

@ -153,6 +153,7 @@ BOOL rdp_read_extended_info_packet(wStream* s, rdpSettings* settings)
Stream_Seek_UINT32(s); /* clientSessionId, should be set to 0 */ Stream_Seek_UINT32(s); /* clientSessionId, should be set to 0 */
Stream_Read_UINT32(s, settings->PerformanceFlags); /* performanceFlags */ Stream_Read_UINT32(s, settings->PerformanceFlags); /* performanceFlags */
freerdp_performance_flags_split(settings);
Stream_Read_UINT16(s, cbAutoReconnectLen); /* cbAutoReconnectLen */ Stream_Read_UINT16(s, cbAutoReconnectLen); /* cbAutoReconnectLen */
@ -206,6 +207,8 @@ void rdp_write_extended_info_packet(wStream* s, rdpSettings* settings)
rdp_write_client_time_zone(s, settings); /* clientTimeZone */ rdp_write_client_time_zone(s, settings); /* clientTimeZone */
Stream_Write_UINT32(s, 0); /* clientSessionId, should be set to 0 */ Stream_Write_UINT32(s, 0); /* clientSessionId, should be set to 0 */
freerdp_performance_flags_make(settings);
Stream_Write_UINT32(s, settings->PerformanceFlags); /* performanceFlags */ Stream_Write_UINT32(s, settings->PerformanceFlags); /* performanceFlags */
Stream_Write_UINT16(s, cbAutoReconnectLen); /* cbAutoReconnectLen */ Stream_Write_UINT16(s, cbAutoReconnectLen); /* cbAutoReconnectLen */

View File

@ -798,6 +798,7 @@ void nego_process_negotiation_failure(rdpNego* nego, wStream* s)
case SSL_NOT_ALLOWED_BY_SERVER: case SSL_NOT_ALLOWED_BY_SERVER:
DEBUG_NEGO("Error: SSL_NOT_ALLOWED_BY_SERVER"); DEBUG_NEGO("Error: SSL_NOT_ALLOWED_BY_SERVER");
nego->sendNegoData = TRUE;
break; break;
case SSL_CERT_NOT_ON_SERVER: case SSL_CERT_NOT_ON_SERVER:
@ -940,6 +941,7 @@ void nego_init(rdpNego* nego)
nego->transport->ReceiveCallback = nego_recv; nego->transport->ReceiveCallback = nego_recv;
nego->transport->ReceiveExtra = (void*) nego; nego->transport->ReceiveExtra = (void*) nego;
nego->cookie_max_length = DEFAULT_COOKIE_MAX_LENGTH; nego->cookie_max_length = DEFAULT_COOKIE_MAX_LENGTH;
nego->sendNegoData = FALSE;
nego->flags = 0; nego->flags = 0;
} }

View File

@ -485,9 +485,7 @@ static INLINE BOOL update_write_4byte_unsigned(wStream* s, UINT32 value)
Stream_Write_UINT8(s, byte); Stream_Write_UINT8(s, byte);
} }
else else
{
return FALSE; return FALSE;
}
return TRUE; return TRUE;
} }
@ -1670,6 +1668,8 @@ BOOL update_read_fast_glyph_order(wStream* s, ORDER_INFO* orderInfo, FAST_GLYPH_
if (Stream_GetRemainingLength(s) < glyph->cb) if (Stream_GetRemainingLength(s) < glyph->cb)
return FALSE; return FALSE;
if (glyph->aj)
free(glyph->aj);
glyph->aj = (BYTE*) malloc(glyph->cb); glyph->aj = (BYTE*) malloc(glyph->cb);
Stream_Read(s, glyph->aj, glyph->cb); Stream_Read(s, glyph->aj, glyph->cb);
} }

View File

@ -243,10 +243,14 @@ rdpSettings* freerdp_settings_new(void* instance)
settings->DesktopPosX = 0; settings->DesktopPosX = 0;
settings->DesktopPosY = 0; settings->DesktopPosY = 0;
settings->PerformanceFlags = settings->PerformanceFlags = PERF_FLAG_NONE;
PERF_DISABLE_FULLWINDOWDRAG | settings->AllowFontSmoothing = FALSE;
PERF_DISABLE_MENUANIMATIONS | settings->AllowDesktopComposition = FALSE;
PERF_DISABLE_WALLPAPER; settings->DisableWallpaper = TRUE;
settings->DisableFullWindowDrag = TRUE;
settings->DisableMenuAnims = TRUE;
settings->DisableThemes = FALSE;
settings->ConnectionType = CONNECTION_TYPE_LAN;
settings->AutoReconnectionEnabled = TRUE; settings->AutoReconnectionEnabled = TRUE;
@ -306,11 +310,6 @@ rdpSettings* freerdp_settings_new(void* instance)
settings->LargePointerFlag = TRUE; settings->LargePointerFlag = TRUE;
settings->PointerCacheSize = 20; settings->PointerCacheSize = 20;
settings->SoundBeepsEnabled = TRUE; settings->SoundBeepsEnabled = TRUE;
settings->DisableWallpaper = FALSE;
settings->DisableFullWindowDrag = FALSE;
settings->DisableMenuAnims = FALSE;
settings->DisableThemes = FALSE;
settings->ConnectionType = 0;
settings->DrawGdiPlusEnabled = FALSE; settings->DrawGdiPlusEnabled = FALSE;
@ -392,6 +391,9 @@ rdpSettings* freerdp_settings_new(void* instance)
settings->ClientHostname[31] = 0; settings->ClientHostname[31] = 0;
settings->MouseMotion = TRUE; settings->MouseMotion = TRUE;
settings->AutoReconnectionEnabled = TRUE;
settings->AutoReconnectMaxRetries = 20;
settings->ClientAutoReconnectCookie = (ARC_CS_PRIVATE_PACKET*) malloc(sizeof(ARC_CS_PRIVATE_PACKET)); settings->ClientAutoReconnectCookie = (ARC_CS_PRIVATE_PACKET*) malloc(sizeof(ARC_CS_PRIVATE_PACKET));
settings->ServerAutoReconnectCookie = (ARC_SC_PRIVATE_PACKET*) malloc(sizeof(ARC_SC_PRIVATE_PACKET)); settings->ServerAutoReconnectCookie = (ARC_SC_PRIVATE_PACKET*) malloc(sizeof(ARC_SC_PRIVATE_PACKET));
ZeroMemory(settings->ClientAutoReconnectCookie, sizeof(ARC_CS_PRIVATE_PACKET)); ZeroMemory(settings->ClientAutoReconnectCookie, sizeof(ARC_CS_PRIVATE_PACKET));

View File

@ -1609,6 +1609,8 @@ void update_free(rdpUpdate* update)
free(update->primary->polyline.points); free(update->primary->polyline.points);
free(update->primary->polygon_sc.points); free(update->primary->polygon_sc.points);
if (NULL != update->primary->fast_glyph.glyphData.aj)
free(update->primary->fast_glyph.glyphData.aj);
free(update->primary); free(update->primary);
free(update->secondary); free(update->secondary);

View File

@ -23,6 +23,7 @@
#include <winpr/winpr.h> #include <winpr/winpr.h>
#include <winpr/wtypes.h> #include <winpr/wtypes.h>
#include <winpr/nt.h>
#include <winpr/sspi.h> #include <winpr/sspi.h>
#include <winpr/error.h> #include <winpr/error.h>
#include <winpr/credentials.h> #include <winpr/credentials.h>

View File

@ -22,9 +22,94 @@
#include <winpr/winpr.h> #include <winpr/winpr.h>
#include <winpr/wtypes.h> #include <winpr/wtypes.h>
#include <winpr/windows.h>
#ifndef _WIN32 #ifndef _WIN32
/* Defined in winnt.h, do not redefine */
#define STATUS_WAIT_0 ((NTSTATUS)0x00000000L)
#define STATUS_ABANDONED_WAIT_0 ((NTSTATUS)0x00000080L)
#define STATUS_USER_APC ((NTSTATUS)0x000000C0L)
#define STATUS_TIMEOUT ((NTSTATUS)0x00000102L)
#define STATUS_PENDING ((NTSTATUS)0x00000103L)
#define DBG_EXCEPTION_HANDLED ((NTSTATUS)0x00010001L)
#define DBG_CONTINUE ((NTSTATUS)0x00010002L)
#define STATUS_SEGMENT_NOTIFICATION ((NTSTATUS)0x40000005L)
#define STATUS_FATAL_APP_EXIT ((NTSTATUS)0x40000015L)
#define DBG_TERMINATE_THREAD ((NTSTATUS)0x40010003L)
#define DBG_TERMINATE_PROCESS ((NTSTATUS)0x40010004L)
#define DBG_CONTROL_C ((NTSTATUS)0x40010005L)
#define DBG_PRINTEXCEPTION_C ((NTSTATUS)0x40010006L)
#define DBG_RIPEXCEPTION ((NTSTATUS)0x40010007L)
#define DBG_CONTROL_BREAK ((NTSTATUS)0x40010008L)
#define DBG_COMMAND_EXCEPTION ((NTSTATUS)0x40010009L)
#define STATUS_GUARD_PAGE_VIOLATION ((NTSTATUS)0x80000001L)
#define STATUS_DATATYPE_MISALIGNMENT ((NTSTATUS)0x80000002L)
#define STATUS_BREAKPOINT ((NTSTATUS)0x80000003L)
#define STATUS_SINGLE_STEP ((NTSTATUS)0x80000004L)
#define STATUS_LONGJUMP ((NTSTATUS)0x80000026L)
#define STATUS_UNWIND_CONSOLIDATE ((NTSTATUS)0x80000029L)
#define DBG_EXCEPTION_NOT_HANDLED ((NTSTATUS)0x80010001L)
#define STATUS_ACCESS_VIOLATION ((NTSTATUS)0xC0000005L)
#define STATUS_IN_PAGE_ERROR ((NTSTATUS)0xC0000006L)
#define STATUS_INVALID_HANDLE ((NTSTATUS)0xC0000008L)
#define STATUS_INVALID_PARAMETER ((NTSTATUS)0xC000000DL)
#define STATUS_NO_MEMORY ((NTSTATUS)0xC0000017L)
#define STATUS_ILLEGAL_INSTRUCTION ((NTSTATUS)0xC000001DL)
#define STATUS_NONCONTINUABLE_EXCEPTION ((NTSTATUS)0xC0000025L)
#define STATUS_INVALID_DISPOSITION ((NTSTATUS)0xC0000026L)
#define STATUS_ARRAY_BOUNDS_EXCEEDED ((NTSTATUS)0xC000008CL)
#define STATUS_FLOAT_DENORMAL_OPERAND ((NTSTATUS)0xC000008DL)
#define STATUS_FLOAT_DIVIDE_BY_ZERO ((NTSTATUS)0xC000008EL)
#define STATUS_FLOAT_INEXACT_RESULT ((NTSTATUS)0xC000008FL)
#define STATUS_FLOAT_INVALID_OPERATION ((NTSTATUS)0xC0000090L)
#define STATUS_FLOAT_OVERFLOW ((NTSTATUS)0xC0000091L)
#define STATUS_FLOAT_STACK_CHECK ((NTSTATUS)0xC0000092L)
#define STATUS_FLOAT_UNDERFLOW ((NTSTATUS)0xC0000093L)
#define STATUS_INTEGER_DIVIDE_BY_ZERO ((NTSTATUS)0xC0000094L)
#define STATUS_INTEGER_OVERFLOW ((NTSTATUS)0xC0000095L)
#define STATUS_PRIVILEGED_INSTRUCTION ((NTSTATUS)0xC0000096L)
#define STATUS_STACK_OVERFLOW ((NTSTATUS)0xC00000FDL)
#define STATUS_DLL_NOT_FOUND ((NTSTATUS)0xC0000135L)
#define STATUS_ORDINAL_NOT_FOUND ((NTSTATUS)0xC0000138L)
#define STATUS_ENTRYPOINT_NOT_FOUND ((NTSTATUS)0xC0000139L)
#define STATUS_CONTROL_C_EXIT ((NTSTATUS)0xC000013AL)
#define STATUS_DLL_INIT_FAILED ((NTSTATUS)0xC0000142L)
#define STATUS_FLOAT_MULTIPLE_FAULTS ((NTSTATUS)0xC00002B4L)
#define STATUS_FLOAT_MULTIPLE_TRAPS ((NTSTATUS)0xC00002B5L)
#define STATUS_REG_NAT_CONSUMPTION ((NTSTATUS)0xC00002C9L)
#define STATUS_STACK_BUFFER_OVERRUN ((NTSTATUS)0xC0000409L)
#define STATUS_INVALID_CRUNTIME_PARAMETER ((NTSTATUS)0xC0000417L)
#define STATUS_ASSERTION_FAILURE ((NTSTATUS)0xC0000420L)
#define STATUS_SXS_EARLY_DEACTIVATION ((NTSTATUS)0xC015000FL)
#define STATUS_SXS_INVALID_DEACTIVATION ((NTSTATUS)0xC0150010L)
#endif
/* Defined in wincred.h, do not redefine */
#ifdef _WIN32
#include <wincred.h>
#else
#define STATUS_LOGON_FAILURE ((NTSTATUS)0xC000006DL)
#define STATUS_WRONG_PASSWORD ((NTSTATUS)0xC000006AL)
#define STATUS_PASSWORD_EXPIRED ((NTSTATUS)0xC0000071L)
#define STATUS_PASSWORD_MUST_CHANGE ((NTSTATUS)0xC0000224L)
#define STATUS_ACCESS_DENIED ((NTSTATUS)0xC0000022L)
#define STATUS_DOWNGRADE_DETECTED ((NTSTATUS)0xC0000388L)
#define STATUS_AUTHENTICATION_FIREWALL_FAILED ((NTSTATUS)0xC0000413L)
#define STATUS_ACCOUNT_DISABLED ((NTSTATUS)0xC0000072L)
#define STATUS_ACCOUNT_RESTRICTION ((NTSTATUS)0xC000006EL)
#define STATUS_ACCOUNT_LOCKED_OUT ((NTSTATUS)0xC0000234L)
#define STATUS_ACCOUNT_EXPIRED ((NTSTATUS)0xC0000193L)
#define STATUS_LOGON_TYPE_NOT_GRANTED ((NTSTATUS)0xC000015BL)
#endif
#define FACILITY_DEBUGGER 0x1 #define FACILITY_DEBUGGER 0x1
#define FACILITY_RPC_RUNTIME 0x2 #define FACILITY_RPC_RUNTIME 0x2
#define FACILITY_RPC_STUBS 0x3 #define FACILITY_RPC_STUBS 0x3
@ -37,18 +122,18 @@
#define FACILITY_ACPI_ERROR_CODE 0x14 #define FACILITY_ACPI_ERROR_CODE 0x14
#define FACILITY_SXS_ERROR_CODE 0x15 #define FACILITY_SXS_ERROR_CODE 0x15
#define DBG_EXCEPTION_HANDLED ((NTSTATUS)0x00010001) //#define DBG_EXCEPTION_HANDLED ((NTSTATUS)0x00010001)
#define DBG_CONTINUE ((NTSTATUS)0x00010002) //#define DBG_CONTINUE ((NTSTATUS)0x00010002)
#define DBG_REPLY_LATER ((NTSTATUS)0x40010001) #define DBG_REPLY_LATER ((NTSTATUS)0x40010001)
#define DBG_UNABLE_TO_PROVIDE_HANDLE ((NTSTATUS)0x40010002) #define DBG_UNABLE_TO_PROVIDE_HANDLE ((NTSTATUS)0x40010002)
#define DBG_TERMINATE_THREAD ((NTSTATUS)0x40010003) //#define DBG_TERMINATE_THREAD ((NTSTATUS)0x40010003)
#define DBG_TERMINATE_PROCESS ((NTSTATUS)0x40010004) //#define DBG_TERMINATE_PROCESS ((NTSTATUS)0x40010004)
#define DBG_CONTROL_C ((NTSTATUS)0x40010005) //#define DBG_CONTROL_C ((NTSTATUS)0x40010005)
#define DBG_PRINTEXCEPTION_C ((NTSTATUS)0x40010006) //#define DBG_PRINTEXCEPTION_C ((NTSTATUS)0x40010006)
#define DBG_RIPEXCEPTION ((NTSTATUS)0x40010007) //#define DBG_RIPEXCEPTION ((NTSTATUS)0x40010007)
#define DBG_CONTROL_BREAK ((NTSTATUS)0x40010008) //#define DBG_CONTROL_BREAK ((NTSTATUS)0x40010008)
#define DBG_COMMAND_EXCEPTION ((NTSTATUS)0x40010009) //#define DBG_COMMAND_EXCEPTION ((NTSTATUS)0x40010009)
#define DBG_EXCEPTION_NOT_HANDLED ((NTSTATUS)0x80010001) //#define DBG_EXCEPTION_NOT_HANDLED ((NTSTATUS)0x80010001)
#define DBG_NO_STATE_CHANGE ((NTSTATUS)0xC0010001) #define DBG_NO_STATE_CHANGE ((NTSTATUS)0xC0010001)
#define DBG_APP_NOT_IDLE ((NTSTATUS)0xC0010002) #define DBG_APP_NOT_IDLE ((NTSTATUS)0xC0010002)
@ -71,11 +156,11 @@
#define STATUS_WAIT_63 ((NTSTATUS)0x0000003f) #define STATUS_WAIT_63 ((NTSTATUS)0x0000003f)
#define STATUS_ABANDONED ((NTSTATUS)0x00000080) #define STATUS_ABANDONED ((NTSTATUS)0x00000080)
#define STATUS_ABANDONED_WAIT_63 ((NTSTATUS)0x000000BF) #define STATUS_ABANDONED_WAIT_63 ((NTSTATUS)0x000000BF)
#define STATUS_USER_APC ((NTSTATUS)0x000000C0) //#define STATUS_USER_APC ((NTSTATUS)0x000000C0)
#define STATUS_KERNEL_APC ((NTSTATUS)0x00000100) #define STATUS_KERNEL_APC ((NTSTATUS)0x00000100)
#define STATUS_ALERTED ((NTSTATUS)0x00000101) #define STATUS_ALERTED ((NTSTATUS)0x00000101)
#define STATUS_TIMEOUT ((NTSTATUS)0x00000102) //#define STATUS_TIMEOUT ((NTSTATUS)0x00000102)
#define STATUS_PENDING ((NTSTATUS)0x00000103) //#define STATUS_PENDING ((NTSTATUS)0x00000103)
#define STATUS_REPARSE ((NTSTATUS)0x00000104) #define STATUS_REPARSE ((NTSTATUS)0x00000104)
#define STATUS_MORE_ENTRIES ((NTSTATUS)0x00000105) #define STATUS_MORE_ENTRIES ((NTSTATUS)0x00000105)
#define STATUS_NOT_ALL_ASSIGNED ((NTSTATUS)0x00000106) #define STATUS_NOT_ALL_ASSIGNED ((NTSTATUS)0x00000106)
@ -110,7 +195,7 @@
#define STATUS_WORKING_SET_LIMIT_RANGE ((NTSTATUS)0x40000002) #define STATUS_WORKING_SET_LIMIT_RANGE ((NTSTATUS)0x40000002)
#define STATUS_IMAGE_NOT_AT_BASE ((NTSTATUS)0x40000003) #define STATUS_IMAGE_NOT_AT_BASE ((NTSTATUS)0x40000003)
#define STATUS_RXACT_STATE_CREATED ((NTSTATUS)0x40000004) #define STATUS_RXACT_STATE_CREATED ((NTSTATUS)0x40000004)
#define STATUS_SEGMENT_NOTIFICATION ((NTSTATUS)0x40000005) //#define STATUS_SEGMENT_NOTIFICATION ((NTSTATUS)0x40000005)
#define STATUS_LOCAL_USER_SESSION_KEY ((NTSTATUS)0x40000006) #define STATUS_LOCAL_USER_SESSION_KEY ((NTSTATUS)0x40000006)
#define STATUS_BAD_CURRENT_DIRECTORY ((NTSTATUS)0x40000007) #define STATUS_BAD_CURRENT_DIRECTORY ((NTSTATUS)0x40000007)
#define STATUS_SERIAL_MORE_WRITES ((NTSTATUS)0x40000008) #define STATUS_SERIAL_MORE_WRITES ((NTSTATUS)0x40000008)
@ -126,7 +211,7 @@
#define STATUS_EVENT_DONE ((NTSTATUS)0x40000012) #define STATUS_EVENT_DONE ((NTSTATUS)0x40000012)
#define STATUS_EVENT_PENDING ((NTSTATUS)0x40000013) #define STATUS_EVENT_PENDING ((NTSTATUS)0x40000013)
#define STATUS_CHECKING_FILE_SYSTEM ((NTSTATUS)0x40000014) #define STATUS_CHECKING_FILE_SYSTEM ((NTSTATUS)0x40000014)
#define STATUS_FATAL_APP_EXIT ((NTSTATUS)0x40000015) //#define STATUS_FATAL_APP_EXIT ((NTSTATUS)0x40000015)
#define STATUS_PREDEFINED_HANDLE ((NTSTATUS)0x40000016) #define STATUS_PREDEFINED_HANDLE ((NTSTATUS)0x40000016)
#define STATUS_WAS_UNLOCKED ((NTSTATUS)0x40000017) #define STATUS_WAS_UNLOCKED ((NTSTATUS)0x40000017)
#define STATUS_SERVICE_NOTIFICATION ((NTSTATUS)0x40000018) #define STATUS_SERVICE_NOTIFICATION ((NTSTATUS)0x40000018)
@ -161,10 +246,10 @@
#define STATUS_SXS_RELEASE_ACTIVATION_CONTEXT ((NTSTATUS)0x4015000D) #define STATUS_SXS_RELEASE_ACTIVATION_CONTEXT ((NTSTATUS)0x4015000D)
#define STATUS_GUARD_PAGE_VIOLATION ((NTSTATUS)0x80000001) //#define STATUS_GUARD_PAGE_VIOLATION ((NTSTATUS)0x80000001)
#define STATUS_DATATYPE_MISALIGNMENT ((NTSTATUS)0x80000002) //#define STATUS_DATATYPE_MISALIGNMENT ((NTSTATUS)0x80000002)
#define STATUS_BREAKPOINT ((NTSTATUS)0x80000003) //#define STATUS_BREAKPOINT ((NTSTATUS)0x80000003)
#define STATUS_SINGLE_STEP ((NTSTATUS)0x80000004) //#define STATUS_SINGLE_STEP ((NTSTATUS)0x80000004)
#define STATUS_BUFFER_OVERFLOW ((NTSTATUS)0x80000005) #define STATUS_BUFFER_OVERFLOW ((NTSTATUS)0x80000005)
#define STATUS_NO_MORE_FILES ((NTSTATUS)0x80000006) #define STATUS_NO_MORE_FILES ((NTSTATUS)0x80000006)
#define STATUS_WAKE_SYSTEM_DEBUGGER ((NTSTATUS)0x80000007) #define STATUS_WAKE_SYSTEM_DEBUGGER ((NTSTATUS)0x80000007)
@ -196,10 +281,10 @@
#define STATUS_REDIRECTOR_HAS_OPEN_HANDLES ((NTSTATUS)0x80000023) #define STATUS_REDIRECTOR_HAS_OPEN_HANDLES ((NTSTATUS)0x80000023)
#define STATUS_SERVER_HAS_OPEN_HANDLES ((NTSTATUS)0x80000024) #define STATUS_SERVER_HAS_OPEN_HANDLES ((NTSTATUS)0x80000024)
#define STATUS_ALREADY_DISCONNECTED ((NTSTATUS)0x80000025) #define STATUS_ALREADY_DISCONNECTED ((NTSTATUS)0x80000025)
#define STATUS_LONGJUMP ((NTSTATUS)0x80000026) //#define STATUS_LONGJUMP ((NTSTATUS)0x80000026)
#define STATUS_CLEANER_CARTRIDGE_INSTALLED ((NTSTATUS)0x80000027) #define STATUS_CLEANER_CARTRIDGE_INSTALLED ((NTSTATUS)0x80000027)
#define STATUS_PLUGPLAY_QUERY_VETOED ((NTSTATUS)0x80000028) #define STATUS_PLUGPLAY_QUERY_VETOED ((NTSTATUS)0x80000028)
#define STATUS_UNWIND_CONSOLIDATE ((NTSTATUS)0x80000029) //#define STATUS_UNWIND_CONSOLIDATE ((NTSTATUS)0x80000029)
#define STATUS_REGISTRY_HIVE_RECOVERED ((NTSTATUS)0x8000002A) #define STATUS_REGISTRY_HIVE_RECOVERED ((NTSTATUS)0x8000002A)
#define STATUS_DLL_MIGHT_BE_INSECURE ((NTSTATUS)0x8000002B) #define STATUS_DLL_MIGHT_BE_INSECURE ((NTSTATUS)0x8000002B)
#define STATUS_DLL_MIGHT_BE_INCOMPATIBLE ((NTSTATUS)0x8000002C) #define STATUS_DLL_MIGHT_BE_INCOMPATIBLE ((NTSTATUS)0x8000002C)
@ -213,20 +298,20 @@
#define STATUS_CLUSTER_NETWORK_ALREADY_OFFLINE ((NTSTATUS)0x80130004) #define STATUS_CLUSTER_NETWORK_ALREADY_OFFLINE ((NTSTATUS)0x80130004)
#define STATUS_CLUSTER_NODE_ALREADY_MEMBER ((NTSTATUS)0x80130005) #define STATUS_CLUSTER_NODE_ALREADY_MEMBER ((NTSTATUS)0x80130005)
#define STATUS_WAIT_0 ((NTSTATUS)0x00000000) //#define STATUS_WAIT_0 ((NTSTATUS)0x00000000)
#define STATUS_UNSUCCESSFUL ((NTSTATUS)0xC0000001) #define STATUS_UNSUCCESSFUL ((NTSTATUS)0xC0000001)
#define STATUS_NOT_IMPLEMENTED ((NTSTATUS)0xC0000002) #define STATUS_NOT_IMPLEMENTED ((NTSTATUS)0xC0000002)
#define STATUS_INVALID_INFO_CLASS ((NTSTATUS)0xC0000003) #define STATUS_INVALID_INFO_CLASS ((NTSTATUS)0xC0000003)
#define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004) #define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004)
#define STATUS_ACCESS_VIOLATION ((NTSTATUS)0xC0000005) //#define STATUS_ACCESS_VIOLATION ((NTSTATUS)0xC0000005)
#define STATUS_IN_PAGE_ERROR ((NTSTATUS)0xC0000006) //#define STATUS_IN_PAGE_ERROR ((NTSTATUS)0xC0000006)
#define STATUS_PAGEFILE_QUOTA ((NTSTATUS)0xC0000007) #define STATUS_PAGEFILE_QUOTA ((NTSTATUS)0xC0000007)
#define STATUS_INVALID_HANDLE ((NTSTATUS)0xC0000008) //#define STATUS_INVALID_HANDLE ((NTSTATUS)0xC0000008)
#define STATUS_BAD_INITIAL_STACK ((NTSTATUS)0xC0000009) #define STATUS_BAD_INITIAL_STACK ((NTSTATUS)0xC0000009)
#define STATUS_BAD_INITIAL_PC ((NTSTATUS)0xC000000A) #define STATUS_BAD_INITIAL_PC ((NTSTATUS)0xC000000A)
#define STATUS_INVALID_CID ((NTSTATUS)0xC000000B) #define STATUS_INVALID_CID ((NTSTATUS)0xC000000B)
#define STATUS_TIMER_NOT_CANCELED ((NTSTATUS)0xC000000C) #define STATUS_TIMER_NOT_CANCELED ((NTSTATUS)0xC000000C)
#define STATUS_INVALID_PARAMETER ((NTSTATUS)0xC000000D) //#define STATUS_INVALID_PARAMETER ((NTSTATUS)0xC000000D)
#define STATUS_NO_SUCH_DEVICE ((NTSTATUS)0xC000000E) #define STATUS_NO_SUCH_DEVICE ((NTSTATUS)0xC000000E)
#define STATUS_NO_SUCH_FILE ((NTSTATUS)0xC000000F) #define STATUS_NO_SUCH_FILE ((NTSTATUS)0xC000000F)
#define STATUS_INVALID_DEVICE_REQUEST ((NTSTATUS)0xC0000010) #define STATUS_INVALID_DEVICE_REQUEST ((NTSTATUS)0xC0000010)
@ -236,22 +321,22 @@
#define STATUS_UNRECOGNIZED_MEDIA ((NTSTATUS)0xC0000014) #define STATUS_UNRECOGNIZED_MEDIA ((NTSTATUS)0xC0000014)
#define STATUS_NONEXISTENT_SECTOR ((NTSTATUS)0xC0000015) #define STATUS_NONEXISTENT_SECTOR ((NTSTATUS)0xC0000015)
#define STATUS_MORE_PROCESSING_REQUIRED ((NTSTATUS)0xC0000016) #define STATUS_MORE_PROCESSING_REQUIRED ((NTSTATUS)0xC0000016)
#define STATUS_NO_MEMORY ((NTSTATUS)0xC0000017) //#define STATUS_NO_MEMORY ((NTSTATUS)0xC0000017)
#define STATUS_CONFLICTING_ADDRESSES ((NTSTATUS)0xC0000018) #define STATUS_CONFLICTING_ADDRESSES ((NTSTATUS)0xC0000018)
#define STATUS_NOT_MAPPED_VIEW ((NTSTATUS)0xC0000019) #define STATUS_NOT_MAPPED_VIEW ((NTSTATUS)0xC0000019)
#define STATUS_UNABLE_TO_FREE_VM ((NTSTATUS)0xC000001A) #define STATUS_UNABLE_TO_FREE_VM ((NTSTATUS)0xC000001A)
#define STATUS_UNABLE_TO_DELETE_SECTION ((NTSTATUS)0xC000001B) #define STATUS_UNABLE_TO_DELETE_SECTION ((NTSTATUS)0xC000001B)
#define STATUS_INVALID_SYSTEM_SERVICE ((NTSTATUS)0xC000001C) #define STATUS_INVALID_SYSTEM_SERVICE ((NTSTATUS)0xC000001C)
#define STATUS_ILLEGAL_INSTRUCTION ((NTSTATUS)0xC000001D) //#define STATUS_ILLEGAL_INSTRUCTION ((NTSTATUS)0xC000001D)
#define STATUS_INVALID_LOCK_SEQUENCE ((NTSTATUS)0xC000001E) #define STATUS_INVALID_LOCK_SEQUENCE ((NTSTATUS)0xC000001E)
#define STATUS_INVALID_VIEW_SIZE ((NTSTATUS)0xC000001F) #define STATUS_INVALID_VIEW_SIZE ((NTSTATUS)0xC000001F)
#define STATUS_INVALID_FILE_FOR_SECTION ((NTSTATUS)0xC0000020) #define STATUS_INVALID_FILE_FOR_SECTION ((NTSTATUS)0xC0000020)
#define STATUS_ALREADY_COMMITTED ((NTSTATUS)0xC0000021) #define STATUS_ALREADY_COMMITTED ((NTSTATUS)0xC0000021)
#define STATUS_ACCESS_DENIED ((NTSTATUS)0xC0000022) //#define STATUS_ACCESS_DENIED ((NTSTATUS)0xC0000022)
#define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023) #define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023)
#define STATUS_OBJECT_TYPE_MISMATCH ((NTSTATUS)0xC0000024) #define STATUS_OBJECT_TYPE_MISMATCH ((NTSTATUS)0xC0000024)
#define STATUS_NONCONTINUABLE_EXCEPTION ((NTSTATUS)0xC0000025) //#define STATUS_NONCONTINUABLE_EXCEPTION ((NTSTATUS)0xC0000025)
#define STATUS_INVALID_DISPOSITION ((NTSTATUS)0xC0000026) //#define STATUS_INVALID_DISPOSITION ((NTSTATUS)0xC0000026)
#define STATUS_UNWIND ((NTSTATUS)0xC0000027) #define STATUS_UNWIND ((NTSTATUS)0xC0000027)
#define STATUS_BAD_STACK ((NTSTATUS)0xC0000028) #define STATUS_BAD_STACK ((NTSTATUS)0xC0000028)
#define STATUS_INVALID_UNWIND_TARGET ((NTSTATUS)0xC0000029) #define STATUS_INVALID_UNWIND_TARGET ((NTSTATUS)0xC0000029)
@ -318,15 +403,15 @@
#define STATUS_MEMBER_IN_GROUP ((NTSTATUS)0xC0000067) #define STATUS_MEMBER_IN_GROUP ((NTSTATUS)0xC0000067)
#define STATUS_MEMBER_NOT_IN_GROUP ((NTSTATUS)0xC0000068) #define STATUS_MEMBER_NOT_IN_GROUP ((NTSTATUS)0xC0000068)
#define STATUS_LAST_ADMIN ((NTSTATUS)0xC0000069) #define STATUS_LAST_ADMIN ((NTSTATUS)0xC0000069)
#define STATUS_WRONG_PASSWORD ((NTSTATUS)0xC000006A) //#define STATUS_WRONG_PASSWORD ((NTSTATUS)0xC000006A)
#define STATUS_ILL_FORMED_PASSWORD ((NTSTATUS)0xC000006B) #define STATUS_ILL_FORMED_PASSWORD ((NTSTATUS)0xC000006B)
#define STATUS_PASSWORD_RESTRICTION ((NTSTATUS)0xC000006C) #define STATUS_PASSWORD_RESTRICTION ((NTSTATUS)0xC000006C)
#define STATUS_LOGON_FAILURE ((NTSTATUS)0xC000006D) //#define STATUS_LOGON_FAILURE ((NTSTATUS)0xC000006D)
#define STATUS_ACCOUNT_RESTRICTION ((NTSTATUS)0xC000006E) //#define STATUS_ACCOUNT_RESTRICTION ((NTSTATUS)0xC000006E)
#define STATUS_INVALID_LOGON_HOURS ((NTSTATUS)0xC000006F) #define STATUS_INVALID_LOGON_HOURS ((NTSTATUS)0xC000006F)
#define STATUS_INVALID_WORKSTATION ((NTSTATUS)0xC0000070) #define STATUS_INVALID_WORKSTATION ((NTSTATUS)0xC0000070)
#define STATUS_PASSWORD_EXPIRED ((NTSTATUS)0xC0000071) //#define STATUS_PASSWORD_EXPIRED ((NTSTATUS)0xC0000071)
#define STATUS_ACCOUNT_DISABLED ((NTSTATUS)0xC0000072) //#define STATUS_ACCOUNT_DISABLED ((NTSTATUS)0xC0000072)
#define STATUS_NONE_MAPPED ((NTSTATUS)0xC0000073) #define STATUS_NONE_MAPPED ((NTSTATUS)0xC0000073)
#define STATUS_TOO_MANY_LUIDS_REQUESTED ((NTSTATUS)0xC0000074) #define STATUS_TOO_MANY_LUIDS_REQUESTED ((NTSTATUS)0xC0000074)
#define STATUS_LUIDS_EXHAUSTED ((NTSTATUS)0xC0000075) #define STATUS_LUIDS_EXHAUSTED ((NTSTATUS)0xC0000075)
@ -352,17 +437,17 @@
#define STATUS_RESOURCE_DATA_NOT_FOUND ((NTSTATUS)0xC0000089) #define STATUS_RESOURCE_DATA_NOT_FOUND ((NTSTATUS)0xC0000089)
#define STATUS_RESOURCE_TYPE_NOT_FOUND ((NTSTATUS)0xC000008A) #define STATUS_RESOURCE_TYPE_NOT_FOUND ((NTSTATUS)0xC000008A)
#define STATUS_RESOURCE_NAME_NOT_FOUND ((NTSTATUS)0xC000008B) #define STATUS_RESOURCE_NAME_NOT_FOUND ((NTSTATUS)0xC000008B)
#define STATUS_ARRAY_BOUNDS_EXCEEDED ((NTSTATUS)0xC000008C) //#define STATUS_ARRAY_BOUNDS_EXCEEDED ((NTSTATUS)0xC000008C)
#define STATUS_FLOAT_DENORMAL_OPERAND ((NTSTATUS)0xC000008D) //#define STATUS_FLOAT_DENORMAL_OPERAND ((NTSTATUS)0xC000008D)
#define STATUS_FLOAT_DIVIDE_BY_ZERO ((NTSTATUS)0xC000008E) //#define STATUS_FLOAT_DIVIDE_BY_ZERO ((NTSTATUS)0xC000008E)
#define STATUS_FLOAT_INEXACT_RESULT ((NTSTATUS)0xC000008F) //#define STATUS_FLOAT_INEXACT_RESULT ((NTSTATUS)0xC000008F)
#define STATUS_FLOAT_INVALID_OPERATION ((NTSTATUS)0xC0000090) //#define STATUS_FLOAT_INVALID_OPERATION ((NTSTATUS)0xC0000090)
#define STATUS_FLOAT_OVERFLOW ((NTSTATUS)0xC0000091) //#define STATUS_FLOAT_OVERFLOW ((NTSTATUS)0xC0000091)
#define STATUS_FLOAT_STACK_CHECK ((NTSTATUS)0xC0000092) //#define STATUS_FLOAT_STACK_CHECK ((NTSTATUS)0xC0000092)
#define STATUS_FLOAT_UNDERFLOW ((NTSTATUS)0xC0000093) //#define STATUS_FLOAT_UNDERFLOW ((NTSTATUS)0xC0000093)
#define STATUS_INTEGER_DIVIDE_BY_ZERO ((NTSTATUS)0xC0000094) //#define STATUS_INTEGER_DIVIDE_BY_ZERO ((NTSTATUS)0xC0000094)
#define STATUS_INTEGER_OVERFLOW ((NTSTATUS)0xC0000095) //#define STATUS_INTEGER_OVERFLOW ((NTSTATUS)0xC0000095)
#define STATUS_PRIVILEGED_INSTRUCTION ((NTSTATUS)0xC0000096) //#define STATUS_PRIVILEGED_INSTRUCTION ((NTSTATUS)0xC0000096)
#define STATUS_TOO_MANY_PAGING_FILES ((NTSTATUS)0xC0000097) #define STATUS_TOO_MANY_PAGING_FILES ((NTSTATUS)0xC0000097)
#define STATUS_FILE_INVALID ((NTSTATUS)0xC0000098) #define STATUS_FILE_INVALID ((NTSTATUS)0xC0000098)
#define STATUS_ALLOTTED_SPACE_EXCEEDED ((NTSTATUS)0xC0000099) #define STATUS_ALLOTTED_SPACE_EXCEEDED ((NTSTATUS)0xC0000099)
@ -465,7 +550,7 @@
#define STATUS_INVALID_PARAMETER_12 ((NTSTATUS)0xC00000FA) #define STATUS_INVALID_PARAMETER_12 ((NTSTATUS)0xC00000FA)
#define STATUS_REDIRECTOR_NOT_STARTED ((NTSTATUS)0xC00000FB) #define STATUS_REDIRECTOR_NOT_STARTED ((NTSTATUS)0xC00000FB)
#define STATUS_REDIRECTOR_STARTED ((NTSTATUS)0xC00000FC) #define STATUS_REDIRECTOR_STARTED ((NTSTATUS)0xC00000FC)
#define STATUS_STACK_OVERFLOW ((NTSTATUS)0xC00000FD) //#define STATUS_STACK_OVERFLOW ((NTSTATUS)0xC00000FD)
#define STATUS_NO_SUCH_PACKAGE ((NTSTATUS)0xC00000FE) #define STATUS_NO_SUCH_PACKAGE ((NTSTATUS)0xC00000FE)
#define STATUS_BAD_FUNCTION_TABLE ((NTSTATUS)0xC00000FF) #define STATUS_BAD_FUNCTION_TABLE ((NTSTATUS)0xC00000FF)
#define STATUS_VARIABLE_NOT_FOUND ((NTSTATUS)0xC0000100) #define STATUS_VARIABLE_NOT_FOUND ((NTSTATUS)0xC0000100)
@ -521,12 +606,12 @@
#define STATUS_LOGON_SERVER_CONFLICT ((NTSTATUS)0xC0000132) #define STATUS_LOGON_SERVER_CONFLICT ((NTSTATUS)0xC0000132)
#define STATUS_TIME_DIFFERENCE_AT_DC ((NTSTATUS)0xC0000133) #define STATUS_TIME_DIFFERENCE_AT_DC ((NTSTATUS)0xC0000133)
#define STATUS_SYNCHRONIZATION_REQUIRED ((NTSTATUS)0xC0000134) #define STATUS_SYNCHRONIZATION_REQUIRED ((NTSTATUS)0xC0000134)
#define STATUS_DLL_NOT_FOUND ((NTSTATUS)0xC0000135) //#define STATUS_DLL_NOT_FOUND ((NTSTATUS)0xC0000135)
#define STATUS_OPEN_FAILED ((NTSTATUS)0xC0000136) #define STATUS_OPEN_FAILED ((NTSTATUS)0xC0000136)
#define STATUS_IO_PRIVILEGE_FAILED ((NTSTATUS)0xC0000137) #define STATUS_IO_PRIVILEGE_FAILED ((NTSTATUS)0xC0000137)
#define STATUS_ORDINAL_NOT_FOUND ((NTSTATUS)0xC0000138) //#define STATUS_ORDINAL_NOT_FOUND ((NTSTATUS)0xC0000138)
#define STATUS_ENTRYPOINT_NOT_FOUND ((NTSTATUS)0xC0000139) //#define STATUS_ENTRYPOINT_NOT_FOUND ((NTSTATUS)0xC0000139)
#define STATUS_CONTROL_C_EXIT ((NTSTATUS)0xC000013A) //#define STATUS_CONTROL_C_EXIT ((NTSTATUS)0xC000013A)
#define STATUS_LOCAL_DISCONNECT ((NTSTATUS)0xC000013B) #define STATUS_LOCAL_DISCONNECT ((NTSTATUS)0xC000013B)
#define STATUS_REMOTE_DISCONNECT ((NTSTATUS)0xC000013C) #define STATUS_REMOTE_DISCONNECT ((NTSTATUS)0xC000013C)
#define STATUS_REMOTE_RESOURCES ((NTSTATUS)0xC000013D) #define STATUS_REMOTE_RESOURCES ((NTSTATUS)0xC000013D)
@ -534,7 +619,7 @@
#define STATUS_LINK_TIMEOUT ((NTSTATUS)0xC000013F) #define STATUS_LINK_TIMEOUT ((NTSTATUS)0xC000013F)
#define STATUS_INVALID_CONNECTION ((NTSTATUS)0xC0000140) #define STATUS_INVALID_CONNECTION ((NTSTATUS)0xC0000140)
#define STATUS_INVALID_ADDRESS ((NTSTATUS)0xC0000141) #define STATUS_INVALID_ADDRESS ((NTSTATUS)0xC0000141)
#define STATUS_DLL_INIT_FAILED ((NTSTATUS)0xC0000142) //#define STATUS_DLL_INIT_FAILED ((NTSTATUS)0xC0000142)
#define STATUS_MISSING_SYSTEMFILE ((NTSTATUS)0xC0000143) #define STATUS_MISSING_SYSTEMFILE ((NTSTATUS)0xC0000143)
#define STATUS_UNHANDLED_EXCEPTION ((NTSTATUS)0xC0000144) #define STATUS_UNHANDLED_EXCEPTION ((NTSTATUS)0xC0000144)
#define STATUS_APP_INIT_FAILURE ((NTSTATUS)0xC0000145) #define STATUS_APP_INIT_FAILURE ((NTSTATUS)0xC0000145)
@ -559,7 +644,7 @@
#define STATUS_INTERNAL_DB_ERROR ((NTSTATUS)0xC0000158) #define STATUS_INTERNAL_DB_ERROR ((NTSTATUS)0xC0000158)
#define STATUS_FULLSCREEN_MODE ((NTSTATUS)0xC0000159) #define STATUS_FULLSCREEN_MODE ((NTSTATUS)0xC0000159)
#define STATUS_TOO_MANY_CONTEXT_IDS ((NTSTATUS)0xC000015A) #define STATUS_TOO_MANY_CONTEXT_IDS ((NTSTATUS)0xC000015A)
#define STATUS_LOGON_TYPE_NOT_GRANTED ((NTSTATUS)0xC000015B) //#define STATUS_LOGON_TYPE_NOT_GRANTED ((NTSTATUS)0xC000015B)
#define STATUS_NOT_REGISTRY_FILE ((NTSTATUS)0xC000015C) #define STATUS_NOT_REGISTRY_FILE ((NTSTATUS)0xC000015C)
#define STATUS_NT_CROSS_ENCRYPTION_REQUIRED ((NTSTATUS)0xC000015D) #define STATUS_NT_CROSS_ENCRYPTION_REQUIRED ((NTSTATUS)0xC000015D)
#define STATUS_DOMAIN_CTRLR_CONFIG_ERROR ((NTSTATUS)0xC000015E) #define STATUS_DOMAIN_CTRLR_CONFIG_ERROR ((NTSTATUS)0xC000015E)
@ -612,7 +697,7 @@
#define STATUS_TRUST_FAILURE ((NTSTATUS)0xC0000190) #define STATUS_TRUST_FAILURE ((NTSTATUS)0xC0000190)
#define STATUS_MUTANT_LIMIT_EXCEEDED ((NTSTATUS)0xC0000191) #define STATUS_MUTANT_LIMIT_EXCEEDED ((NTSTATUS)0xC0000191)
#define STATUS_NETLOGON_NOT_STARTED ((NTSTATUS)0xC0000192) #define STATUS_NETLOGON_NOT_STARTED ((NTSTATUS)0xC0000192)
#define STATUS_ACCOUNT_EXPIRED ((NTSTATUS)0xC0000193) //#define STATUS_ACCOUNT_EXPIRED ((NTSTATUS)0xC0000193)
#define STATUS_POSSIBLE_DEADLOCK ((NTSTATUS)0xC0000194) #define STATUS_POSSIBLE_DEADLOCK ((NTSTATUS)0xC0000194)
#define STATUS_NETWORK_CREDENTIAL_CONFLICT ((NTSTATUS)0xC0000195) #define STATUS_NETWORK_CREDENTIAL_CONFLICT ((NTSTATUS)0xC0000195)
#define STATUS_REMOTE_SESSION_LIMIT ((NTSTATUS)0xC0000196) #define STATUS_REMOTE_SESSION_LIMIT ((NTSTATUS)0xC0000196)
@ -656,7 +741,7 @@
#define STATUS_IMAGE_CHECKSUM_MISMATCH ((NTSTATUS)0xC0000221) #define STATUS_IMAGE_CHECKSUM_MISMATCH ((NTSTATUS)0xC0000221)
#define STATUS_LOST_WRITEBEHIND_DATA ((NTSTATUS)0xC0000222) #define STATUS_LOST_WRITEBEHIND_DATA ((NTSTATUS)0xC0000222)
#define STATUS_CLIENT_SERVER_PARAMETERS_INVALID ((NTSTATUS)0xC0000223) #define STATUS_CLIENT_SERVER_PARAMETERS_INVALID ((NTSTATUS)0xC0000223)
#define STATUS_PASSWORD_MUST_CHANGE ((NTSTATUS)0xC0000224) //#define STATUS_PASSWORD_MUST_CHANGE ((NTSTATUS)0xC0000224)
#define STATUS_NOT_FOUND ((NTSTATUS)0xC0000225) #define STATUS_NOT_FOUND ((NTSTATUS)0xC0000225)
#define STATUS_NOT_TINY_STREAM ((NTSTATUS)0xC0000226) #define STATUS_NOT_TINY_STREAM ((NTSTATUS)0xC0000226)
#define STATUS_RECOVERY_FAILURE ((NTSTATUS)0xC0000227) #define STATUS_RECOVERY_FAILURE ((NTSTATUS)0xC0000227)
@ -672,7 +757,7 @@
#define STATUS_MARSHALL_OVERFLOW ((NTSTATUS)0xC0000231) #define STATUS_MARSHALL_OVERFLOW ((NTSTATUS)0xC0000231)
#define STATUS_INVALID_VARIANT ((NTSTATUS)0xC0000232) #define STATUS_INVALID_VARIANT ((NTSTATUS)0xC0000232)
#define STATUS_DOMAIN_CONTROLLER_NOT_FOUND ((NTSTATUS)0xC0000233) #define STATUS_DOMAIN_CONTROLLER_NOT_FOUND ((NTSTATUS)0xC0000233)
#define STATUS_ACCOUNT_LOCKED_OUT ((NTSTATUS)0xC0000234) //#define STATUS_ACCOUNT_LOCKED_OUT ((NTSTATUS)0xC0000234)
#define STATUS_HANDLE_NOT_CLOSABLE ((NTSTATUS)0xC0000235) #define STATUS_HANDLE_NOT_CLOSABLE ((NTSTATUS)0xC0000235)
#define STATUS_CONNECTION_REFUSED ((NTSTATUS)0xC0000236) #define STATUS_CONNECTION_REFUSED ((NTSTATUS)0xC0000236)
#define STATUS_GRACEFUL_DISCONNECT ((NTSTATUS)0xC0000237) #define STATUS_GRACEFUL_DISCONNECT ((NTSTATUS)0xC0000237)
@ -783,8 +868,8 @@
#define STATUS_DIRECTORY_SERVICE_REQUIRED ((NTSTATUS)0xC00002B1) #define STATUS_DIRECTORY_SERVICE_REQUIRED ((NTSTATUS)0xC00002B1)
#define STATUS_REPARSE_ATTRIBUTE_CONFLICT ((NTSTATUS)0xC00002B2) #define STATUS_REPARSE_ATTRIBUTE_CONFLICT ((NTSTATUS)0xC00002B2)
#define STATUS_CANT_ENABLE_DENY_ONLY ((NTSTATUS)0xC00002B3) #define STATUS_CANT_ENABLE_DENY_ONLY ((NTSTATUS)0xC00002B3)
#define STATUS_FLOAT_MULTIPLE_FAULTS ((NTSTATUS)0xC00002B4) //#define STATUS_FLOAT_MULTIPLE_FAULTS ((NTSTATUS)0xC00002B4)
#define STATUS_FLOAT_MULTIPLE_TRAPS ((NTSTATUS)0xC00002B5) //#define STATUS_FLOAT_MULTIPLE_TRAPS ((NTSTATUS)0xC00002B5)
#define STATUS_DEVICE_REMOVED ((NTSTATUS)0xC00002B6) #define STATUS_DEVICE_REMOVED ((NTSTATUS)0xC00002B6)
#define STATUS_JOURNAL_DELETE_IN_PROGRESS ((NTSTATUS)0xC00002B7) #define STATUS_JOURNAL_DELETE_IN_PROGRESS ((NTSTATUS)0xC00002B7)
#define STATUS_JOURNAL_NOT_ACTIVE ((NTSTATUS)0xC00002B8) #define STATUS_JOURNAL_NOT_ACTIVE ((NTSTATUS)0xC00002B8)
@ -797,7 +882,7 @@
#define STATUS_WMI_READ_ONLY ((NTSTATUS)0xC00002C6) #define STATUS_WMI_READ_ONLY ((NTSTATUS)0xC00002C6)
#define STATUS_WMI_SET_FAILURE ((NTSTATUS)0xC00002C7) #define STATUS_WMI_SET_FAILURE ((NTSTATUS)0xC00002C7)
#define STATUS_COMMITMENT_MINIMUM ((NTSTATUS)0xC00002C8) #define STATUS_COMMITMENT_MINIMUM ((NTSTATUS)0xC00002C8)
#define STATUS_REG_NAT_CONSUMPTION ((NTSTATUS)0xC00002C9) //#define STATUS_REG_NAT_CONSUMPTION ((NTSTATUS)0xC00002C9)
#define STATUS_TRANSPORT_FULL ((NTSTATUS)0xC00002CA) #define STATUS_TRANSPORT_FULL ((NTSTATUS)0xC00002CA)
#define STATUS_DS_SAM_INIT_FAILURE ((NTSTATUS)0xC00002CB) #define STATUS_DS_SAM_INIT_FAILURE ((NTSTATUS)0xC00002CB)
#define STATUS_ONLY_IF_CONNECTED ((NTSTATUS)0xC00002CC) #define STATUS_ONLY_IF_CONNECTED ((NTSTATUS)0xC00002CC)
@ -906,7 +991,7 @@
#define STATUS_SMARTCARD_NO_CERTIFICATE ((NTSTATUS)0xC0000385) #define STATUS_SMARTCARD_NO_CERTIFICATE ((NTSTATUS)0xC0000385)
#define STATUS_SMARTCARD_NO_KEYSET ((NTSTATUS)0xC0000386) #define STATUS_SMARTCARD_NO_KEYSET ((NTSTATUS)0xC0000386)
#define STATUS_SMARTCARD_IO_ERROR ((NTSTATUS)0xC0000387) #define STATUS_SMARTCARD_IO_ERROR ((NTSTATUS)0xC0000387)
#define STATUS_DOWNGRADE_DETECTED ((NTSTATUS)0xC0000388) //#define STATUS_DOWNGRADE_DETECTED ((NTSTATUS)0xC0000388)
#define STATUS_SMARTCARD_CERT_REVOKED ((NTSTATUS)0xC0000389) #define STATUS_SMARTCARD_CERT_REVOKED ((NTSTATUS)0xC0000389)
#define STATUS_ISSUING_CA_UNTRUSTED ((NTSTATUS)0xC000038A) #define STATUS_ISSUING_CA_UNTRUSTED ((NTSTATUS)0xC000038A)
#define STATUS_REVOCATION_OFFLINE_C ((NTSTATUS)0xC000038B) #define STATUS_REVOCATION_OFFLINE_C ((NTSTATUS)0xC000038B)
@ -922,7 +1007,7 @@
#define STATUS_DS_GROUP_CONVERSION_ERROR ((NTSTATUS)0xC0000406) #define STATUS_DS_GROUP_CONVERSION_ERROR ((NTSTATUS)0xC0000406)
#define STATUS_VOLSNAP_PREPARE_HIBERNATE ((NTSTATUS)0xC0000407) #define STATUS_VOLSNAP_PREPARE_HIBERNATE ((NTSTATUS)0xC0000407)
#define STATUS_USER2USER_REQUIRED ((NTSTATUS)0xC0000408) #define STATUS_USER2USER_REQUIRED ((NTSTATUS)0xC0000408)
#define STATUS_STACK_BUFFER_OVERRUN ((NTSTATUS)0xC0000409) //#define STATUS_STACK_BUFFER_OVERRUN ((NTSTATUS)0xC0000409)
#define STATUS_NO_S4U_PROT_SUPPORT ((NTSTATUS)0xC000040A) #define STATUS_NO_S4U_PROT_SUPPORT ((NTSTATUS)0xC000040A)
#define STATUS_CROSSREALM_DELEGATION_FAILURE ((NTSTATUS)0xC000040B) #define STATUS_CROSSREALM_DELEGATION_FAILURE ((NTSTATUS)0xC000040B)
#define STATUS_REVOCATION_OFFLINE_KDC ((NTSTATUS)0xC000040C) #define STATUS_REVOCATION_OFFLINE_KDC ((NTSTATUS)0xC000040C)
@ -932,11 +1017,11 @@
#define STATUS_PARAMETER_QUOTA_EXCEEDED ((NTSTATUS)0xC0000410) #define STATUS_PARAMETER_QUOTA_EXCEEDED ((NTSTATUS)0xC0000410)
#define STATUS_HIBERNATION_FAILURE ((NTSTATUS)0xC0000411) #define STATUS_HIBERNATION_FAILURE ((NTSTATUS)0xC0000411)
#define STATUS_DELAY_LOAD_FAILED ((NTSTATUS)0xC0000412) #define STATUS_DELAY_LOAD_FAILED ((NTSTATUS)0xC0000412)
#define STATUS_AUTHENTICATION_FIREWALL_FAILED ((NTSTATUS)0xC0000413) //#define STATUS_AUTHENTICATION_FIREWALL_FAILED ((NTSTATUS)0xC0000413)
#define STATUS_VDM_DISALLOWED ((NTSTATUS)0xC0000414) #define STATUS_VDM_DISALLOWED ((NTSTATUS)0xC0000414)
#define STATUS_HUNG_DISPLAY_DRIVER_THREAD ((NTSTATUS)0xC0000415) #define STATUS_HUNG_DISPLAY_DRIVER_THREAD ((NTSTATUS)0xC0000415)
#define STATUS_INVALID_CRUNTIME_PARAMETER ((NTSTATUS)0xC0000417) //#define STATUS_INVALID_CRUNTIME_PARAMETER ((NTSTATUS)0xC0000417)
#define STATUS_ASSERTION_FAILURE ((NTSTATUS)0xC0000420L) //#define STATUS_ASSERTION_FAILURE ((NTSTATUS)0xC0000420L)
#define STATUS_CALLBACK_POP_STACK ((NTSTATUS)0xC0000423) #define STATUS_CALLBACK_POP_STACK ((NTSTATUS)0xC0000423)
#define STATUS_WOW_ASSERTION ((NTSTATUS)0xC0009898) #define STATUS_WOW_ASSERTION ((NTSTATUS)0xC0009898)
@ -1156,8 +1241,8 @@
#define STATUS_SXS_THREAD_QUERIES_DISABLED ((NTSTATUS)0xC015000B) #define STATUS_SXS_THREAD_QUERIES_DISABLED ((NTSTATUS)0xC015000B)
#define STATUS_SXS_ASSEMBLY_MISSING ((NTSTATUS)0xC015000C) #define STATUS_SXS_ASSEMBLY_MISSING ((NTSTATUS)0xC015000C)
#define STATUS_SXS_PROCESS_DEFAULT_ALREADY_SET ((NTSTATUS)0xC015000E) #define STATUS_SXS_PROCESS_DEFAULT_ALREADY_SET ((NTSTATUS)0xC015000E)
#define STATUS_SXS_EARLY_DEACTIVATION ((NTSTATUS)0xC015000F) //#define STATUS_SXS_EARLY_DEACTIVATION ((NTSTATUS)0xC015000F)
#define STATUS_SXS_INVALID_DEACTIVATION ((NTSTATUS)0xC0150010) //#define STATUS_SXS_INVALID_DEACTIVATION ((NTSTATUS)0xC0150010)
#define STATUS_SXS_MULTIPLE_DEACTIVATION ((NTSTATUS)0xC0150011) #define STATUS_SXS_MULTIPLE_DEACTIVATION ((NTSTATUS)0xC0150011)
#define STATUS_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY ((NTSTATUS)0xC0150012) #define STATUS_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY ((NTSTATUS)0xC0150012)
#define STATUS_SXS_PROCESS_TERMINATION_REQUESTED ((NTSTATUS)0xC0150013) #define STATUS_SXS_PROCESS_TERMINATION_REQUESTED ((NTSTATUS)0xC0150013)
@ -1182,6 +1267,180 @@
#define STATUS_GENERIC_COMMAND_FAILED ((NTSTATUS)0xC0150026) #define STATUS_GENERIC_COMMAND_FAILED ((NTSTATUS)0xC0150026)
#define STATUS_SXS_FILE_HASH_MISSING ((NTSTATUS)0xC0150027) #define STATUS_SXS_FILE_HASH_MISSING ((NTSTATUS)0xC0150027)
/* Defined in winternl.h, always define since we do not include this header */
#ifdef _WIN32
/**
* winternl.h contains an incomplete definition of enum FILE_INFORMATION_CLASS
* avoid conflict by prefixing the winternl.h definition by _WINTERNL_ and then
* make a complete definition of enum FILE_INFORMATION_CLASS ourselves.
*
* For more information, refer to [MS-FSCC]: File System Control Codes:
* http://msdn.microsoft.com/en-us/library/cc231987.aspx
*/
#define _FILE_INFORMATION_CLASS _WINTERNL_FILE_INFORMATION_CLASS
#define FileDirectoryInformation _WINTERNL_FileDirectoryInformation
#include <winternl.h>
#undef _FILE_INFORMATION_CLASS
#undef FileDirectoryInformation
#endif
enum FILE_INFORMATION_CLASS
{
FileDirectoryInformation = 1,
FileFullDirectoryInformation,
FileBothDirectoryInformation,
FileBasicInformation,
FileStandardInformation,
FileInternalInformation,
FileEaInformation,
FileAccessInformation,
FileNameInformation,
FileRenameInformation,
FileLinkInformation,
FileNamesInformation,
FileDispositionInformation,
FilePositionInformation,
FileFullEaInformation,
FileModeInformation,
FileAlignmentInformation,
FileAllInformation,
FileAllocationInformation,
FileEndOfFileInformation,
FileAlternateNameInformation,
FileStreamInformation,
FilePipeInformation,
FilePipeLocalInformation,
FilePipeRemoteInformation,
FileMailslotQueryInformation,
FileMailslotSetInformation,
FileCompressionInformation,
FileObjectIdInformation,
FileUnknownInformation1,
FileMoveClusterInformation,
FileQuotaInformation,
FileReparsePointInformation,
FileNetworkOpenInformation,
FileAttributeTagInformation,
FileTrackingInformation,
FileIdBothDirectoryInformation,
FileIdFullDirectoryInformation,
FileValidDataLengthInformation,
FileShortNameInformation
};
#ifndef _WIN32
#define FILE_SUPERSEDE 0x00000000
#define FILE_OPEN 0x00000001
#define FILE_CREATE 0x00000002
#define FILE_OPEN_IF 0x00000003
#define FILE_OVERWRITE 0x00000004
#define FILE_OVERWRITE_IF 0x00000005
#define FILE_MAXIMUM_DISPOSITION 0x00000005
#define FILE_DIRECTORY_FILE 0x00000001
#define FILE_WRITE_THROUGH 0x00000002
#define FILE_SEQUENTIAL_ONLY 0x00000004
#define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
#define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
#define FILE_NON_DIRECTORY_FILE 0x00000040
#define FILE_CREATE_TREE_CONNECTION 0x00000080
#define FILE_COMPLETE_IF_OPLOCKED 0x00000100
#define FILE_NO_EA_KNOWLEDGE 0x00000200
#define FILE_OPEN_REMOTE_INSTANCE 0x00000400
#define FILE_RANDOM_ACCESS 0x00000800
#define FILE_DELETE_ON_CLOSE 0x00001000
#define FILE_OPEN_BY_FILE_ID 0x00002000
#define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
#define FILE_NO_COMPRESSION 0x00008000
#define FILE_OPEN_REQUIRING_OPLOCK 0x00010000
#define FILE_RESERVE_OPFILTER 0x00100000
#define FILE_OPEN_REPARSE_POINT 0x00200000
#define FILE_OPEN_NO_RECALL 0x00400000
#define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
#define FILE_VALID_OPTION_FLAGS 0x00FFFFFF
#define FILE_VALID_PIPE_OPTION_FLAGS 0x00000032
#define FILE_VALID_MAILSLOT_OPTION_FLAGS 0x00000032
#define FILE_VALID_SET_FLAGS 0x00000036
#define FILE_SUPERSEDED 0x00000000
#define FILE_OPENED 0x00000001
#define FILE_CREATED 0x00000002
#define FILE_OVERWRITTEN 0x00000003
#define FILE_EXISTS 0x00000004
#define FILE_DOES_NOT_EXIST 0x00000005
typedef CONST char *PCSZ;
typedef struct _STRING
{
USHORT Length;
USHORT MaximumLength;
PCHAR Buffer;
} STRING;
typedef STRING *PSTRING;
typedef STRING ANSI_STRING;
typedef PSTRING PANSI_STRING;
typedef PSTRING PCANSI_STRING;
typedef STRING OEM_STRING;
typedef PSTRING POEM_STRING;
typedef CONST STRING* PCOEM_STRING;
typedef struct _LSA_UNICODE_STRING
{
USHORT Length;
USHORT MaximumLength;
PWSTR Buffer;
} LSA_UNICODE_STRING, *PLSA_UNICODE_STRING, UNICODE_STRING, *PUNICODE_STRING;
#define OBJ_INHERIT 0x00000002L
#define OBJ_PERMANENT 0x00000010L
#define OBJ_EXCLUSIVE 0x00000020L
#define OBJ_CASE_INSENSITIVE 0x00000040L
#define OBJ_OPENIF 0x00000080L
#define OBJ_OPENLINK 0x00000100L
#define OBJ_KERNEL_HANDLE 0x00000200L
#define OBJ_FORCE_ACCESS_CHECK 0x00000400L
#define OBJ_VALID_ATTRIBUTES 0x000007F2L
typedef struct _OBJECT_ATTRIBUTES
{
ULONG Length;
HANDLE RootDirectory;
PUNICODE_STRING ObjectName;
ULONG Attributes;
PVOID SecurityDescriptor;
PVOID SecurityQualityOfService;
} OBJECT_ATTRIBUTES;
typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES;
typedef struct _IO_STATUS_BLOCK
{
union
{
NTSTATUS status;
PVOID Pointer;
};
ULONG_PTR Information;
} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
typedef VOID (*PIO_APC_ROUTINE)(PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG Reserved);
typedef struct _PEB PEB; typedef struct _PEB PEB;
typedef struct _PEB* PPEB; typedef struct _PEB* PPEB;
@ -1261,101 +1520,9 @@ struct _TEB
#define FILE_SHARE_WRITE 0x00000002 #define FILE_SHARE_WRITE 0x00000002
#define FILE_SHARE_DELETE 0x00000004 #define FILE_SHARE_DELETE 0x00000004
#define FILE_DIRECTORY_FILE 0x00000001
#define FILE_WRITE_THROUGH 0x00000002
#define FILE_SEQUENTIAL_ONLY 0x00000004
#define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
#define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
#define FILE_NON_DIRECTORY_FILE 0x00000040
#define FILE_CREATE_TREE_CONNECTION 0x00000080
#define FILE_COMPLETE_IF_OPLOCKED 0x00000100
#define FILE_NO_EA_KNOWLEDGE 0x00000200
#define FILE_OPEN_REMOTE_INSTANCE 0x00000400
#define FILE_RANDOM_ACCESS 0x00000800
#define FILE_DELETE_ON_CLOSE 0x00001000
#define FILE_OPEN_BY_FILE_ID 0x00002000
#define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
#define FILE_NO_COMPRESSION 0x00008000
#define FILE_OPEN_REQUIRING_OPLOCK 0x00010000
#define FILE_RESERVE_OPFILTER 0x00100000
#define FILE_OPEN_REPARSE_POINT 0x00200000
#define FILE_OPEN_NO_RECALL 0x00400000
#define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
#define FILE_VALID_OPTION_FLAGS 0x00FFFFFF
#define FILE_VALID_PIPE_OPTION_FLAGS 0x00000032
#define FILE_VALID_MAILSLOT_OPTION_FLAGS 0x00000032
#define FILE_VALID_SET_FLAGS 0x00000036
#define FILE_SUPERSEDED 0x00000000
#define FILE_OPENED 0x00000001
#define FILE_CREATED 0x00000002
#define FILE_OVERWRITTEN 0x00000003
#define FILE_EXISTS 0x00000004
#define FILE_DOES_NOT_EXIST 0x00000005
typedef DWORD ACCESS_MASK; typedef DWORD ACCESS_MASK;
typedef ACCESS_MASK* PACCESS_MASK; typedef ACCESS_MASK* PACCESS_MASK;
typedef CONST char *PCSZ;
typedef struct _STRING
{
USHORT Length;
USHORT MaximumLength;
PCHAR Buffer;
} STRING;
typedef STRING *PSTRING;
typedef STRING ANSI_STRING;
typedef PSTRING PANSI_STRING;
typedef PSTRING PCANSI_STRING;
typedef STRING OEM_STRING;
typedef PSTRING POEM_STRING;
typedef CONST STRING* PCOEM_STRING;
typedef struct _LSA_UNICODE_STRING
{
USHORT Length;
USHORT MaximumLength;
PWSTR Buffer;
} LSA_UNICODE_STRING, *PLSA_UNICODE_STRING, UNICODE_STRING, *PUNICODE_STRING;
#define OBJ_INHERIT 0x00000002L
#define OBJ_PERMANENT 0x00000010L
#define OBJ_EXCLUSIVE 0x00000020L
#define OBJ_CASE_INSENSITIVE 0x00000040L
#define OBJ_OPENIF 0x00000080L
#define OBJ_OPENLINK 0x00000100L
#define OBJ_KERNEL_HANDLE 0x00000200L
#define OBJ_FORCE_ACCESS_CHECK 0x00000400L
#define OBJ_VALID_ATTRIBUTES 0x000007F2L
typedef struct _OBJECT_ATTRIBUTES
{
ULONG Length;
HANDLE RootDirectory;
PUNICODE_STRING ObjectName;
ULONG Attributes;
PVOID SecurityDescriptor;
PVOID SecurityQualityOfService;
} OBJECT_ATTRIBUTES;
typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES;
typedef struct _IO_STATUS_BLOCK
{
union
{
NTSTATUS status;
PVOID Pointer;
};
ULONG_PTR Information;
} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
typedef VOID (*PIO_APC_ROUTINE)(PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG Reserved);
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif

View File

@ -29,6 +29,8 @@
#include <winpr/error.h> #include <winpr/error.h>
#include <winpr/handle.h> #include <winpr/handle.h>
#include <winpr/nt.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -269,6 +271,12 @@ WINPR_API BOOL CancelWaitableTimer(HANDLE hTimer);
#endif #endif
#if ((_WIN32) && (_WIN32_WINNT < 0x0600))
WINPR_API BOOL InitializeCriticalSectionEx(LPCRITICAL_SECTION lpCriticalSection, DWORD dwSpinCount, DWORD Flags);
#endif
/* Extended API */ /* Extended API */
WINPR_API VOID USleep(DWORD dwMicroseconds); WINPR_API VOID USleep(DWORD dwMicroseconds);

View File

@ -5,6 +5,7 @@
int TestNtCreateFile(int argc, char* argv[]) int TestNtCreateFile(int argc, char* argv[])
{ {
#if 0
HANDLE handle; HANDLE handle;
NTSTATUS ntstatus; NTSTATUS ntstatus;
ULONG CreateOptions; ULONG CreateOptions;
@ -25,6 +26,7 @@ int TestNtCreateFile(int argc, char* argv[])
ntstatus = NtCreateFile(&handle, DesiredAccess, &attributes, &ioStatusBlock, 0, 0, 0, CreateOptions, 0, 0, 0); ntstatus = NtCreateFile(&handle, DesiredAccess, &attributes, &ioStatusBlock, 0, 0, 0, CreateOptions, 0, 0, 0);
RtlFreeUnicodeString(&uString); RtlFreeUnicodeString(&uString);
#endif
return 0; return 0;
} }

View File

@ -5,6 +5,7 @@
int TestNtCurrentTeb(int argc, char* argv[]) int TestNtCurrentTeb(int argc, char* argv[])
{ {
#ifndef _WIN32
PTEB teb; PTEB teb;
teb = NtCurrentTeb(); teb = NtCurrentTeb();
@ -14,7 +15,7 @@ int TestNtCurrentTeb(int argc, char* argv[])
printf("NtCurrentTeb() returned NULL\n"); printf("NtCurrentTeb() returned NULL\n");
return -1; return -1;
} }
#endif
return 0; return 0;
} }

View File

@ -22,6 +22,7 @@
#include "config.h" #include "config.h"
#endif #endif
#include <winpr/tchar.h>
#include <winpr/synch.h> #include <winpr/synch.h>
#include <winpr/sysinfo.h> #include <winpr/sysinfo.h>
#include <winpr/interlocked.h> #include <winpr/interlocked.h>
@ -233,3 +234,49 @@ VOID DeleteCriticalSection(LPCRITICAL_SECTION lpCriticalSection)
} }
#endif #endif
#if ((_WIN32) && (_WIN32_WINNT < 0x0600))
typedef BOOL (WINAPI * PINITIALIZE_CRITICAL_SECTION_EX_FN)(LPCRITICAL_SECTION lpCriticalSection, DWORD dwSpinCount, DWORD Flags);
static HMODULE g_KERNEL32_Library = NULL;
static BOOL g_InitializeCriticalSectionEx_Detected = FALSE;
static BOOL g_InitializeCriticalSectionEx_Available = FALSE;
static PINITIALIZE_CRITICAL_SECTION_EX_FN g_pInitializeCriticalSectionEx = NULL;
BOOL InitializeCriticalSectionEx(LPCRITICAL_SECTION lpCriticalSection, DWORD dwSpinCount, DWORD Flags)
{
if (!g_InitializeCriticalSectionEx_Detected)
{
g_KERNEL32_Library = LoadLibrary(_T("kernel32.dll"));
if (g_KERNEL32_Library)
{
g_pInitializeCriticalSectionEx = (PINITIALIZE_CRITICAL_SECTION_EX_FN)
GetProcAddress(g_KERNEL32_Library, "InitializeCriticalSectionEx");
g_InitializeCriticalSectionEx_Available = (g_pInitializeCriticalSectionEx) ? TRUE : FALSE;
}
else
{
g_InitializeCriticalSectionEx_Available = FALSE;
}
g_InitializeCriticalSectionEx_Detected = TRUE;
}
if (g_InitializeCriticalSectionEx_Available)
{
/* Vista and later */
return (*g_pInitializeCriticalSectionEx)(lpCriticalSection, dwSpinCount, Flags);
}
else
{
/* Windows XP */
InitializeCriticalSection(lpCriticalSection);
}
return TRUE;
}
#endif

View File

@ -7,7 +7,6 @@
#include <winpr/thread.h> #include <winpr/thread.h>
#include <winpr/interlocked.h> #include <winpr/interlocked.h>
#define TEST_SYNC_CRITICAL_TEST1_RUNTIME_MS 500 #define TEST_SYNC_CRITICAL_TEST1_RUNTIME_MS 500
#define TEST_SYNC_CRITICAL_TEST1_RUNS 4 #define TEST_SYNC_CRITICAL_TEST1_RUNS 4

View File

@ -4,11 +4,12 @@
int TestSynchWaitableTimer(int argc, char* argv[]) int TestSynchWaitableTimer(int argc, char* argv[])
{ {
DWORD status;
HANDLE timer; HANDLE timer;
LONG period; LONG period;
LARGE_INTEGER due; LARGE_INTEGER due;
timer = CreateWaitableTimer(NULL, TRUE, NULL); timer = CreateWaitableTimer(NULL, FALSE, NULL);
if (!timer) if (!timer)
{ {
@ -24,7 +25,9 @@ int TestSynchWaitableTimer(int argc, char* argv[])
return -1; return -1;
} }
if (WaitForSingleObject(timer, INFINITE) != WAIT_OBJECT_0) status = WaitForSingleObject(timer, INFINITE);
if (status != WAIT_OBJECT_0)
{ {
printf("WaitForSingleObject(timer, INFINITE) failure\n"); printf("WaitForSingleObject(timer, INFINITE) failure\n");
return -1; return -1;
@ -32,9 +35,11 @@ int TestSynchWaitableTimer(int argc, char* argv[])
printf("Timer Signaled\n"); printf("Timer Signaled\n");
if (WaitForSingleObject(timer, 2000) != WAIT_TIMEOUT) status = WaitForSingleObject(timer, 2000);
if (status != WAIT_TIMEOUT)
{ {
printf("WaitForSingleObject(timer, 2000) failure\n"); printf("WaitForSingleObject(timer, 2000) failure: Actual: 0x%04X, Expected: 0x%04X\n", status, WAIT_TIMEOUT);
return -1; return -1;
} }

View File

@ -53,8 +53,11 @@ int CommandLineParseArgumentsA(int argc, LPCSTR* argv, COMMAND_LINE_ARGUMENT_A*
int count; int count;
int length; int length;
int index; int index;
BOOL match, found, argument = FALSE; BOOL match;
BOOL notescaped = FALSE; BOOL found;
BOOL argument;
BOOL escaped;
BOOL notescaped;
char* sigil; char* sigil;
int sigil_length; int sigil_length;
int sigil_index; int sigil_index;
@ -71,6 +74,12 @@ int CommandLineParseArgumentsA(int argc, LPCSTR* argv, COMMAND_LINE_ARGUMENT_A*
status = 0; status = 0;
match = FALSE;
found = FALSE;
argument = FALSE;
escaped = TRUE;
notescaped = FALSE;
if (!argv) if (!argv)
return status; return status;
@ -82,12 +91,14 @@ int CommandLineParseArgumentsA(int argc, LPCSTR* argv, COMMAND_LINE_ARGUMENT_A*
for (i = 1; i < argc; i++) for (i = 1; i < argc; i++)
{ {
BOOL escaped = TRUE;
index = i; index = i;
escaped = TRUE;
if (preFilter) if (preFilter)
{ {
count = preFilter(context, i, argc, argv); count = preFilter(context, i, argc, argv);
if (count < 0) if (count < 0)
{ {
status = COMMAND_LINE_ERROR; status = COMMAND_LINE_ERROR;
@ -96,7 +107,7 @@ int CommandLineParseArgumentsA(int argc, LPCSTR* argv, COMMAND_LINE_ARGUMENT_A*
if (count > 0) if (count > 0)
{ {
i += count; i += (count - 1);
continue; continue;
} }
} }
@ -136,6 +147,7 @@ int CommandLineParseArgumentsA(int argc, LPCSTR* argv, COMMAND_LINE_ARGUMENT_A*
{ {
if (notescaped) if (notescaped)
return COMMAND_LINE_ERROR; return COMMAND_LINE_ERROR;
sigil_length = 0; sigil_length = 0;
escaped = FALSE; escaped = FALSE;
notescaped = TRUE; notescaped = TRUE;
@ -144,7 +156,7 @@ int CommandLineParseArgumentsA(int argc, LPCSTR* argv, COMMAND_LINE_ARGUMENT_A*
{ {
return COMMAND_LINE_ERROR; return COMMAND_LINE_ERROR;
} }
if ((sigil_length > 0) || (flags & COMMAND_LINE_SIGIL_NONE) || if ((sigil_length > 0) || (flags & COMMAND_LINE_SIGIL_NONE) ||
(flags & COMMAND_LINE_SIGIL_NOT_ESCAPED)) (flags & COMMAND_LINE_SIGIL_NOT_ESCAPED))
{ {

View File

@ -25,12 +25,7 @@ set(${MODULE_PREFIX}_SRCS
include_directories(${ZLIB_INCLUDE_DIRS}) include_directories(${ZLIB_INCLUDE_DIRS})
include_directories(${OPENSSL_INCLUDE_DIR}) include_directories(${OPENSSL_INCLUDE_DIR})
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS}) add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
# This line compiles the static libraries with -fPIC to allow linking
# to shared libraries later on...
# TODO: Remove this non portable way of linking.
set_target_properties(${MODULE_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
set(${MODULE_PREFIX}_LIBS set(${MODULE_PREFIX}_LIBS
${ZLIB_LIBRARIES} ${ZLIB_LIBRARIES}