*
* @return 0 on success, otherwise a Win32 error code
*/
-static UINT rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, BOOL userLoggedOn);
+static UINT rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr,
+ BOOL userLoggedOn);
/**
* Function description
*
* @return 0 on success, otherwise a Win32 error code
*/
-static UINT rdpdr_send_device_list_remove_request(rdpdrPlugin* rdpdr, UINT32 count, UINT32 ids[])
+static UINT rdpdr_send_device_list_remove_request(rdpdrPlugin* rdpdr,
+ UINT32 count, UINT32 ids[])
{
UINT32 i;
wStream* s;
-
s = Stream_New(NULL, count * sizeof(UINT32) + 8);
+
if (!s)
{
WLog_ERR(TAG, "Stream_New failed!");
Stream_Write_UINT32(s, ids[i]);
Stream_SealLength(s);
-
return rdpdr_send(rdpdr, s);
}
#ifdef _UWP
-void first_hotplug(rdpdrPlugin *rdpdr)
+void first_hotplug(rdpdrPlugin* rdpdr)
{
-
}
static void* drive_hotplug_thread_func(void* arg)
BOOL check_path(char* path)
{
UINT type = GetDriveTypeA(path);
+
if (!(type == DRIVE_REMOVABLE || type == DRIVE_CDROM || type == DRIVE_REMOTE))
return FALSE;
+
return GetVolumeInformationA(path, NULL, 0, NULL, NULL, NULL, NULL, 0);
}
-void first_hotplug(rdpdrPlugin *rdpdr)
+void first_hotplug(rdpdrPlugin* rdpdr)
{
int i;
char drive_path[5] = { 'c', ':', '\\', '\0' };
-
DWORD unitmask = GetLogicalDrives();
for (i = 0; i < 26; i++)
if (unitmask & 0x01)
{
RDPDR_DRIVE* drive;
-
drive_path[0] = 'A' + i;
drive_path[1] = ':';
drive->Path = _strdup(drive_path);
drive_path[1] = '\0';
drive->Name = _strdup(drive_path);
- devman_load_device_service(rdpdr->devman, (RDPDR_DEVICE *)drive, rdpdr->rdpcontext);
+ devman_load_device_service(rdpdr->devman, (RDPDR_DEVICE*)drive,
+ rdpdr->rdpcontext);
}
}
+
unitmask = unitmask >> 1;
}
}
LRESULT CALLBACK hotplug_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
- rdpdrPlugin *rdpdr;
+ rdpdrPlugin* rdpdr;
PDEV_BROADCAST_HDR lpdb = (PDEV_BROADCAST_HDR)lParam;
UINT error;
+ rdpdr = (rdpdrPlugin*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
- rdpdr = (rdpdrPlugin *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
-
- switch(Msg)
+ switch (Msg)
{
case WM_DEVICECHANGE:
switch (wParam)
if (unitmask & 0x01)
{
RDPDR_DRIVE* drive;
-
drive_path[0] = 'A' + i;
drive_path[1] = ':';
{
drive = (RDPDR_DRIVE*) malloc(sizeof(RDPDR_DRIVE));
ZeroMemory(drive, sizeof(RDPDR_DRIVE));
-
drive->Type = RDPDR_DTYP_FILESYSTEM;
-
drive->Path = _strdup(drive_path);
drive_path[1] = '\0';
drive->Name = _strdup(drive_path);
- devman_load_device_service(rdpdr->devman, (RDPDR_DEVICE *)drive, rdpdr->rdpcontext);
+ devman_load_device_service(rdpdr->devman, (RDPDR_DEVICE*)drive,
+ rdpdr->rdpcontext);
rdpdr_send_device_list_announce_request(rdpdr, TRUE);
}
}
+
unitmask = unitmask >> 1;
}
}
+
break;
case DBT_DEVICEREMOVECOMPLETE:
DWORD unitmask = lpdbv->dbcv_unitmask;
int i, j, count;
char drive_name_upper, drive_name_lower;
-
- ULONG_PTR *keys;
- DEVICE_DRIVE_EXT *device_ext;
+ ULONG_PTR* keys;
+ DEVICE_DRIVE_EXT* device_ext;
UINT32 ids[1];
for (i = 0; i < 26; i++)
{
drive_name_upper = 'A' + i;
drive_name_lower = 'a' + i;
-
count = ListDictionary_GetKeys(rdpdr->devman->devices, &keys);
for (j = 0; j < count; j++)
{
- device_ext = (DEVICE_DRIVE_EXT *)ListDictionary_GetItemValue(rdpdr->devman->devices, (void *)keys[j]);
- if (device_ext->path[0] == drive_name_upper || device_ext->path[0] == drive_name_lower)
+ device_ext = (DEVICE_DRIVE_EXT*)ListDictionary_GetItemValue(
+ rdpdr->devman->devices, (void*)keys[j]);
+
+ if (device_ext->path[0] == drive_name_upper
+ || device_ext->path[0] == drive_name_lower)
{
- devman_unregister_device(rdpdr->devman, (void *)keys[j]);
+ devman_unregister_device(rdpdr->devman, (void*)keys[j]);
ids[0] = keys[j];
+
if ((error = rdpdr_send_device_list_remove_request(rdpdr, 1, ids)))
{
// dont end on error, just report ?
- WLog_ERR(TAG, "rdpdr_send_device_list_remove_request failed with error %lu!", error);
+ WLog_ERR(TAG, "rdpdr_send_device_list_remove_request failed with error %lu!",
+ error);
}
+
break;
}
}
}
+
unitmask = unitmask >> 1;
}
}
+
break;
default:
break;
}
+
break;
default:
return DefWindowProc(hWnd, Msg, wParam, lParam);
}
+
return DefWindowProc(hWnd, Msg, wParam, lParam);
}
static void* drive_hotplug_thread_func(void* arg)
{
- rdpdrPlugin *rdpdr;
+ rdpdrPlugin* rdpdr;
WNDCLASSEX wnd_cls;
HWND hwnd;
MSG msg;
BOOL bRet;
DEV_BROADCAST_HANDLE NotificationFilter;
HDEVNOTIFY hDevNotify;
-
- rdpdr = (rdpdrPlugin *)arg;
-
+ rdpdr = (rdpdrPlugin*)arg;
/* init windows class */
wnd_cls.cbSize = sizeof(WNDCLASSEX);
wnd_cls.style = CS_HREDRAW | CS_VREDRAW;
wnd_cls.hInstance = NULL;
wnd_cls.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
RegisterClassEx(&wnd_cls);
-
/* create window */
hwnd = CreateWindowEx(0, L"DRIVE_HOTPLUG", NULL,
- 0, 0, 0, 0, 0,
- NULL, NULL, NULL, NULL);
+ 0, 0, 0, 0, 0,
+ NULL, NULL, NULL, NULL);
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)rdpdr);
-
rdpdr->hotplug_wnd = hwnd;
/* register device interface to hwnd */
NotificationFilter.dbch_size = sizeof(DEV_BROADCAST_HANDLE);
NotificationFilter.dbch_devicetype = DBT_DEVTYP_HANDLE;
- hDevNotify = RegisterDeviceNotification(hwnd, &NotificationFilter, DEVICE_NOTIFY_WINDOW_HANDLE);
+ hDevNotify = RegisterDeviceNotification(hwnd, &NotificationFilter,
+ DEVICE_NOTIFY_WINDOW_HANDLE);
/* message loop */
while ((bRet = GetMessage(&msg, 0, 0, 0)) != 0)
}
UnregisterDeviceNotification(hDevNotify);
-
return NULL;
}
static UINT drive_hotplug_thread_terminate(rdpdrPlugin* rdpdr)
{
UINT error = CHANNEL_RC_OK;
+
if (rdpdr->hotplug_wnd && !PostMessage(rdpdr->hotplug_wnd, WM_QUIT, 0, 0))
{
error = GetLastError();
WLog_ERR(TAG, "PostMessage failed with error %lu", error);
}
+
return error;
}
*/
static UINT handle_hotplug(rdpdrPlugin* rdpdr)
{
- struct dirent *pDirent;
- DIR *pDir;
+ struct dirent* pDirent;
+ DIR* pDir;
char fullpath[PATH_MAX];
char* szdir = (char*)"/Volumes";
struct stat buf;
hotplug_dev dev_array[MAX_USB_DEVICES];
int count;
- DEVICE_DRIVE_EXT *device_ext;
- ULONG_PTR *keys;
+ DEVICE_DRIVE_EXT* device_ext;
+ ULONG_PTR* keys;
int i, j;
int size = 0;
UINT error;
UINT32 ids[1];
+ pDir = opendir(szdir);
- pDir = opendir (szdir);
if (pDir == NULL)
{
- printf ("Cannot open directory\n");
+ printf("Cannot open directory\n");
return ERROR_OPEN_FAILED;
}
{
sprintf(fullpath, "%s/%s", szdir, pDirent->d_name);
lstat(fullpath, &buf);
- if(S_ISDIR(buf.st_mode))
+
+ if (S_ISDIR(buf.st_mode))
{
dev_array[size].path = _strdup(fullpath);
+
if (!dev_array[size].path)
{
- closedir (pDir);
+ closedir(pDir);
error = CHANNEL_RC_NO_MEMORY;
goto cleanup;
}
+
dev_array[size++].to_add = TRUE;
}
}
}
- closedir (pDir);
+ closedir(pDir);
/* delete removed devices */
count = ListDictionary_GetKeys(rdpdr->devman->devices, &keys);
for (j = 0; j < count; j++)
{
BOOL dev_found = FALSE;
+ device_ext = (DEVICE_DRIVE_EXT*)ListDictionary_GetItemValue(
+ rdpdr->devman->devices, (void*)keys[j]);
- device_ext = (DEVICE_DRIVE_EXT *)ListDictionary_GetItemValue(rdpdr->devman->devices, (void *)keys[j]);
if (!device_ext)
continue;
if (!dev_found)
{
- devman_unregister_device(rdpdr->devman, (void *)keys[j]);
+ devman_unregister_device(rdpdr->devman, (void*)keys[j]);
ids[0] = keys[j];
+
if ((error = rdpdr_send_device_list_remove_request(rdpdr, 1, ids)))
{
- WLog_ERR(TAG, "rdpdr_send_device_list_remove_request failed with error %lu!", error);
+ WLog_ERR(TAG, "rdpdr_send_device_list_remove_request failed with error %lu!",
+ error);
goto cleanup;
}
}
if (dev_array[i].to_add)
{
char* name;
-
drive = (RDPDR_DRIVE*) calloc(1, sizeof(RDPDR_DRIVE));
+
if (!drive)
{
WLog_ERR(TAG, "calloc failed!");
}
drive->Type = RDPDR_DTYP_FILESYSTEM;
-
drive->Path = dev_array[i].path;
dev_array[i].path = NULL;
-
name = strrchr(drive->Path, '/') + 1;
drive->Name = _strdup(name);
+
if (!drive->Name)
{
WLog_ERR(TAG, "_strdup failed!");
error = CHANNEL_RC_NO_MEMORY;
goto cleanup;
}
- if ((error = devman_load_device_service(rdpdr->devman, (RDPDR_DEVICE *)drive, rdpdr->rdpcontext)))
+
+ if ((error = devman_load_device_service(rdpdr->devman, (RDPDR_DEVICE*)drive,
+ rdpdr->rdpcontext)))
{
WLog_ERR(TAG, "devman_load_device_service failed!");
free(drive->Path);
}
cleanup:
+
for (i = 0; i < size; i++)
- free (dev_array[i].path);
+ free(dev_array[i].path);
return error;
- }
+}
-static void drive_hotplug_fsevent_callback(ConstFSEventStreamRef streamRef, void *clientCallBackInfo,
- size_t numEvents, void *eventPaths, const FSEventStreamEventFlags eventFlags[],
- const FSEventStreamEventId eventIds[])
+static void drive_hotplug_fsevent_callback(ConstFSEventStreamRef streamRef,
+ void* clientCallBackInfo,
+ size_t numEvents, void* eventPaths, const FSEventStreamEventFlags eventFlags[],
+ const FSEventStreamEventId eventIds[])
{
rdpdrPlugin* rdpdr;
int i;
UINT error;
- char **paths = (char**)eventPaths;
-
+ char** paths = (char**)eventPaths;
rdpdr = (rdpdrPlugin*) clientCallBackInfo;
- for (i=0; i<numEvents; i++)
+ for (i = 0; i < numEvents; i++)
{
if (strcmp(paths[i], "/Volumes/") == 0)
{
}
else
rdpdr_send_device_list_announce_request(rdpdr, TRUE);
+
return;
}
}
}
-void first_hotplug(rdpdrPlugin *rdpdr)
+void first_hotplug(rdpdrPlugin* rdpdr)
{
UINT error;
+
if ((error = handle_hotplug(rdpdr)))
{
WLog_ERR(TAG, "handle_hotplug failed with error %lu!", error);
{
rdpdrPlugin* rdpdr;
FSEventStreamRef fsev;
- UINT error;
-
rdpdr = (rdpdrPlugin*) arg;
CFStringRef path = CFSTR("/Volumes/");
- CFArrayRef pathsToWatch = CFArrayCreate(kCFAllocatorMalloc, (const void**)&path, 1, NULL);
+ CFArrayRef pathsToWatch = CFArrayCreate(kCFAllocatorMalloc, (const void**)&path,
+ 1, NULL);
FSEventStreamContext ctx;
ZeroMemory(&ctx, sizeof(ctx));
ctx.info = arg;
- fsev = FSEventStreamCreate(kCFAllocatorMalloc, drive_hotplug_fsevent_callback, &ctx, pathsToWatch, kFSEventStreamEventIdSinceNow, 1, kFSEventStreamCreateFlagNone);
-
+ fsev = FSEventStreamCreate(kCFAllocatorMalloc, drive_hotplug_fsevent_callback,
+ &ctx, pathsToWatch, kFSEventStreamEventIdSinceNow, 1,
+ kFSEventStreamCreateFlagNone);
rdpdr->runLoop = CFRunLoopGetCurrent();
FSEventStreamScheduleWithRunLoop(fsev, rdpdr->runLoop, kCFRunLoopDefaultMode);
FSEventStreamStart(fsev);
CFRunLoopRun();
FSEventStreamStop(fsev);
FSEventStreamRelease(fsev);
-
ExitThread(CHANNEL_RC_OK);
return NULL;
}
static UINT drive_hotplug_thread_terminate(rdpdrPlugin* rdpdr)
{
UINT error;
+
if (rdpdr->hotplugThread)
{
CFRunLoopStop(rdpdr->runLoop);
WLog_ERR(TAG, "WaitForSingleObject failed with error %lu!", error);
return error;
}
+
rdpdr->hotplugThread = NULL;
}
+
return CHANNEL_RC_OK;
}
#define MAX_USB_DEVICES 100
-typedef struct _hotplug_dev {
+typedef struct _hotplug_dev
+{
char* path;
BOOL to_add;
} hotplug_dev;
char* newbuf;
char* lrbuf;
int lrsiz;
-
*len = 0;
lrsiz = 0;
lrbuf = NULL;
for (;;)
{
c = fgetc(fd);
+
if (ferror(fd))
return NULL;
{
newsiz = lrsiz + 4096;
newbuf = realloc(lrbuf, newsiz);
+
if (newbuf == NULL)
return NULL;
+
lrbuf = newbuf;
lrsiz = newsiz;
}
+
lrbuf[(*len)] = c;
if (c == '\n')
*/
static UINT handle_hotplug(rdpdrPlugin* rdpdr)
{
- FILE *f;
+ FILE* f;
size_t len;
- char *line;
- char *word;
+ char* line;
+ char* word;
unsigned int wlen;
-
hotplug_dev dev_array[MAX_USB_DEVICES];
int i, j;
int size = 0;
-
int count;
- DEVICE_DRIVE_EXT *device_ext;
- ULONG_PTR *keys;
+ DEVICE_DRIVE_EXT* device_ext;
+ ULONG_PTR* keys;
UINT32 ids[1];
UINT error = 0;
-
memset(dev_array, 0, sizeof(dev_array));
-
f = fopen("/proc/mounts", "r");
+
if (f == NULL)
{
WLog_ERR(TAG, "fopen failed!");
while ((line = next_line(f, &len)))
{
wlen = 0;
+
while ((word = get_word(line, &wlen)))
{
/* copy hotpluged device mount point to the dev_array */
dev_array[size++].to_add = TRUE;
}
else
- free (word);
+ free(word);
}
+
free(line);
}
fclose(f);
-
/* delete removed devices */
count = ListDictionary_GetKeys(rdpdr->devman->devices, &keys);
for (j = 0; j < count; j++)
{
BOOL dev_found = FALSE;
+ device_ext = (DEVICE_DRIVE_EXT*)ListDictionary_GetItemValue(
+ rdpdr->devman->devices, (void*)keys[j]);
- device_ext = (DEVICE_DRIVE_EXT *)ListDictionary_GetItemValue(rdpdr->devman->devices, (void *)keys[j]);
if (!device_ext || !device_ext->path)
continue;
/* not plugable device */
- if (strstr(device_ext->path, "/mnt/") == NULL && strstr(device_ext->path, "/media/") == NULL)
+ if (strstr(device_ext->path, "/mnt/") == NULL
+ && strstr(device_ext->path, "/media/") == NULL)
continue;
for (i = 0; i < size; i++)
if (!dev_found)
{
- devman_unregister_device(rdpdr->devman, (void *)keys[j]);
+ devman_unregister_device(rdpdr->devman, (void*)keys[j]);
ids[0] = keys[j];
+
if ((error = rdpdr_send_device_list_remove_request(rdpdr, 1, ids)))
{
- WLog_ERR(TAG, "rdpdr_send_device_list_remove_request failed with error %lu!", error);
+ WLog_ERR(TAG, "rdpdr_send_device_list_remove_request failed with error %lu!",
+ error);
goto cleanup;
}
}
if (dev_array[i].to_add)
{
char* name;
-
drive = (RDPDR_DRIVE*) calloc(1, sizeof(RDPDR_DRIVE));
+
if (!drive)
{
WLog_ERR(TAG, "calloc failed!");
}
drive->Type = RDPDR_DTYP_FILESYSTEM;
-
drive->Path = dev_array[i].path;
dev_array[i].path = NULL;
-
name = strrchr(drive->Path, '/') + 1;
drive->Name = _strdup(name);
+
if (!drive->Name)
{
WLog_ERR(TAG, "_strdup failed!");
error = CHANNEL_RC_NO_MEMORY;
goto cleanup;
}
- if ((error = devman_load_device_service(rdpdr->devman, (RDPDR_DEVICE *)drive, rdpdr->rdpcontext)))
+
+ if ((error = devman_load_device_service(rdpdr->devman, (RDPDR_DEVICE*)drive,
+ rdpdr->rdpcontext)))
{
WLog_ERR(TAG, "devman_load_device_service failed!");
free(drive->Path);
}
cleanup:
+
for (i = 0; i < size; i++)
- free (dev_array[i].path);
+ free(dev_array[i].path);
return error;
}
-void first_hotplug(rdpdrPlugin *rdpdr)
+void first_hotplug(rdpdrPlugin* rdpdr)
{
UINT error;
+
if ((error = handle_hotplug(rdpdr)))
{
WLog_ERR(TAG, "handle_hotplug failed with error %lu!", error);
int rv;
UINT error = 0;
DWORD status;
-
rdpdr = (rdpdrPlugin*) arg;
if (!(rdpdr->stopEvent = CreateEvent(NULL, TRUE, FALSE, NULL)))
tv.tv_sec = 1;
tv.tv_usec = 0;
- while ((rv = select(mfd+1, NULL, NULL, &rfds, &tv)) >= 0)
+ while ((rv = select(mfd + 1, NULL, NULL, &rfds, &tv)) >= 0)
{
status = WaitForSingleObject(rdpdr->stopEvent, 0);
+
if (status == WAIT_FAILED)
{
error = GetLastError();
WLog_ERR(TAG, "WaitForSingleObject failed with error %lu!", error);
goto out;
}
+
if (status == WAIT_OBJECT_0)
break;
}
out:
+
if (error && rdpdr->rdpcontext)
- setChannelError(rdpdr->rdpcontext, error, "drive_hotplug_thread_func reported an error");
+ setChannelError(rdpdr->rdpcontext, error,
+ "drive_hotplug_thread_func reported an error");
CloseHandle(rdpdr->stopEvent);
ExitThread((DWORD)error);
WLog_ERR(TAG, "WaitForSingleObject failed with error %lu!", error);
return error;
}
+
rdpdr->hotplugThread = NULL;
}
+
return CHANNEL_RC_OK;
}
RDPDR_DEVICE* device;
rdpSettings* settings;
UINT error = CHANNEL_RC_OK;
-
rdpdr->devman = devman_new(rdpdr);
+
if (!rdpdr->devman)
{
WLog_ERR(TAG, "devman_new failed!");
}
settings = (rdpSettings*) rdpdr->channelEntryPoints.pExtendedData;
+
if (settings->ClientHostname)
- strncpy(rdpdr->computerName, settings->ClientHostname, sizeof(rdpdr->computerName) - 1);
+ strncpy(rdpdr->computerName, settings->ClientHostname,
+ sizeof(rdpdr->computerName) - 1);
else
- strncpy(rdpdr->computerName, settings->ComputerName, sizeof(rdpdr->computerName) - 1);
+ strncpy(rdpdr->computerName, settings->ComputerName,
+ sizeof(rdpdr->computerName) - 1);
for (index = 0; index < settings->DeviceCount; index++)
{
if (device->Name && (strcmp(device->Name, "*") == 0))
{
first_hotplug(rdpdr);
+
if (!(rdpdr->hotplugThread = CreateThread(NULL, 0,
- (LPTHREAD_START_ROUTINE) drive_hotplug_thread_func, rdpdr, 0, NULL)))
+ (LPTHREAD_START_ROUTINE) drive_hotplug_thread_func, rdpdr, 0, NULL)))
{
WLog_ERR(TAG, "CreateThread failed!");
return ERROR_INTERNAL_ERROR;
continue;
}
- if ((error = devman_load_device_service(rdpdr->devman, device, rdpdr->rdpcontext)))
+ if ((error = devman_load_device_service(rdpdr->devman, device,
+ rdpdr->rdpcontext)))
{
WLog_ERR(TAG, "devman_load_device_service failed with error %lu!", error);
return error;
}
}
+
return error;
}
-static UINT rdpdr_process_server_announce_request(rdpdrPlugin* rdpdr, wStream* s)
+static UINT rdpdr_process_server_announce_request(rdpdrPlugin* rdpdr,
+ wStream* s)
{
if (Stream_GetRemainingLength(s) < 8)
return ERROR_INVALID_DATA;
Stream_Read_UINT16(s, rdpdr->versionMajor);
Stream_Read_UINT16(s, rdpdr->versionMinor);
Stream_Read_UINT32(s, rdpdr->clientID);
-
rdpdr->sequenceId++;
-
return CHANNEL_RC_OK;
}
static UINT rdpdr_send_client_announce_reply(rdpdrPlugin* rdpdr)
{
wStream* s;
-
s = Stream_New(NULL, 12);
+
if (!s)
{
WLog_ERR(TAG, "Stream_New failed!");
Stream_Write_UINT16(s, RDPDR_CTYP_CORE); /* Component (2 bytes) */
Stream_Write_UINT16(s, PAKID_CORE_CLIENTID_CONFIRM); /* PacketId (2 bytes) */
-
Stream_Write_UINT16(s, rdpdr->versionMajor);
Stream_Write_UINT16(s, rdpdr->versionMinor);
Stream_Write_UINT32(s, (UINT32) rdpdr->clientID);
-
return rdpdr_send(rdpdr, s);
}
if (!rdpdr->computerName[0])
gethostname(rdpdr->computerName, sizeof(rdpdr->computerName) - 1);
- computerNameLenW = ConvertToUnicode(CP_UTF8, 0, rdpdr->computerName, -1, &computerNameW, 0) * 2;
-
+ computerNameLenW = ConvertToUnicode(CP_UTF8, 0, rdpdr->computerName, -1,
+ &computerNameW, 0) * 2;
s = Stream_New(NULL, 16 + computerNameLenW + 2);
+
if (!s)
{
WLog_ERR(TAG, "Stream_New failed!");
Stream_Write_UINT16(s, RDPDR_CTYP_CORE); /* Component (2 bytes) */
Stream_Write_UINT16(s, PAKID_CORE_CLIENT_NAME); /* PacketId (2 bytes) */
-
Stream_Write_UINT32(s, 1); /* unicodeFlag, 0 for ASCII and 1 for Unicode */
Stream_Write_UINT32(s, 0); /* codePage, must be set to zero */
- Stream_Write_UINT32(s, computerNameLenW + 2); /* computerNameLen, including null terminator */
+ Stream_Write_UINT32(s, computerNameLenW +
+ 2); /* computerNameLen, including null terminator */
Stream_Write(s, computerNameW, computerNameLenW);
Stream_Write_UINT16(s, 0); /* null terminator */
-
free(computerNameW);
-
return rdpdr_send(rdpdr, s);
}
-static UINT rdpdr_process_server_clientid_confirm(rdpdrPlugin* rdpdr, wStream* s)
+static UINT rdpdr_process_server_clientid_confirm(rdpdrPlugin* rdpdr,
+ wStream* s)
{
UINT16 versionMajor;
UINT16 versionMinor;
*
* @return 0 on success, otherwise a Win32 error code
*/
-static UINT rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, BOOL userLoggedOn)
+static UINT rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr,
+ BOOL userLoggedOn)
{
int i;
BYTE c;
DEVICE* device;
int keyCount;
ULONG_PTR* pKeys;
-
s = Stream_New(NULL, 256);
+
if (!s)
{
WLog_ERR(TAG, "Stream_New failed!");
Stream_Write_UINT16(s, RDPDR_CTYP_CORE); /* Component (2 bytes) */
Stream_Write_UINT16(s, PAKID_CORE_DEVICELIST_ANNOUNCE); /* PacketId (2 bytes) */
-
count_pos = (int) Stream_GetPosition(s);
count = 0;
-
Stream_Seek_UINT32(s); /* deviceCount */
-
pKeys = NULL;
keyCount = ListDictionary_GetKeys(rdpdr->devman->devices, &pKeys);
for (index = 0; index < keyCount; index++)
{
- device = (DEVICE*) ListDictionary_GetItemValue(rdpdr->devman->devices, (void*) pKeys[index]);
+ device = (DEVICE*) ListDictionary_GetItemValue(rdpdr->devman->devices,
+ (void*) pKeys[index]);
/**
* 1. versionMinor 0x0005 doesn't send PAKID_CORE_USER_LOGGEDON
*/
if ((rdpdr->versionMinor == 0x0005) ||
- (device->type == RDPDR_DTYP_SMARTCARD) || userLoggedOn)
+ (device->type == RDPDR_DTYP_SMARTCARD) || userLoggedOn)
{
- data_len = (int) (device->data == NULL ? 0 : Stream_GetPosition(device->data));
+ data_len = (int)(device->data == NULL ? 0 : Stream_GetPosition(device->data));
+
if (!Stream_EnsureRemainingCapacity(s, 20 + data_len))
{
WLog_ERR(TAG, "Stream_EnsureRemainingCapacity failed!");
count++;
WLog_INFO(TAG, "registered device #%d: %s (type=%d id=%d)",
- count, device->name, device->type, device->id);
+ count, device->name, device->type, device->id);
}
}
free(pKeys);
-
pos = (int) Stream_GetPosition(s);
Stream_SetPosition(s, count_pos);
Stream_Write_UINT32(s, count);
Stream_SetPosition(s, pos);
Stream_SealLength(s);
-
return rdpdr_send(rdpdr, s);
}
{
IRP* irp;
UINT error = CHANNEL_RC_OK;
-
irp = irp_new(rdpdr->devman, s, &error);
if (!irp)
DEVICE* device;
ULONG_PTR* pKeys;
UINT error = CHANNEL_RC_OK;
-
pKeys = NULL;
keyCount = ListDictionary_GetKeys(rdpdr->devman->devices, &pKeys);
for (index = 0; index < keyCount; index++)
{
- device = (DEVICE*) ListDictionary_GetItemValue(rdpdr->devman->devices, (void*) pKeys[index]);
-
+ device = (DEVICE*) ListDictionary_GetItemValue(rdpdr->devman->devices,
+ (void*) pKeys[index]);
IFCALLRET(device->Init, error, device);
+
if (error != CHANNEL_RC_OK)
{
WLog_ERR(TAG, "Init failed!");
{
switch (packetId)
{
- case PAKID_CORE_SERVER_ANNOUNCE:
- if ((error = rdpdr_process_server_announce_request(rdpdr, s)))
- return error;
- if ((error = rdpdr_send_client_announce_reply(rdpdr)))
- {
- WLog_ERR(TAG, "rdpdr_send_client_announce_reply failed with error %lu", error);
- return error;
- }
- if ((error = rdpdr_send_client_name_request(rdpdr)))
- {
- WLog_ERR(TAG, "rdpdr_send_client_name_request failed with error %lu", error);
- return error;
- }
- if ((error = rdpdr_process_init(rdpdr)))
- {
- WLog_ERR(TAG, "rdpdr_process_init failed with error %lu", error);
- return error;
- }
- break;
+ case PAKID_CORE_SERVER_ANNOUNCE:
+ if ((error = rdpdr_process_server_announce_request(rdpdr, s)))
+ return error;
- case PAKID_CORE_SERVER_CAPABILITY:
- if ((error = rdpdr_process_capability_request(rdpdr, s)))
- return error;
- if ((error = rdpdr_send_capability_response(rdpdr)))
- {
- WLog_ERR(TAG, "rdpdr_send_capability_response failed with error %lu", error);
- return error;
- }
- break;
+ if ((error = rdpdr_send_client_announce_reply(rdpdr)))
+ {
+ WLog_ERR(TAG, "rdpdr_send_client_announce_reply failed with error %lu", error);
+ return error;
+ }
- case PAKID_CORE_CLIENTID_CONFIRM:
- if ((error = rdpdr_process_server_clientid_confirm(rdpdr, s)))
- return error;
+ if ((error = rdpdr_send_client_name_request(rdpdr)))
+ {
+ WLog_ERR(TAG, "rdpdr_send_client_name_request failed with error %lu", error);
+ return error;
+ }
- if ((error = rdpdr_send_device_list_announce_request(rdpdr, FALSE)))
- {
- WLog_ERR(TAG, "rdpdr_send_device_list_announce_request failed with error %lu", error);
- return error;
- }
- break;
+ if ((error = rdpdr_process_init(rdpdr)))
+ {
+ WLog_ERR(TAG, "rdpdr_process_init failed with error %lu", error);
+ return error;
+ }
- case PAKID_CORE_USER_LOGGEDON:
- if ((error = rdpdr_send_device_list_announce_request(rdpdr, TRUE)))
- {
- WLog_ERR(TAG, "rdpdr_send_device_list_announce_request failed with error %lu", error);
- return error;
- }
- break;
+ break;
- case PAKID_CORE_DEVICE_REPLY:
- /* connect to a specific resource */
- if (Stream_GetRemainingLength(s) < 8)
- return ERROR_INVALID_DATA;
+ case PAKID_CORE_SERVER_CAPABILITY:
+ if ((error = rdpdr_process_capability_request(rdpdr, s)))
+ return error;
- Stream_Read_UINT32(s, deviceId);
- Stream_Read_UINT32(s, status);
- break;
+ if ((error = rdpdr_send_capability_response(rdpdr)))
+ {
+ WLog_ERR(TAG, "rdpdr_send_capability_response failed with error %lu", error);
+ return error;
+ }
- case PAKID_CORE_DEVICE_IOREQUEST:
- if ((error = rdpdr_process_irp(rdpdr, s)))
- {
- WLog_ERR(TAG, "rdpdr_process_irp failed with error %lu", error);
- return error;
- }
- s = NULL;
- break;
+ break;
- default:
- WLog_ERR(TAG, "RDPDR_CTYP_CORE unknown PacketId: 0x%04X", packetId);
- return ERROR_INVALID_DATA;
- break;
+ case PAKID_CORE_CLIENTID_CONFIRM:
+ if ((error = rdpdr_process_server_clientid_confirm(rdpdr, s)))
+ return error;
+
+ if ((error = rdpdr_send_device_list_announce_request(rdpdr, FALSE)))
+ {
+ WLog_ERR(TAG, "rdpdr_send_device_list_announce_request failed with error %lu",
+ error);
+ return error;
+ }
+
+ break;
+
+ case PAKID_CORE_USER_LOGGEDON:
+ if ((error = rdpdr_send_device_list_announce_request(rdpdr, TRUE)))
+ {
+ WLog_ERR(TAG, "rdpdr_send_device_list_announce_request failed with error %lu",
+ error);
+ return error;
+ }
+
+ break;
+
+ case PAKID_CORE_DEVICE_REPLY:
+
+ /* connect to a specific resource */
+ if (Stream_GetRemainingLength(s) < 8)
+ return ERROR_INVALID_DATA;
+
+ Stream_Read_UINT32(s, deviceId);
+ Stream_Read_UINT32(s, status);
+ break;
+ case PAKID_CORE_DEVICE_IOREQUEST:
+ if ((error = rdpdr_process_irp(rdpdr, s)))
+ {
+ WLog_ERR(TAG, "rdpdr_process_irp failed with error %lu", error);
+ return error;
+ }
+
+ s = NULL;
+ break;
+
+ default:
+ WLog_ERR(TAG, "RDPDR_CTYP_CORE unknown PacketId: 0x%04X", packetId);
+ return ERROR_INVALID_DATA;
+ break;
}
}
else if (component == RDPDR_CTYP_PRN)
{
switch (packetId)
{
- case PAKID_PRN_CACHE_DATA:
- {
- UINT32 eventID;
- if (Stream_GetRemainingLength(s) < 4)
- return ERROR_INVALID_DATA;
+ case PAKID_PRN_CACHE_DATA:
+ {
+ UINT32 eventID;
- Stream_Read_UINT32(s, eventID);
- WLog_ERR(TAG, "Ignoring unhandled message PAKID_PRN_CACHE_DATA (EventID: 0x%04X)", eventID);
- }
- break;
+ if (Stream_GetRemainingLength(s) < 4)
+ return ERROR_INVALID_DATA;
- case PAKID_PRN_USING_XPS:
- WLog_ERR(TAG, "Ignoring unhandled message PAKID_PRN_USING_XPS");
- break;
+ Stream_Read_UINT32(s, eventID);
+ WLog_ERR(TAG,
+ "Ignoring unhandled message PAKID_PRN_CACHE_DATA (EventID: 0x%04X)", eventID);
+ }
+ break;
- default:
- WLog_ERR(TAG, "Unknown printing component packetID: 0x%04X", packetId);
- return ERROR_INVALID_DATA;
+ case PAKID_PRN_USING_XPS:
+ WLog_ERR(TAG, "Ignoring unhandled message PAKID_PRN_USING_XPS");
+ break;
+
+ default:
+ WLog_ERR(TAG, "Unknown printing component packetID: 0x%04X", packetId);
+ return ERROR_INVALID_DATA;
}
}
else
{
- WLog_ERR(TAG, "Unknown message: Component: 0x%04X PacketId: 0x%04X", component, packetId);
+ WLog_ERR(TAG, "Unknown message: Component: 0x%04X PacketId: 0x%04X", component,
+ packetId);
return ERROR_INVALID_DATA;
}
{
g_InitHandles = ListDictionary_New(TRUE);
}
+
if (!g_InitHandles)
{
WLog_ERR(TAG, "ListDictionary_New failed!");
WLog_ERR(TAG, "ListDictionary_Add failed!");
return ERROR_INTERNAL_ERROR;
}
+
return CHANNEL_RC_OK;
}
void rdpdr_remove_init_handle_data(void* pInitHandle)
{
ListDictionary_Remove(g_InitHandles, pInitHandle);
+
if (ListDictionary_Count(g_InitHandles) < 1)
{
ListDictionary_Free(g_InitHandles);
*/
UINT rdpdr_add_open_handle_data(DWORD openHandle, void* pUserData)
{
- void* pOpenHandle = (void*) (size_t) openHandle;
+ void* pOpenHandle = (void*)(size_t) openHandle;
if (!g_OpenHandles)
{
WLog_ERR(TAG, "ListDictionary_Add failed!");
return ERROR_INTERNAL_ERROR;
}
+
return CHANNEL_RC_OK;
}
void* rdpdr_get_open_handle_data(DWORD openHandle)
{
void* pUserData = NULL;
- void* pOpenHandle = (void*) (size_t) openHandle;
+ void* pOpenHandle = (void*)(size_t) openHandle;
pUserData = ListDictionary_GetItemValue(g_OpenHandles, pOpenHandle);
return pUserData;
}
void rdpdr_remove_open_handle_data(DWORD openHandle)
{
- void* pOpenHandle = (void*) (size_t) openHandle;
+ void* pOpenHandle = (void*)(size_t) openHandle;
ListDictionary_Remove(g_OpenHandles, pOpenHandle);
+
if (ListDictionary_Count(g_OpenHandles) < 1)
{
ListDictionary_Free(g_OpenHandles);
else
{
status = plugin->channelEntryPoints.pVirtualChannelWrite(plugin->OpenHandle,
- Stream_Buffer(s), (UINT32) Stream_GetPosition(s), s);
+ Stream_Buffer(s), (UINT32) Stream_GetPosition(s), s);
}
if (status != CHANNEL_RC_OK)
{
Stream_Free(s, TRUE);
WLog_ERR(TAG, "VirtualChannelWrite failed with %s [%08X]",
- WTSErrorToString(status), status);
+ WTSErrorToString(status), status);
}
return status;
* @return 0 on success, otherwise a Win32 error code
*/
static UINT rdpdr_virtual_channel_event_data_received(rdpdrPlugin* rdpdr,
- void* pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags)
+ void* pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags)
{
wStream* data_in;
Stream_Free(rdpdr->data_in, TRUE);
rdpdr->data_in = Stream_New(NULL, totalLength);
+
if (!rdpdr->data_in)
{
WLog_ERR(TAG, "Stream_New failed!");
}
data_in = rdpdr->data_in;
+
if (!Stream_EnsureRemainingCapacity(data_in, (int) dataLength))
{
WLog_ERR(TAG, "Stream_EnsureRemainingCapacity failed!");
return ERROR_INVALID_DATA;
}
+
Stream_Write(data_in, pData, dataLength);
if (dataFlags & CHANNEL_FLAG_LAST)
return ERROR_INTERNAL_ERROR;
}
}
+
return CHANNEL_RC_OK;
}
-static VOID VCAPITYPE rdpdr_virtual_channel_open_event(DWORD openHandle, UINT event,
- LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags)
+static VOID VCAPITYPE rdpdr_virtual_channel_open_event(DWORD openHandle,
+ UINT event,
+ LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags)
{
rdpdrPlugin* rdpdr;
UINT error = CHANNEL_RC_OK;
-
rdpdr = (rdpdrPlugin*) rdpdr_get_open_handle_data(openHandle);
if (!rdpdr || !pData)
switch (event)
{
- case CHANNEL_EVENT_DATA_RECEIVED:
- if ((error = rdpdr_virtual_channel_event_data_received(rdpdr, pData, dataLength, totalLength, dataFlags)))
- WLog_ERR(TAG, "rdpdr_virtual_channel_event_data_received failed with error %lu!", error );
- break;
+ case CHANNEL_EVENT_DATA_RECEIVED:
+ if ((error = rdpdr_virtual_channel_event_data_received(rdpdr, pData,
+ dataLength, totalLength, dataFlags)))
+ WLog_ERR(TAG,
+ "rdpdr_virtual_channel_event_data_received failed with error %lu!", error);
+
+ break;
- case CHANNEL_EVENT_WRITE_COMPLETE:
- Stream_Free((wStream*) pData, TRUE);
- break;
+ case CHANNEL_EVENT_WRITE_COMPLETE:
+ Stream_Free((wStream*) pData, TRUE);
+ break;
- case CHANNEL_EVENT_USER:
- break;
+ case CHANNEL_EVENT_USER:
+ break;
}
+
if (error && rdpdr->rdpcontext)
- setChannelError(rdpdr->rdpcontext, error, "rdpdr_virtual_channel_open_event reported an error");
+ setChannelError(rdpdr->rdpcontext, error,
+ "rdpdr_virtual_channel_open_event reported an error");
return;
}
if ((error = rdpdr_process_connect(rdpdr)))
{
WLog_ERR(TAG, "rdpdr_process_connect failed with error %lu!", error);
+
if (rdpdr->rdpcontext)
- setChannelError(rdpdr->rdpcontext, error, "rdpdr_virtual_channel_client_thread reported an error");
+ setChannelError(rdpdr->rdpcontext, error,
+ "rdpdr_virtual_channel_client_thread reported an error");
+
ExitThread((DWORD) error);
return NULL;
}
if (message.id == 0)
{
data = (wStream*) message.wParam;
+
if ((error = rdpdr_process_receive(rdpdr, data)))
{
WLog_ERR(TAG, "rdpdr_process_receive failed with error %lu!", error);
+
if (rdpdr->rdpcontext)
- setChannelError(rdpdr->rdpcontext, error, "rdpdr_virtual_channel_client_thread reported an error");
+ setChannelError(rdpdr->rdpcontext, error,
+ "rdpdr_virtual_channel_client_thread reported an error");
+
ExitThread((DWORD) error);
return NULL;
}
*
* @return 0 on success, otherwise a Win32 error code
*/
-static UINT rdpdr_virtual_channel_event_connected(rdpdrPlugin* rdpdr, LPVOID pData, UINT32 dataLength)
+static UINT rdpdr_virtual_channel_event_connected(rdpdrPlugin* rdpdr,
+ LPVOID pData, UINT32 dataLength)
{
UINT32 status;
UINT error;
-
status = rdpdr->channelEntryPoints.pVirtualChannelOpen(rdpdr->InitHandle,
- &rdpdr->OpenHandle, rdpdr->channelDef.name, rdpdr_virtual_channel_open_event);
+ &rdpdr->OpenHandle, rdpdr->channelDef.name, rdpdr_virtual_channel_open_event);
if (status != CHANNEL_RC_OK)
{
WLog_ERR(TAG, "pVirtualChannelOpen failed with %s [%08X]",
- WTSErrorToString(status), status);
+ WTSErrorToString(status), status);
return status;
}
}
rdpdr->queue = MessageQueue_New(NULL);
+
if (!rdpdr->queue)
{
WLog_ERR(TAG, "MessageQueue_New failed!");
}
if (!(rdpdr->thread = CreateThread(NULL, 0,
- (LPTHREAD_START_ROUTINE) rdpdr_virtual_channel_client_thread, (void*) rdpdr, 0, NULL)))
+ (LPTHREAD_START_ROUTINE) rdpdr_virtual_channel_client_thread, (void*) rdpdr, 0,
+ NULL)))
{
WLog_ERR(TAG, "CreateThread failed!");
return ERROR_INTERNAL_ERROR;
}
+
return CHANNEL_RC_OK;
}
{
UINT error;
- if (MessageQueue_PostQuit(rdpdr->queue, 0) && (WaitForSingleObject(rdpdr->thread, INFINITE) == WAIT_FAILED))
+ if (MessageQueue_PostQuit(rdpdr->queue, 0)
+ && (WaitForSingleObject(rdpdr->thread, INFINITE) == WAIT_FAILED))
{
error = GetLastError();
WLog_ERR(TAG, "WaitForSingleObject failed with error %lu!", error);
MessageQueue_Free(rdpdr->queue);
CloseHandle(rdpdr->thread);
-
rdpdr->queue = NULL;
rdpdr->thread = NULL;
}
error = rdpdr->channelEntryPoints.pVirtualChannelClose(rdpdr->OpenHandle);
+
if (CHANNEL_RC_OK != error)
{
WLog_ERR(TAG, "pVirtualChannelClose failed with %s [%08X]",
- WTSErrorToString(error), error);
+ WTSErrorToString(error), error);
}
if (rdpdr->data_in)
static void rdpdr_virtual_channel_event_terminated(rdpdrPlugin* rdpdr)
{
rdpdr_remove_init_handle_data(rdpdr->InitHandle);
-
free(rdpdr);
}
-static VOID VCAPITYPE rdpdr_virtual_channel_init_event(LPVOID pInitHandle, UINT event,
- LPVOID pData, UINT dataLength)
+static VOID VCAPITYPE rdpdr_virtual_channel_init_event(LPVOID pInitHandle,
+ UINT event,
+ LPVOID pData, UINT dataLength)
{
rdpdrPlugin* rdpdr;
UINT error = CHANNEL_RC_OK;
-
rdpdr = (rdpdrPlugin*) rdpdr_get_init_handle_data(pInitHandle);
if (!rdpdr)
switch (event)
{
- case CHANNEL_EVENT_INITIALIZED:
- break;
- case CHANNEL_EVENT_CONNECTED:
- if ((error = rdpdr_virtual_channel_event_connected(rdpdr, pData, dataLength)))
- WLog_ERR(TAG, "rdpdr_virtual_channel_event_connected failed with error %lu!", error);
- break;
+ case CHANNEL_EVENT_INITIALIZED:
+ break;
+
+ case CHANNEL_EVENT_CONNECTED:
+ if ((error = rdpdr_virtual_channel_event_connected(rdpdr, pData, dataLength)))
+ WLog_ERR(TAG, "rdpdr_virtual_channel_event_connected failed with error %lu!",
+ error);
- case CHANNEL_EVENT_DISCONNECTED:
- if ((error = rdpdr_virtual_channel_event_disconnected(rdpdr)))
- WLog_ERR(TAG, "rdpdr_virtual_channel_event_disconnected failed with error %lu!", error);
- break;
+ break;
- case CHANNEL_EVENT_TERMINATED:
- rdpdr_virtual_channel_event_terminated(rdpdr);
- break;
- default:
- WLog_ERR(TAG, "unknown event %d!", event);
- error = ERROR_INVALID_DATA;
- break;
+ case CHANNEL_EVENT_DISCONNECTED:
+ if ((error = rdpdr_virtual_channel_event_disconnected(rdpdr)))
+ WLog_ERR(TAG, "rdpdr_virtual_channel_event_disconnected failed with error %lu!",
+ error);
+
+ break;
+
+ case CHANNEL_EVENT_TERMINATED:
+ rdpdr_virtual_channel_event_terminated(rdpdr);
+ break;
+
+ default:
+ WLog_ERR(TAG, "unknown event %d!", event);
+ error = ERROR_INVALID_DATA;
+ break;
}
if (error && rdpdr->rdpcontext)
- setChannelError(rdpdr->rdpcontext, error, "rdpdr_virtual_channel_init_event reported an error");
+ setChannelError(rdpdr->rdpcontext, error,
+ "rdpdr_virtual_channel_init_event reported an error");
}
/* rdpdr is always built-in */
UINT rc;
rdpdrPlugin* rdpdr;
CHANNEL_ENTRY_POINTS_FREERDP* pEntryPointsEx;
-
rdpdr = (rdpdrPlugin*) calloc(1, sizeof(rdpdrPlugin));
if (!rdpdr)
}
rdpdr->channelDef.options =
- CHANNEL_OPTION_INITIALIZED |
- CHANNEL_OPTION_ENCRYPT_RDP |
- CHANNEL_OPTION_COMPRESS_RDP;
-
+ CHANNEL_OPTION_INITIALIZED |
+ CHANNEL_OPTION_ENCRYPT_RDP |
+ CHANNEL_OPTION_COMPRESS_RDP;
strcpy(rdpdr->channelDef.name, "rdpdr");
-
rdpdr->sequenceId = 0;
-
pEntryPointsEx = (CHANNEL_ENTRY_POINTS_FREERDP*) pEntryPoints;
if ((pEntryPointsEx->cbSize >= sizeof(CHANNEL_ENTRY_POINTS_FREERDP)) &&
- (pEntryPointsEx->MagicNumber == FREERDP_CHANNEL_MAGIC_NUMBER))
+ (pEntryPointsEx->MagicNumber == FREERDP_CHANNEL_MAGIC_NUMBER))
{
-
rdpdr->rdpcontext = pEntryPointsEx->context;
}
- CopyMemory(&(rdpdr->channelEntryPoints), pEntryPoints, sizeof(CHANNEL_ENTRY_POINTS_FREERDP));
-
+ CopyMemory(&(rdpdr->channelEntryPoints), pEntryPoints,
+ sizeof(CHANNEL_ENTRY_POINTS_FREERDP));
rc = rdpdr->channelEntryPoints.pVirtualChannelInit(&rdpdr->InitHandle,
- &rdpdr->channelDef, 1, VIRTUAL_CHANNEL_VERSION_WIN2000, rdpdr_virtual_channel_init_event);
+ &rdpdr->channelDef, 1, VIRTUAL_CHANNEL_VERSION_WIN2000,
+ rdpdr_virtual_channel_init_event);
if (CHANNEL_RC_OK != rc)
{
WLog_ERR(TAG, "pVirtualChannelInit failed with %s [%08X]",
- WTSErrorToString(rc), rc);
+ WTSErrorToString(rc), rc);
free(rdpdr);
return FALSE;
}
WLog_ERR(TAG, "Format %s not supported!", GetColorFormatName(DstFormat));
}
- if (nDstStep <= 0)
+ if (nDstStep <= 0)
nDstStep = dstBytesPerPixel * nWidth;
nDstPad = (nDstStep - (nWidth * dstBytesPerPixel));
for (x = 0; x < nWidth; x++)
{
- UINT32 color;
+ UINT32 color = 0;
xorPixel = (*xorBits & xorBit) ? 1 : 0;
if (!(xorBit >>= 1))
UINT32 subWidth;
UINT32 subHeight;
UINT32 planeSize;
- UINT32 rleSizes[4];
+ INT32 rleSizes[4];
UINT32 rawSizes[4];
UINT32 rawWidths[4];
UINT32 rawHeights[4];
const UINT32 w = MIN(nSrcWidth, nDstWidth);
const UINT32 h = MIN(nSrcHeight, nDstHeight);
const primitives_t* prims = primitives_get();
-
- if ((nSrcWidth < 0) || (nSrcHeight < 0))
- return FALSE;
-
dstBitsPerPixel = GetBitsPerPixel(DstFormat);
dstBytesPerPixel = GetBytesPerPixel(DstFormat);
UINT32 nWidth, UINT32 nHeight, UINT16 surfaceId)
{
INT32 rc = 1;
- UINT status;
+ INT32 status;
const BYTE* block;
const BYTE* blocks;
UINT16 i, j;
BYTE* p;
HGDI_BITMAP hBmp = (HGDI_BITMAP) hdcBmp->selectedObject;
- if (x >= 0 && x < hBmp->width && y >= 0 && y < hBmp->height)
+ if (x < hBmp->width && y < hBmp->height)
{
p = hBmp->data + (y * hBmp->scanline) + (x * GetBytesPerPixel(hdcBmp->format));
return p;
|| (hdcBrush->brush->style == GDI_BS_HATCHED))
{
HGDI_BITMAP hBmpBrush = hdcBrush->brush->pattern;
-
/* According to @msdn{dd183396}, the system always positions a brush bitmap
* at the brush origin and copy across the client area.
* Calculate the offset of the mapped pixel in the brush bitmap according to
* brush origin and dest coordinates */
- if (x >= 0 && y >= 0)
- {
- x = (x + hBmpBrush->width - (hdcBrush->brush->nXOrg % hBmpBrush->width)) %
- hBmpBrush->width;
- y = (y + hBmpBrush->height - (hdcBrush->brush->nYOrg % hBmpBrush->height)) %
- hBmpBrush->height;
- p = hBmpBrush->data + (y * hBmpBrush->scanline) + (x * GetBytesPerPixel(
- hBmpBrush->format));
- return p;
- }
+ x = (x + hBmpBrush->width - (hdcBrush->brush->nXOrg % hBmpBrush->width)) %
+ hBmpBrush->width;
+ y = (y + hBmpBrush->height - (hdcBrush->brush->nYOrg % hBmpBrush->height)) %
+ hBmpBrush->height;
+ p = hBmpBrush->data + (y * hBmpBrush->scanline) + (x * GetBytesPerPixel(
+ hBmpBrush->format));
+ return p;
}
}
gdi_CRgnToRect(x, y, w, h, &rgn);
gdi_RgnToRect(invalid, &inv);
- if (rgn.left < 0)
- rgn.left = 0;
-
- if (rgn.top < 0)
- rgn.top = 0;
-
if (rgn.left < inv.left)
inv.left = rgn.left;
typedef struct _UUID_VECTOR
{
unsigned long Count;
- UUID *Uuid[1];
+ UUID* Uuid[1];
} UUID_VECTOR;
#define uuid_vector_t UUID_VECTOR
-typedef void *RPC_IF_HANDLE;
+typedef void* RPC_IF_HANDLE;
typedef struct _RPC_IF_ID
{
typedef struct _RPC_PROTSEQ_VECTORA
{
unsigned int Count;
- unsigned char *Protseq[1];
+ unsigned char* Protseq[1];
} RPC_PROTSEQ_VECTORA;
typedef struct _RPC_PROTSEQ_VECTORW
{
unsigned int Count;
- unsigned short *Protseq[1];
+ unsigned short* Protseq[1];
} RPC_PROTSEQ_VECTORW;
#ifdef UNICODE
unsigned long NICFlags;
} RPC_POLICY, *PRPC_POLICY;
-typedef void RPC_OBJECT_INQ_FN(UUID* ObjectUuid, UUID* TypeUuid, RPC_STATUS* pStatus);
-typedef RPC_STATUS RPC_IF_CALLBACK_FN(RPC_IF_HANDLE InterfaceUuid, void* Context);
+typedef void RPC_OBJECT_INQ_FN(UUID* ObjectUuid, UUID* TypeUuid,
+ RPC_STATUS* pStatus);
+typedef RPC_STATUS RPC_IF_CALLBACK_FN(RPC_IF_HANDLE InterfaceUuid,
+ void* Context);
typedef void RPC_SECURITY_CALLBACK_FN(void* Context);
#define RPC_MGR_EPV void
typedef struct
{
unsigned long Count;
- RPC_IF_ID *IfId[1];
+ RPC_IF_ID* IfId[1];
} RPC_IF_ID_VECTOR;
#ifndef _WIN32
-typedef void *RPC_AUTH_IDENTITY_HANDLE;
-typedef void *RPC_AUTHZ_HANDLE;
+typedef void* RPC_AUTH_IDENTITY_HANDLE;
+typedef void* RPC_AUTHZ_HANDLE;
#define RPC_C_AUTHN_LEVEL_DEFAULT 0
#define RPC_C_AUTHN_LEVEL_NONE 1
unsigned long IdentityTracking;
unsigned long ImpersonationType;
unsigned long AdditionalSecurityInfoType;
- union {
+ union
+ {
RPC_HTTP_TRANSPORT_CREDENTIALS_W* HttpCredentials;
} u;
} RPC_SECURITY_QOS_V2_W, *PRPC_SECURITY_QOS_V2_W;
unsigned long IdentityTracking;
unsigned long ImpersonationType;
unsigned long AdditionalSecurityInfoType;
- union {
+ union
+ {
RPC_HTTP_TRANSPORT_CREDENTIALS_A* HttpCredentials;
} u;
} RPC_SECURITY_QOS_V2_A, *PRPC_SECURITY_QOS_V2_A;
unsigned long IdentityTracking;
unsigned long ImpersonationType;
unsigned long AdditionalSecurityInfoType;
- union {
+ union
+ {
RPC_HTTP_TRANSPORT_CREDENTIALS_W* HttpCredentials;
} u;
void* Sid;
unsigned long IdentityTracking;
unsigned long ImpersonationType;
unsigned long AdditionalSecurityInfoType;
- union {
+ union
+ {
RPC_HTTP_TRANSPORT_CREDENTIALS_A* HttpCredentials;
} u;
void* Sid;
RPCHTTP_RS_INTERFACE
} RPC_HTTP_REDIRECTOR_STAGE;
-typedef RPC_STATUS (*RPC_NEW_HTTP_PROXY_CHANNEL)(RPC_HTTP_REDIRECTOR_STAGE RedirectorStage,
- unsigned short* ServerName, unsigned short* ServerPort, unsigned short* RemoteUser,
- unsigned short* AuthType, void* ResourceUuid, void* Metadata, void* SessionId,
- void* Interface, void* Reserved, unsigned long Flags, unsigned short** NewServerName,
- unsigned short** NewServerPort);
+typedef RPC_STATUS(*RPC_NEW_HTTP_PROXY_CHANNEL)(RPC_HTTP_REDIRECTOR_STAGE
+ RedirectorStage,
+ unsigned short* ServerName, unsigned short* ServerPort,
+ unsigned short* RemoteUser,
+ unsigned short* AuthType, void* ResourceUuid, void* Metadata, void* SessionId,
+ void* Interface, void* Reserved, unsigned long Flags,
+ unsigned short** NewServerName,
+ unsigned short** NewServerPort);
typedef void (*RPC_HTTP_PROXY_FREE_STRING)(unsigned short* String);
#endif
-typedef void (*RPC_AUTH_KEY_RETRIEVAL_FN)(void* Arg, unsigned short* ServerPrincName, unsigned long KeyVer, void** Key, RPC_STATUS* pStatus);
+typedef void (*RPC_AUTH_KEY_RETRIEVAL_FN)(void* Arg,
+ unsigned short* ServerPrincName, unsigned long KeyVer, void** Key,
+ RPC_STATUS* pStatus);
#define DCE_C_ERROR_STRING_LEN 256
-typedef I_RPC_HANDLE *RPC_EP_INQ_HANDLE;
+typedef I_RPC_HANDLE* RPC_EP_INQ_HANDLE;
#define RPC_C_EP_ALL_ELTS 0
#define RPC_C_EP_MATCH_BY_IF 1
#define RPC_C_VERS_MAJOR_ONLY 4
#define RPC_C_VERS_UPTO 5
-typedef int (*RPC_MGMT_AUTHORIZATION_FN)(RPC_BINDING_HANDLE ClientBinding, unsigned long RequestedMgmtOperation, RPC_STATUS *pStatus);
+typedef int (*RPC_MGMT_AUTHORIZATION_FN)(RPC_BINDING_HANDLE ClientBinding,
+ unsigned long RequestedMgmtOperation, RPC_STATUS* pStatus);
#define RPC_C_MGMT_INQ_IF_IDS 0
#define RPC_C_MGMT_INQ_PRINC_NAME 1
typedef struct _RPC_BINDING_HANDLE_OPTIONS_V1
{
- unsigned long Version;
- unsigned long Flags;
- unsigned long ComTimeout;
- unsigned long CallTimeout;
+ unsigned long Version;
+ unsigned long Flags;
+ unsigned long ComTimeout;
+ unsigned long CallTimeout;
} RPC_BINDING_HANDLE_OPTIONS_V1, RPC_BINDING_HANDLE_OPTIONS;
typedef struct
unsigned long ProtocolSequence;
unsigned short* NetworkAddress;
unsigned short* StringEndpoint;
- union {
+ union
+ {
unsigned short* Reserved;
} u1;
UUID ObjectUuid;
extern "C" {
#endif
-WINPR_API RPC_STATUS RpcBindingCopy(RPC_BINDING_HANDLE SourceBinding, RPC_BINDING_HANDLE* DestinationBinding);
+WINPR_API RPC_STATUS RpcBindingCopy(RPC_BINDING_HANDLE SourceBinding,
+ RPC_BINDING_HANDLE* DestinationBinding);
WINPR_API RPC_STATUS RpcBindingFree(RPC_BINDING_HANDLE* Binding);
-WINPR_API RPC_STATUS RpcBindingSetOption(RPC_BINDING_HANDLE hBinding, unsigned long option, ULONG_PTR optionValue);
-WINPR_API RPC_STATUS RpcBindingInqOption(RPC_BINDING_HANDLE hBinding, unsigned long option, ULONG_PTR *pOptionValue);
-WINPR_API RPC_STATUS RpcBindingFromStringBindingA(RPC_CSTR StringBinding, RPC_BINDING_HANDLE* Binding);
-WINPR_API RPC_STATUS RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE* Binding);
-WINPR_API RPC_STATUS RpcSsGetContextBinding(void* ContextHandle, RPC_BINDING_HANDLE* Binding);
-WINPR_API RPC_STATUS RpcBindingInqObject(RPC_BINDING_HANDLE Binding, UUID* ObjectUuid);
+WINPR_API RPC_STATUS RpcBindingSetOption(RPC_BINDING_HANDLE hBinding,
+ unsigned long option, ULONG_PTR optionValue);
+WINPR_API RPC_STATUS RpcBindingInqOption(RPC_BINDING_HANDLE hBinding,
+ unsigned long option, ULONG_PTR* pOptionValue);
+WINPR_API RPC_STATUS RpcBindingFromStringBindingA(RPC_CSTR StringBinding,
+ RPC_BINDING_HANDLE* Binding);
+WINPR_API RPC_STATUS RpcBindingFromStringBindingW(RPC_WSTR StringBinding,
+ RPC_BINDING_HANDLE* Binding);
+WINPR_API RPC_STATUS RpcSsGetContextBinding(void* ContextHandle,
+ RPC_BINDING_HANDLE* Binding);
+WINPR_API RPC_STATUS RpcBindingInqObject(RPC_BINDING_HANDLE Binding,
+ UUID* ObjectUuid);
WINPR_API RPC_STATUS RpcBindingReset(RPC_BINDING_HANDLE Binding);
-WINPR_API RPC_STATUS RpcBindingSetObject(RPC_BINDING_HANDLE Binding, UUID* ObjectUuid);
-WINPR_API RPC_STATUS RpcMgmtInqDefaultProtectLevel(unsigned long AuthnSvc, unsigned long* AuthnLevel);
-WINPR_API RPC_STATUS RpcBindingToStringBindingA(RPC_BINDING_HANDLE Binding, RPC_CSTR* StringBinding);
-WINPR_API RPC_STATUS RpcBindingToStringBindingW(RPC_BINDING_HANDLE Binding, RPC_WSTR* StringBinding);
+WINPR_API RPC_STATUS RpcBindingSetObject(RPC_BINDING_HANDLE Binding,
+ UUID* ObjectUuid);
+WINPR_API RPC_STATUS RpcMgmtInqDefaultProtectLevel(unsigned long AuthnSvc,
+ unsigned long* AuthnLevel);
+WINPR_API RPC_STATUS RpcBindingToStringBindingA(RPC_BINDING_HANDLE Binding,
+ RPC_CSTR* StringBinding);
+WINPR_API RPC_STATUS RpcBindingToStringBindingW(RPC_BINDING_HANDLE Binding,
+ RPC_WSTR* StringBinding);
WINPR_API RPC_STATUS RpcBindingVectorFree(RPC_BINDING_VECTOR** BindingVector);
-WINPR_API RPC_STATUS RpcStringBindingComposeA(RPC_CSTR ObjUuid, RPC_CSTR Protseq, RPC_CSTR NetworkAddr,
- RPC_CSTR Endpoint, RPC_CSTR Options, RPC_CSTR* StringBinding);
-WINPR_API RPC_STATUS RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq, RPC_WSTR NetworkAddr,
- RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR* StringBinding);
-WINPR_API RPC_STATUS RpcStringBindingParseA(RPC_CSTR StringBinding, RPC_CSTR* ObjUuid, RPC_CSTR* Protseq,
- RPC_CSTR* NetworkAddr, RPC_CSTR *Endpoint, RPC_CSTR* NetworkOptions);
-WINPR_API RPC_STATUS RpcStringBindingParseW(RPC_WSTR StringBinding, RPC_WSTR* ObjUuid, RPC_WSTR* Protseq,
- RPC_WSTR* NetworkAddr, RPC_WSTR *Endpoint, RPC_WSTR* NetworkOptions);
+WINPR_API RPC_STATUS RpcStringBindingComposeA(RPC_CSTR ObjUuid,
+ RPC_CSTR Protseq, RPC_CSTR NetworkAddr,
+ RPC_CSTR Endpoint, RPC_CSTR Options, RPC_CSTR* StringBinding);
+WINPR_API RPC_STATUS RpcStringBindingComposeW(RPC_WSTR ObjUuid,
+ RPC_WSTR Protseq, RPC_WSTR NetworkAddr,
+ RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR* StringBinding);
+WINPR_API RPC_STATUS RpcStringBindingParseA(RPC_CSTR StringBinding,
+ RPC_CSTR* ObjUuid, RPC_CSTR* Protseq,
+ RPC_CSTR* NetworkAddr, RPC_CSTR* Endpoint, RPC_CSTR* NetworkOptions);
+WINPR_API RPC_STATUS RpcStringBindingParseW(RPC_WSTR StringBinding,
+ RPC_WSTR* ObjUuid, RPC_WSTR* Protseq,
+ RPC_WSTR* NetworkAddr, RPC_WSTR* Endpoint, RPC_WSTR* NetworkOptions);
WINPR_API RPC_STATUS RpcStringFreeA(RPC_CSTR* String);
WINPR_API RPC_STATUS RpcStringFreeW(RPC_WSTR* String);
WINPR_API RPC_STATUS RpcIfInqId(RPC_IF_HANDLE RpcIfHandle, RPC_IF_ID* RpcIfId);
WINPR_API RPC_STATUS RpcNetworkIsProtseqValidA(RPC_CSTR Protseq);
WINPR_API RPC_STATUS RpcNetworkIsProtseqValidW(RPC_WSTR Protseq);
-WINPR_API RPC_STATUS RpcMgmtInqComTimeout(RPC_BINDING_HANDLE Binding, unsigned int* Timeout);
-WINPR_API RPC_STATUS RpcMgmtSetComTimeout(RPC_BINDING_HANDLE Binding, unsigned int Timeout);
+WINPR_API RPC_STATUS RpcMgmtInqComTimeout(RPC_BINDING_HANDLE Binding,
+ unsigned int* Timeout);
+WINPR_API RPC_STATUS RpcMgmtSetComTimeout(RPC_BINDING_HANDLE Binding,
+ unsigned int Timeout);
WINPR_API RPC_STATUS RpcMgmtSetCancelTimeout(long Timeout);
-WINPR_API RPC_STATUS RpcNetworkInqProtseqsA(RPC_PROTSEQ_VECTORA** ProtseqVector);
-WINPR_API RPC_STATUS RpcNetworkInqProtseqsW(RPC_PROTSEQ_VECTORW** ProtseqVector);
+WINPR_API RPC_STATUS RpcNetworkInqProtseqsA(RPC_PROTSEQ_VECTORA**
+ ProtseqVector);
+WINPR_API RPC_STATUS RpcNetworkInqProtseqsW(RPC_PROTSEQ_VECTORW**
+ ProtseqVector);
WINPR_API RPC_STATUS RpcObjectInqType(UUID* ObjUuid, UUID* TypeUuid);
WINPR_API RPC_STATUS RpcObjectSetInqFn(RPC_OBJECT_INQ_FN* InquiryFn);
WINPR_API RPC_STATUS RpcObjectSetType(UUID* ObjUuid, UUID* TypeUuid);
WINPR_API RPC_STATUS RpcProtseqVectorFreeA(RPC_PROTSEQ_VECTORA** ProtseqVector);
WINPR_API RPC_STATUS RpcProtseqVectorFreeW(RPC_PROTSEQ_VECTORW** ProtseqVector);
-WINPR_API RPC_STATUS RpcServerInqBindings (RPC_BINDING_VECTOR** BindingVector);
-WINPR_API RPC_STATUS RpcServerInqIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV** MgrEpv);
-WINPR_API RPC_STATUS RpcServerListen(unsigned int MinimumCallThreads, unsigned int MaxCalls, unsigned int DontWait);
-WINPR_API RPC_STATUS RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv);
-WINPR_API RPC_STATUS RpcServerRegisterIfEx(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv,
- unsigned int Flags, unsigned int MaxCalls, RPC_IF_CALLBACK_FN* IfCallback);
-WINPR_API RPC_STATUS RpcServerRegisterIf2(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv,
- unsigned int Flags, unsigned int MaxCalls, unsigned int MaxRpcSize, RPC_IF_CALLBACK_FN* IfCallbackFn);
-WINPR_API RPC_STATUS RpcServerUnregisterIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, unsigned int WaitForCallsToComplete);
-WINPR_API RPC_STATUS RpcServerUnregisterIfEx(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, int RundownContextHandles);
-WINPR_API RPC_STATUS RpcServerUseAllProtseqs(unsigned int MaxCalls, void* SecurityDescriptor);
-WINPR_API RPC_STATUS RpcServerUseAllProtseqsEx(unsigned int MaxCalls, void* SecurityDescriptor, PRPC_POLICY Policy);
-WINPR_API RPC_STATUS RpcServerUseAllProtseqsIf(unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor);
-WINPR_API RPC_STATUS RpcServerUseAllProtseqsIfEx(unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor, PRPC_POLICY Policy);
-WINPR_API RPC_STATUS RpcServerUseProtseqA(RPC_CSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor);
-WINPR_API RPC_STATUS RpcServerUseProtseqExA(RPC_CSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor, PRPC_POLICY Policy);
-WINPR_API RPC_STATUS RpcServerUseProtseqW(RPC_WSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor);
-WINPR_API RPC_STATUS RpcServerUseProtseqExW(RPC_WSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor, PRPC_POLICY Policy);
-WINPR_API RPC_STATUS RpcServerUseProtseqEpA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_CSTR Endpoint, void* SecurityDescriptor);
-WINPR_API RPC_STATUS RpcServerUseProtseqEpExA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_CSTR Endpoint, void* SecurityDescriptor, PRPC_POLICY Policy);
-WINPR_API RPC_STATUS RpcServerUseProtseqEpW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_WSTR Endpoint, void* SecurityDescriptor);
-WINPR_API RPC_STATUS RpcServerUseProtseqEpExW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_WSTR Endpoint, void* SecurityDescriptor, PRPC_POLICY Policy);
-WINPR_API RPC_STATUS RpcServerUseProtseqIfA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor);
-WINPR_API RPC_STATUS RpcServerUseProtseqIfExA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor, PRPC_POLICY Policy);
-WINPR_API RPC_STATUS RpcServerUseProtseqIfW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor);
-WINPR_API RPC_STATUS RpcServerUseProtseqIfExW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor, PRPC_POLICY Policy);
+WINPR_API RPC_STATUS RpcServerInqBindings(RPC_BINDING_VECTOR** BindingVector);
+WINPR_API RPC_STATUS RpcServerInqIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid,
+ RPC_MGR_EPV** MgrEpv);
+WINPR_API RPC_STATUS RpcServerListen(unsigned int MinimumCallThreads,
+ unsigned int MaxCalls, unsigned int DontWait);
+WINPR_API RPC_STATUS RpcServerRegisterIf(RPC_IF_HANDLE IfSpec,
+ UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv);
+WINPR_API RPC_STATUS RpcServerRegisterIfEx(RPC_IF_HANDLE IfSpec,
+ UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv,
+ unsigned int Flags, unsigned int MaxCalls, RPC_IF_CALLBACK_FN* IfCallback);
+WINPR_API RPC_STATUS RpcServerRegisterIf2(RPC_IF_HANDLE IfSpec,
+ UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv,
+ unsigned int Flags, unsigned int MaxCalls, unsigned int MaxRpcSize,
+ RPC_IF_CALLBACK_FN* IfCallbackFn);
+WINPR_API RPC_STATUS RpcServerUnregisterIf(RPC_IF_HANDLE IfSpec,
+ UUID* MgrTypeUuid, unsigned int WaitForCallsToComplete);
+WINPR_API RPC_STATUS RpcServerUnregisterIfEx(RPC_IF_HANDLE IfSpec,
+ UUID* MgrTypeUuid, int RundownContextHandles);
+WINPR_API RPC_STATUS RpcServerUseAllProtseqs(unsigned int MaxCalls,
+ void* SecurityDescriptor);
+WINPR_API RPC_STATUS RpcServerUseAllProtseqsEx(unsigned int MaxCalls,
+ void* SecurityDescriptor, PRPC_POLICY Policy);
+WINPR_API RPC_STATUS RpcServerUseAllProtseqsIf(unsigned int MaxCalls,
+ RPC_IF_HANDLE IfSpec, void* SecurityDescriptor);
+WINPR_API RPC_STATUS RpcServerUseAllProtseqsIfEx(unsigned int MaxCalls,
+ RPC_IF_HANDLE IfSpec, void* SecurityDescriptor, PRPC_POLICY Policy);
+WINPR_API RPC_STATUS RpcServerUseProtseqA(RPC_CSTR Protseq,
+ unsigned int MaxCalls, void* SecurityDescriptor);
+WINPR_API RPC_STATUS RpcServerUseProtseqExA(RPC_CSTR Protseq,
+ unsigned int MaxCalls, void* SecurityDescriptor, PRPC_POLICY Policy);
+WINPR_API RPC_STATUS RpcServerUseProtseqW(RPC_WSTR Protseq,
+ unsigned int MaxCalls, void* SecurityDescriptor);
+WINPR_API RPC_STATUS RpcServerUseProtseqExW(RPC_WSTR Protseq,
+ unsigned int MaxCalls, void* SecurityDescriptor, PRPC_POLICY Policy);
+WINPR_API RPC_STATUS RpcServerUseProtseqEpA(RPC_CSTR Protseq,
+ unsigned int MaxCalls, RPC_CSTR Endpoint, void* SecurityDescriptor);
+WINPR_API RPC_STATUS RpcServerUseProtseqEpExA(RPC_CSTR Protseq,
+ unsigned int MaxCalls, RPC_CSTR Endpoint, void* SecurityDescriptor,
+ PRPC_POLICY Policy);
+WINPR_API RPC_STATUS RpcServerUseProtseqEpW(RPC_WSTR Protseq,
+ unsigned int MaxCalls, RPC_WSTR Endpoint, void* SecurityDescriptor);
+WINPR_API RPC_STATUS RpcServerUseProtseqEpExW(RPC_WSTR Protseq,
+ unsigned int MaxCalls, RPC_WSTR Endpoint, void* SecurityDescriptor,
+ PRPC_POLICY Policy);
+WINPR_API RPC_STATUS RpcServerUseProtseqIfA(RPC_CSTR Protseq,
+ unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor);
+WINPR_API RPC_STATUS RpcServerUseProtseqIfExA(RPC_CSTR Protseq,
+ unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor,
+ PRPC_POLICY Policy);
+WINPR_API RPC_STATUS RpcServerUseProtseqIfW(RPC_WSTR Protseq,
+ unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor);
+WINPR_API RPC_STATUS RpcServerUseProtseqIfExW(RPC_WSTR Protseq,
+ unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor,
+ PRPC_POLICY Policy);
WINPR_API void RpcServerYield(void);
WINPR_API RPC_STATUS RpcMgmtStatsVectorFree(RPC_STATS_VECTOR** StatsVector);
-WINPR_API RPC_STATUS RpcMgmtInqStats(RPC_BINDING_HANDLE Binding, RPC_STATS_VECTOR** Statistics);
+WINPR_API RPC_STATUS RpcMgmtInqStats(RPC_BINDING_HANDLE Binding,
+ RPC_STATS_VECTOR** Statistics);
WINPR_API RPC_STATUS RpcMgmtIsServerListening(RPC_BINDING_HANDLE Binding);
WINPR_API RPC_STATUS RpcMgmtStopServerListening(RPC_BINDING_HANDLE Binding);
WINPR_API RPC_STATUS RpcMgmtWaitServerListen(void);
WINPR_API RPC_STATUS RpcMgmtSetServerStackSize(unsigned long ThreadStackSize);
WINPR_API void RpcSsDontSerializeContext(void);
WINPR_API RPC_STATUS RpcMgmtEnableIdleCleanup(void);
-WINPR_API RPC_STATUS RpcMgmtInqIfIds(RPC_BINDING_HANDLE Binding, RPC_IF_ID_VECTOR** IfIdVector);
+WINPR_API RPC_STATUS RpcMgmtInqIfIds(RPC_BINDING_HANDLE Binding,
+ RPC_IF_ID_VECTOR** IfIdVector);
WINPR_API RPC_STATUS RpcIfIdVectorFree(RPC_IF_ID_VECTOR** IfIdVector);
-WINPR_API RPC_STATUS RpcMgmtInqServerPrincNameA(RPC_BINDING_HANDLE Binding, unsigned long AuthnSvc, RPC_CSTR* ServerPrincName);
-WINPR_API RPC_STATUS RpcMgmtInqServerPrincNameW(RPC_BINDING_HANDLE Binding, unsigned long AuthnSvc, RPC_WSTR* ServerPrincName);
-WINPR_API RPC_STATUS RpcServerInqDefaultPrincNameA(unsigned long AuthnSvc, RPC_CSTR* PrincName);
-WINPR_API RPC_STATUS RpcServerInqDefaultPrincNameW(unsigned long AuthnSvc, RPC_WSTR* PrincName);
-WINPR_API RPC_STATUS RpcEpResolveBinding(RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE IfSpec);
-WINPR_API RPC_STATUS RpcNsBindingInqEntryNameA(RPC_BINDING_HANDLE Binding, unsigned long EntryNameSyntax, RPC_CSTR* EntryName);
-WINPR_API RPC_STATUS RpcNsBindingInqEntryNameW(RPC_BINDING_HANDLE Binding, unsigned long EntryNameSyntax, RPC_WSTR* EntryName);
+WINPR_API RPC_STATUS RpcMgmtInqServerPrincNameA(RPC_BINDING_HANDLE Binding,
+ unsigned long AuthnSvc, RPC_CSTR* ServerPrincName);
+WINPR_API RPC_STATUS RpcMgmtInqServerPrincNameW(RPC_BINDING_HANDLE Binding,
+ unsigned long AuthnSvc, RPC_WSTR* ServerPrincName);
+WINPR_API RPC_STATUS RpcServerInqDefaultPrincNameA(unsigned long AuthnSvc,
+ RPC_CSTR* PrincName);
+WINPR_API RPC_STATUS RpcServerInqDefaultPrincNameW(unsigned long AuthnSvc,
+ RPC_WSTR* PrincName);
+WINPR_API RPC_STATUS RpcEpResolveBinding(RPC_BINDING_HANDLE Binding,
+ RPC_IF_HANDLE IfSpec);
+WINPR_API RPC_STATUS RpcNsBindingInqEntryNameA(RPC_BINDING_HANDLE Binding,
+ unsigned long EntryNameSyntax, RPC_CSTR* EntryName);
+WINPR_API RPC_STATUS RpcNsBindingInqEntryNameW(RPC_BINDING_HANDLE Binding,
+ unsigned long EntryNameSyntax, RPC_WSTR* EntryName);
WINPR_API RPC_STATUS RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle);
WINPR_API RPC_STATUS RpcRevertToSelfEx(RPC_BINDING_HANDLE BindingHandle);
WINPR_API RPC_STATUS RpcRevertToSelf(void);
-WINPR_API RPC_STATUS RpcBindingInqAuthClientA(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs,
- RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc, unsigned long* AuthzSvc);
-WINPR_API RPC_STATUS RpcBindingInqAuthClientW(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs,
- RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc, unsigned long* AuthzSvc);
-WINPR_API RPC_STATUS RpcBindingInqAuthClientExA(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs,
- RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc, unsigned long* AuthzSvc, unsigned long Flags);
-WINPR_API RPC_STATUS RpcBindingInqAuthClientExW(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs,
- RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc, unsigned long* AuthzSvc, unsigned long Flags);
-WINPR_API RPC_STATUS RpcBindingInqAuthInfoA(RPC_BINDING_HANDLE Binding, RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel,
- unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc);
-WINPR_API RPC_STATUS RpcBindingInqAuthInfoW(RPC_BINDING_HANDLE Binding, RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel,
- unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc);
-WINPR_API RPC_STATUS RpcBindingSetAuthInfoA(RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, unsigned long AuthnLevel,
- unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc);
-WINPR_API RPC_STATUS RpcBindingSetAuthInfoExA(RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, unsigned long AuthnLevel,
- unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc, RPC_SECURITY_QOS* SecurityQos);
-WINPR_API RPC_STATUS RpcBindingSetAuthInfoW(RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName, unsigned long AuthnLevel,
- unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc);
-WINPR_API RPC_STATUS RpcBindingSetAuthInfoExW(RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName, unsigned long AuthnLevel,
- unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc, RPC_SECURITY_QOS* SecurityQOS);
-WINPR_API RPC_STATUS RpcBindingInqAuthInfoExA(RPC_BINDING_HANDLE Binding, RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel,
- unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc,
- unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS);
-WINPR_API RPC_STATUS RpcBindingInqAuthInfoExW(RPC_BINDING_HANDLE Binding, RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel,
- unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc,
- unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS);
-
-WINPR_API RPC_STATUS RpcServerRegisterAuthInfoA(RPC_CSTR ServerPrincName, unsigned long AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg);
-WINPR_API RPC_STATUS RpcServerRegisterAuthInfoW(RPC_WSTR ServerPrincName, unsigned long AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg);
-
-WINPR_API RPC_STATUS RpcBindingServerFromClient(RPC_BINDING_HANDLE ClientBinding, RPC_BINDING_HANDLE* ServerBinding);
+WINPR_API RPC_STATUS RpcBindingInqAuthClientA(RPC_BINDING_HANDLE ClientBinding,
+ RPC_AUTHZ_HANDLE* Privs,
+ RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc,
+ unsigned long* AuthzSvc);
+WINPR_API RPC_STATUS RpcBindingInqAuthClientW(RPC_BINDING_HANDLE ClientBinding,
+ RPC_AUTHZ_HANDLE* Privs,
+ RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc,
+ unsigned long* AuthzSvc);
+WINPR_API RPC_STATUS RpcBindingInqAuthClientExA(RPC_BINDING_HANDLE
+ ClientBinding, RPC_AUTHZ_HANDLE* Privs,
+ RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc,
+ unsigned long* AuthzSvc, unsigned long Flags);
+WINPR_API RPC_STATUS RpcBindingInqAuthClientExW(RPC_BINDING_HANDLE
+ ClientBinding, RPC_AUTHZ_HANDLE* Privs,
+ RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc,
+ unsigned long* AuthzSvc, unsigned long Flags);
+WINPR_API RPC_STATUS RpcBindingInqAuthInfoA(RPC_BINDING_HANDLE Binding,
+ RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel,
+ unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity,
+ unsigned long* AuthzSvc);
+WINPR_API RPC_STATUS RpcBindingInqAuthInfoW(RPC_BINDING_HANDLE Binding,
+ RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel,
+ unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity,
+ unsigned long* AuthzSvc);
+WINPR_API RPC_STATUS RpcBindingSetAuthInfoA(RPC_BINDING_HANDLE Binding,
+ RPC_CSTR ServerPrincName, unsigned long AuthnLevel,
+ unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
+ unsigned long AuthzSvc);
+WINPR_API RPC_STATUS RpcBindingSetAuthInfoExA(RPC_BINDING_HANDLE Binding,
+ RPC_CSTR ServerPrincName, unsigned long AuthnLevel,
+ unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
+ unsigned long AuthzSvc, RPC_SECURITY_QOS* SecurityQos);
+WINPR_API RPC_STATUS RpcBindingSetAuthInfoW(RPC_BINDING_HANDLE Binding,
+ RPC_WSTR ServerPrincName, unsigned long AuthnLevel,
+ unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
+ unsigned long AuthzSvc);
+WINPR_API RPC_STATUS RpcBindingSetAuthInfoExW(RPC_BINDING_HANDLE Binding,
+ RPC_WSTR ServerPrincName, unsigned long AuthnLevel,
+ unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
+ unsigned long AuthzSvc, RPC_SECURITY_QOS* SecurityQOS);
+WINPR_API RPC_STATUS RpcBindingInqAuthInfoExA(RPC_BINDING_HANDLE Binding,
+ RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel,
+ unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity,
+ unsigned long* AuthzSvc,
+ unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS);
+WINPR_API RPC_STATUS RpcBindingInqAuthInfoExW(RPC_BINDING_HANDLE Binding,
+ RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel,
+ unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity,
+ unsigned long* AuthzSvc,
+ unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS);
+
+WINPR_API RPC_STATUS RpcServerRegisterAuthInfoA(RPC_CSTR ServerPrincName,
+ unsigned long AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg);
+WINPR_API RPC_STATUS RpcServerRegisterAuthInfoW(RPC_WSTR ServerPrincName,
+ unsigned long AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg);
+
+WINPR_API RPC_STATUS RpcBindingServerFromClient(RPC_BINDING_HANDLE
+ ClientBinding, RPC_BINDING_HANDLE* ServerBinding);
WINPR_API DECLSPEC_NORETURN void RpcRaiseException(RPC_STATUS exception);
WINPR_API RPC_STATUS RpcTestCancel(void);
WINPR_API RPC_STATUS RpcServerTestCancel(RPC_BINDING_HANDLE BindingHandle);
WINPR_API RPC_STATUS UuidCreate(UUID* Uuid);
WINPR_API RPC_STATUS UuidCreateSequential(UUID* Uuid);
-WINPR_API RPC_STATUS UuidToStringA(UUID* Uuid, RPC_CSTR* StringUuid);
+WINPR_API RPC_STATUS UuidToStringA(const UUID* Uuid, RPC_CSTR* StringUuid);
WINPR_API RPC_STATUS UuidFromStringA(RPC_CSTR StringUuid, UUID* Uuid);
-WINPR_API RPC_STATUS UuidToStringW(UUID* Uuid, RPC_WSTR* StringUuid);
+WINPR_API RPC_STATUS UuidToStringW(const UUID* Uuid, RPC_WSTR* StringUuid);
WINPR_API RPC_STATUS UuidFromStringW(RPC_WSTR StringUuid, UUID* Uuid);
-WINPR_API signed int UuidCompare(UUID* Uuid1, UUID* Uuid2, RPC_STATUS* Status);
+WINPR_API signed int UuidCompare(const UUID* Uuid1, const UUID* Uuid2,
+ RPC_STATUS* Status);
WINPR_API RPC_STATUS UuidCreateNil(UUID* NilUuid);
-WINPR_API int UuidEqual(UUID* Uuid1, UUID* Uuid2, RPC_STATUS* Status);
-WINPR_API unsigned short UuidHash(UUID* Uuid, RPC_STATUS* Status);
-WINPR_API int UuidIsNil(UUID* Uuid, RPC_STATUS* Status);
-
-WINPR_API RPC_STATUS RpcEpRegisterNoReplaceA(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, RPC_CSTR Annotation);
-WINPR_API RPC_STATUS RpcEpRegisterNoReplaceW(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, RPC_WSTR Annotation);
-WINPR_API RPC_STATUS RpcEpRegisterA(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, RPC_CSTR Annotation);
-WINPR_API RPC_STATUS RpcEpRegisterW(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, RPC_WSTR Annotation);
-WINPR_API RPC_STATUS RpcEpUnregister(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector);
+WINPR_API int UuidEqual(const UUID* Uuid1, const UUID* Uuid2,
+ RPC_STATUS* Status);
+WINPR_API unsigned short UuidHash(const UUID* Uuid, RPC_STATUS* Status);
+WINPR_API int UuidIsNil(const UUID* Uuid, RPC_STATUS* Status);
+
+WINPR_API RPC_STATUS RpcEpRegisterNoReplaceA(RPC_IF_HANDLE IfSpec,
+ RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector,
+ RPC_CSTR Annotation);
+WINPR_API RPC_STATUS RpcEpRegisterNoReplaceW(RPC_IF_HANDLE IfSpec,
+ RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector,
+ RPC_WSTR Annotation);
+WINPR_API RPC_STATUS RpcEpRegisterA(RPC_IF_HANDLE IfSpec,
+ RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector,
+ RPC_CSTR Annotation);
+WINPR_API RPC_STATUS RpcEpRegisterW(RPC_IF_HANDLE IfSpec,
+ RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector,
+ RPC_WSTR Annotation);
+WINPR_API RPC_STATUS RpcEpUnregister(RPC_IF_HANDLE IfSpec,
+ RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector);
WINPR_API RPC_STATUS DceErrorInqTextA(RPC_STATUS RpcStatus, RPC_CSTR ErrorText);
WINPR_API RPC_STATUS DceErrorInqTextW(RPC_STATUS RpcStatus, RPC_WSTR ErrorText);
-WINPR_API RPC_STATUS RpcMgmtEpEltInqBegin(RPC_BINDING_HANDLE EpBinding, unsigned long InquiryType, RPC_IF_ID* IfId,
- unsigned long VersOption, UUID* ObjectUuid, RPC_EP_INQ_HANDLE* InquiryContext);
+WINPR_API RPC_STATUS RpcMgmtEpEltInqBegin(RPC_BINDING_HANDLE EpBinding,
+ unsigned long InquiryType, RPC_IF_ID* IfId,
+ unsigned long VersOption, UUID* ObjectUuid, RPC_EP_INQ_HANDLE* InquiryContext);
WINPR_API RPC_STATUS RpcMgmtEpEltInqDone(RPC_EP_INQ_HANDLE* InquiryContext);
-WINPR_API RPC_STATUS RpcMgmtEpEltInqNextA(RPC_EP_INQ_HANDLE InquiryContext, RPC_IF_ID* IfId,
- RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid, RPC_CSTR* Annotation);
-WINPR_API RPC_STATUS RpcMgmtEpEltInqNextW(RPC_EP_INQ_HANDLE InquiryContext, RPC_IF_ID* IfId,
- RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid, RPC_WSTR* Annotation);
-WINPR_API RPC_STATUS RpcMgmtEpUnregister(RPC_BINDING_HANDLE EpBinding, RPC_IF_ID* IfId,
- RPC_BINDING_HANDLE Binding, UUID* ObjectUuid);
-WINPR_API RPC_STATUS RpcMgmtSetAuthorizationFn(RPC_MGMT_AUTHORIZATION_FN AuthorizationFn);
+WINPR_API RPC_STATUS RpcMgmtEpEltInqNextA(RPC_EP_INQ_HANDLE InquiryContext,
+ RPC_IF_ID* IfId,
+ RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid, RPC_CSTR* Annotation);
+WINPR_API RPC_STATUS RpcMgmtEpEltInqNextW(RPC_EP_INQ_HANDLE InquiryContext,
+ RPC_IF_ID* IfId,
+ RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid, RPC_WSTR* Annotation);
+WINPR_API RPC_STATUS RpcMgmtEpUnregister(RPC_BINDING_HANDLE EpBinding,
+ RPC_IF_ID* IfId,
+ RPC_BINDING_HANDLE Binding, UUID* ObjectUuid);
+WINPR_API RPC_STATUS RpcMgmtSetAuthorizationFn(RPC_MGMT_AUTHORIZATION_FN
+ AuthorizationFn);
WINPR_API RPC_STATUS RpcServerInqBindingHandle(RPC_BINDING_HANDLE* Binding);
#include "../log.h"
#define TAG WINPR_TAG("rpc")
-RPC_STATUS RpcBindingCopy(RPC_BINDING_HANDLE SourceBinding, RPC_BINDING_HANDLE* DestinationBinding)
+RPC_STATUS RpcBindingCopy(RPC_BINDING_HANDLE SourceBinding,
+ RPC_BINDING_HANDLE* DestinationBinding)
{
WLog_ERR(TAG, "Not implemented");
return 0;
return 0;
}
-RPC_STATUS RpcBindingSetOption(RPC_BINDING_HANDLE hBinding, unsigned long option, ULONG_PTR optionValue)
+RPC_STATUS RpcBindingSetOption(RPC_BINDING_HANDLE hBinding,
+ unsigned long option, ULONG_PTR optionValue)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcBindingInqOption(RPC_BINDING_HANDLE hBinding, unsigned long option, ULONG_PTR* pOptionValue)
+RPC_STATUS RpcBindingInqOption(RPC_BINDING_HANDLE hBinding,
+ unsigned long option, ULONG_PTR* pOptionValue)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcBindingFromStringBindingA(RPC_CSTR StringBinding, RPC_BINDING_HANDLE* Binding)
+RPC_STATUS RpcBindingFromStringBindingA(RPC_CSTR StringBinding,
+ RPC_BINDING_HANDLE* Binding)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE* Binding)
+RPC_STATUS RpcBindingFromStringBindingW(RPC_WSTR StringBinding,
+ RPC_BINDING_HANDLE* Binding)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcSsGetContextBinding(void* ContextHandle, RPC_BINDING_HANDLE* Binding)
+RPC_STATUS RpcSsGetContextBinding(void* ContextHandle,
+ RPC_BINDING_HANDLE* Binding)
{
WLog_ERR(TAG, "Not implemented");
return 0;
return 0;
}
-RPC_STATUS RpcMgmtInqDefaultProtectLevel(unsigned long AuthnSvc, unsigned long* AuthnLevel)
+RPC_STATUS RpcMgmtInqDefaultProtectLevel(unsigned long AuthnSvc,
+ unsigned long* AuthnLevel)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcBindingToStringBindingA(RPC_BINDING_HANDLE Binding, RPC_CSTR* StringBinding)
+RPC_STATUS RpcBindingToStringBindingA(RPC_BINDING_HANDLE Binding,
+ RPC_CSTR* StringBinding)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcBindingToStringBindingW(RPC_BINDING_HANDLE Binding, RPC_WSTR* StringBinding)
+RPC_STATUS RpcBindingToStringBindingW(RPC_BINDING_HANDLE Binding,
+ RPC_WSTR* StringBinding)
{
WLog_ERR(TAG, "Not implemented");
return 0;
return 0;
}
-RPC_STATUS RpcStringBindingComposeA(RPC_CSTR ObjUuid, RPC_CSTR Protseq, RPC_CSTR NetworkAddr,
- RPC_CSTR Endpoint, RPC_CSTR Options, RPC_CSTR* StringBinding)
+RPC_STATUS RpcStringBindingComposeA(RPC_CSTR ObjUuid, RPC_CSTR Protseq,
+ RPC_CSTR NetworkAddr,
+ RPC_CSTR Endpoint, RPC_CSTR Options, RPC_CSTR* StringBinding)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq, RPC_WSTR NetworkAddr,
- RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR* StringBinding)
+RPC_STATUS RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq,
+ RPC_WSTR NetworkAddr,
+ RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR* StringBinding)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcStringBindingParseA(RPC_CSTR StringBinding, RPC_CSTR* ObjUuid, RPC_CSTR* Protseq,
- RPC_CSTR* NetworkAddr, RPC_CSTR* Endpoint, RPC_CSTR* NetworkOptions)
+RPC_STATUS RpcStringBindingParseA(RPC_CSTR StringBinding, RPC_CSTR* ObjUuid,
+ RPC_CSTR* Protseq,
+ RPC_CSTR* NetworkAddr, RPC_CSTR* Endpoint, RPC_CSTR* NetworkOptions)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcStringBindingParseW(RPC_WSTR StringBinding, RPC_WSTR* ObjUuid, RPC_WSTR* Protseq,
- RPC_WSTR* NetworkAddr, RPC_WSTR* Endpoint, RPC_WSTR* NetworkOptions)
+RPC_STATUS RpcStringBindingParseW(RPC_WSTR StringBinding, RPC_WSTR* ObjUuid,
+ RPC_WSTR* Protseq,
+ RPC_WSTR* NetworkAddr, RPC_WSTR* Endpoint, RPC_WSTR* NetworkOptions)
{
WLog_ERR(TAG, "Not implemented");
return 0;
return 0;
}
-RPC_STATUS RpcMgmtInqComTimeout(RPC_BINDING_HANDLE Binding, unsigned int* Timeout)
+RPC_STATUS RpcMgmtInqComTimeout(RPC_BINDING_HANDLE Binding,
+ unsigned int* Timeout)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcMgmtSetComTimeout(RPC_BINDING_HANDLE Binding, unsigned int Timeout)
+RPC_STATUS RpcMgmtSetComTimeout(RPC_BINDING_HANDLE Binding,
+ unsigned int Timeout)
{
WLog_ERR(TAG, "Not implemented");
return 0;
return 0;
}
-RPC_STATUS RpcServerInqIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV** MgrEpv)
+RPC_STATUS RpcServerInqIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid,
+ RPC_MGR_EPV** MgrEpv)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerListen(unsigned int MinimumCallThreads, unsigned int MaxCalls, unsigned int DontWait)
+RPC_STATUS RpcServerListen(unsigned int MinimumCallThreads,
+ unsigned int MaxCalls, unsigned int DontWait)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv)
+RPC_STATUS RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid,
+ RPC_MGR_EPV* MgrEpv)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerRegisterIfEx(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv,
- unsigned int Flags, unsigned int MaxCalls, RPC_IF_CALLBACK_FN* IfCallback)
+RPC_STATUS RpcServerRegisterIfEx(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid,
+ RPC_MGR_EPV* MgrEpv,
+ unsigned int Flags, unsigned int MaxCalls, RPC_IF_CALLBACK_FN* IfCallback)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerRegisterIf2(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv,
- unsigned int Flags, unsigned int MaxCalls, unsigned int MaxRpcSize, RPC_IF_CALLBACK_FN* IfCallbackFn)
+RPC_STATUS RpcServerRegisterIf2(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid,
+ RPC_MGR_EPV* MgrEpv,
+ unsigned int Flags, unsigned int MaxCalls, unsigned int MaxRpcSize,
+ RPC_IF_CALLBACK_FN* IfCallbackFn)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerUnregisterIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, unsigned int WaitForCallsToComplete)
+RPC_STATUS RpcServerUnregisterIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid,
+ unsigned int WaitForCallsToComplete)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerUnregisterIfEx(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, int RundownContextHandles)
+RPC_STATUS RpcServerUnregisterIfEx(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid,
+ int RundownContextHandles)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerUseAllProtseqs(unsigned int MaxCalls, void* SecurityDescriptor)
+RPC_STATUS RpcServerUseAllProtseqs(unsigned int MaxCalls,
+ void* SecurityDescriptor)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerUseAllProtseqsEx(unsigned int MaxCalls, void* SecurityDescriptor, PRPC_POLICY Policy)
+RPC_STATUS RpcServerUseAllProtseqsEx(unsigned int MaxCalls,
+ void* SecurityDescriptor, PRPC_POLICY Policy)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerUseAllProtseqsIf(unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor)
+RPC_STATUS RpcServerUseAllProtseqsIf(unsigned int MaxCalls,
+ RPC_IF_HANDLE IfSpec, void* SecurityDescriptor)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerUseAllProtseqsIfEx(unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor, PRPC_POLICY Policy)
+RPC_STATUS RpcServerUseAllProtseqsIfEx(unsigned int MaxCalls,
+ RPC_IF_HANDLE IfSpec, void* SecurityDescriptor, PRPC_POLICY Policy)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerUseProtseqA(RPC_CSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor)
+RPC_STATUS RpcServerUseProtseqA(RPC_CSTR Protseq, unsigned int MaxCalls,
+ void* SecurityDescriptor)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerUseProtseqExA(RPC_CSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor, PRPC_POLICY Policy)
+RPC_STATUS RpcServerUseProtseqExA(RPC_CSTR Protseq, unsigned int MaxCalls,
+ void* SecurityDescriptor, PRPC_POLICY Policy)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerUseProtseqW(RPC_WSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor)
+RPC_STATUS RpcServerUseProtseqW(RPC_WSTR Protseq, unsigned int MaxCalls,
+ void* SecurityDescriptor)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerUseProtseqExW(RPC_WSTR Protseq, unsigned int MaxCalls, void* SecurityDescriptor, PRPC_POLICY Policy)
+RPC_STATUS RpcServerUseProtseqExW(RPC_WSTR Protseq, unsigned int MaxCalls,
+ void* SecurityDescriptor, PRPC_POLICY Policy)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerUseProtseqEpA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_CSTR Endpoint, void* SecurityDescriptor)
+RPC_STATUS RpcServerUseProtseqEpA(RPC_CSTR Protseq, unsigned int MaxCalls,
+ RPC_CSTR Endpoint, void* SecurityDescriptor)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerUseProtseqEpExA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_CSTR Endpoint, void* SecurityDescriptor, PRPC_POLICY Policy)
+RPC_STATUS RpcServerUseProtseqEpExA(RPC_CSTR Protseq, unsigned int MaxCalls,
+ RPC_CSTR Endpoint, void* SecurityDescriptor, PRPC_POLICY Policy)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerUseProtseqEpW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_WSTR Endpoint, void* SecurityDescriptor)
+RPC_STATUS RpcServerUseProtseqEpW(RPC_WSTR Protseq, unsigned int MaxCalls,
+ RPC_WSTR Endpoint, void* SecurityDescriptor)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerUseProtseqEpExW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_WSTR Endpoint, void* SecurityDescriptor, PRPC_POLICY Policy)
+RPC_STATUS RpcServerUseProtseqEpExW(RPC_WSTR Protseq, unsigned int MaxCalls,
+ RPC_WSTR Endpoint, void* SecurityDescriptor, PRPC_POLICY Policy)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerUseProtseqIfA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor)
+RPC_STATUS RpcServerUseProtseqIfA(RPC_CSTR Protseq, unsigned int MaxCalls,
+ RPC_IF_HANDLE IfSpec, void* SecurityDescriptor)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerUseProtseqIfExA(RPC_CSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor, PRPC_POLICY Policy)
+RPC_STATUS RpcServerUseProtseqIfExA(RPC_CSTR Protseq, unsigned int MaxCalls,
+ RPC_IF_HANDLE IfSpec, void* SecurityDescriptor, PRPC_POLICY Policy)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerUseProtseqIfW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor)
+RPC_STATUS RpcServerUseProtseqIfW(RPC_WSTR Protseq, unsigned int MaxCalls,
+ RPC_IF_HANDLE IfSpec, void* SecurityDescriptor)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerUseProtseqIfExW(RPC_WSTR Protseq, unsigned int MaxCalls, RPC_IF_HANDLE IfSpec, void* SecurityDescriptor, PRPC_POLICY Policy)
+RPC_STATUS RpcServerUseProtseqIfExW(RPC_WSTR Protseq, unsigned int MaxCalls,
+ RPC_IF_HANDLE IfSpec, void* SecurityDescriptor, PRPC_POLICY Policy)
{
WLog_ERR(TAG, "Not implemented");
return 0;
return 0;
}
-RPC_STATUS RpcMgmtInqStats(RPC_BINDING_HANDLE Binding, RPC_STATS_VECTOR** Statistics)
+RPC_STATUS RpcMgmtInqStats(RPC_BINDING_HANDLE Binding,
+ RPC_STATS_VECTOR** Statistics)
{
WLog_ERR(TAG, "Not implemented");
return 0;
return 0;
}
-RPC_STATUS RpcMgmtInqIfIds(RPC_BINDING_HANDLE Binding, RPC_IF_ID_VECTOR** IfIdVector)
+RPC_STATUS RpcMgmtInqIfIds(RPC_BINDING_HANDLE Binding,
+ RPC_IF_ID_VECTOR** IfIdVector)
{
WLog_ERR(TAG, "Not implemented");
return 0;
return 0;
}
-RPC_STATUS RpcMgmtInqServerPrincNameA(RPC_BINDING_HANDLE Binding, unsigned long AuthnSvc, RPC_CSTR* ServerPrincName)
+RPC_STATUS RpcMgmtInqServerPrincNameA(RPC_BINDING_HANDLE Binding,
+ unsigned long AuthnSvc, RPC_CSTR* ServerPrincName)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcMgmtInqServerPrincNameW(RPC_BINDING_HANDLE Binding, unsigned long AuthnSvc, RPC_WSTR* ServerPrincName)
+RPC_STATUS RpcMgmtInqServerPrincNameW(RPC_BINDING_HANDLE Binding,
+ unsigned long AuthnSvc, RPC_WSTR* ServerPrincName)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerInqDefaultPrincNameA(unsigned long AuthnSvc, RPC_CSTR* PrincName)
+RPC_STATUS RpcServerInqDefaultPrincNameA(unsigned long AuthnSvc,
+ RPC_CSTR* PrincName)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerInqDefaultPrincNameW(unsigned long AuthnSvc, RPC_WSTR* PrincName)
+RPC_STATUS RpcServerInqDefaultPrincNameW(unsigned long AuthnSvc,
+ RPC_WSTR* PrincName)
{
WLog_ERR(TAG, "Not implemented");
return 0;
return 0;
}
-RPC_STATUS RpcNsBindingInqEntryNameA(RPC_BINDING_HANDLE Binding, unsigned long EntryNameSyntax, RPC_CSTR* EntryName)
+RPC_STATUS RpcNsBindingInqEntryNameA(RPC_BINDING_HANDLE Binding,
+ unsigned long EntryNameSyntax, RPC_CSTR* EntryName)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcNsBindingInqEntryNameW(RPC_BINDING_HANDLE Binding, unsigned long EntryNameSyntax, RPC_WSTR* EntryName)
+RPC_STATUS RpcNsBindingInqEntryNameW(RPC_BINDING_HANDLE Binding,
+ unsigned long EntryNameSyntax, RPC_WSTR* EntryName)
{
WLog_ERR(TAG, "Not implemented");
return 0;
return 0;
}
-RPC_STATUS RpcBindingInqAuthClientA(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs,
- RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc, unsigned long* AuthzSvc)
+RPC_STATUS RpcBindingInqAuthClientA(RPC_BINDING_HANDLE ClientBinding,
+ RPC_AUTHZ_HANDLE* Privs,
+ RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc,
+ unsigned long* AuthzSvc)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcBindingInqAuthClientW(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs,
- RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc, unsigned long* AuthzSvc)
+RPC_STATUS RpcBindingInqAuthClientW(RPC_BINDING_HANDLE ClientBinding,
+ RPC_AUTHZ_HANDLE* Privs,
+ RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc,
+ unsigned long* AuthzSvc)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcBindingInqAuthClientExA(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs,
- RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc, unsigned long* AuthzSvc, unsigned long Flags)
+RPC_STATUS RpcBindingInqAuthClientExA(RPC_BINDING_HANDLE ClientBinding,
+ RPC_AUTHZ_HANDLE* Privs,
+ RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc,
+ unsigned long* AuthzSvc, unsigned long Flags)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcBindingInqAuthClientExW(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE* Privs,
- RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc, unsigned long* AuthzSvc, unsigned long Flags)
+RPC_STATUS RpcBindingInqAuthClientExW(RPC_BINDING_HANDLE ClientBinding,
+ RPC_AUTHZ_HANDLE* Privs,
+ RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel, unsigned long* AuthnSvc,
+ unsigned long* AuthzSvc, unsigned long Flags)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcBindingInqAuthInfoA(RPC_BINDING_HANDLE Binding, RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel,
- unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc)
+RPC_STATUS RpcBindingInqAuthInfoA(RPC_BINDING_HANDLE Binding,
+ RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel,
+ unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity,
+ unsigned long* AuthzSvc)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcBindingInqAuthInfoW(RPC_BINDING_HANDLE Binding, RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel,
- unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc)
+RPC_STATUS RpcBindingInqAuthInfoW(RPC_BINDING_HANDLE Binding,
+ RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel,
+ unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity,
+ unsigned long* AuthzSvc)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcBindingSetAuthInfoA(RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, unsigned long AuthnLevel,
- unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc)
+RPC_STATUS RpcBindingSetAuthInfoA(RPC_BINDING_HANDLE Binding,
+ RPC_CSTR ServerPrincName, unsigned long AuthnLevel,
+ unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
+ unsigned long AuthzSvc)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcBindingSetAuthInfoExA(RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, unsigned long AuthnLevel,
- unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc, RPC_SECURITY_QOS* SecurityQos)
+RPC_STATUS RpcBindingSetAuthInfoExA(RPC_BINDING_HANDLE Binding,
+ RPC_CSTR ServerPrincName, unsigned long AuthnLevel,
+ unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
+ unsigned long AuthzSvc, RPC_SECURITY_QOS* SecurityQos)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcBindingSetAuthInfoW(RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName, unsigned long AuthnLevel,
- unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc)
+RPC_STATUS RpcBindingSetAuthInfoW(RPC_BINDING_HANDLE Binding,
+ RPC_WSTR ServerPrincName, unsigned long AuthnLevel,
+ unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
+ unsigned long AuthzSvc)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcBindingSetAuthInfoExW(RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName, unsigned long AuthnLevel,
- unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvc, RPC_SECURITY_QOS* SecurityQOS)
+RPC_STATUS RpcBindingSetAuthInfoExW(RPC_BINDING_HANDLE Binding,
+ RPC_WSTR ServerPrincName, unsigned long AuthnLevel,
+ unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
+ unsigned long AuthzSvc, RPC_SECURITY_QOS* SecurityQOS)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcBindingInqAuthInfoExA(RPC_BINDING_HANDLE Binding, RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel,
- unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc,
- unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS)
+RPC_STATUS RpcBindingInqAuthInfoExA(RPC_BINDING_HANDLE Binding,
+ RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel,
+ unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity,
+ unsigned long* AuthzSvc,
+ unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcBindingInqAuthInfoExW(RPC_BINDING_HANDLE Binding, RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel,
- unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc,
- unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS)
+RPC_STATUS RpcBindingInqAuthInfoExW(RPC_BINDING_HANDLE Binding,
+ RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel,
+ unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity,
+ unsigned long* AuthzSvc,
+ unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerRegisterAuthInfoA(RPC_CSTR ServerPrincName, unsigned long AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg)
+RPC_STATUS RpcServerRegisterAuthInfoA(RPC_CSTR ServerPrincName,
+ unsigned long AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcServerRegisterAuthInfoW(RPC_WSTR ServerPrincName, unsigned long AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg)
+RPC_STATUS RpcServerRegisterAuthInfoW(RPC_WSTR ServerPrincName,
+ unsigned long AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcBindingServerFromClient(RPC_BINDING_HANDLE ClientBinding, RPC_BINDING_HANDLE* ServerBinding)
+RPC_STATUS RpcBindingServerFromClient(RPC_BINDING_HANDLE ClientBinding,
+ RPC_BINDING_HANDLE* ServerBinding)
{
WLog_ERR(TAG, "Not implemented");
return 0;
return RPC_S_OK;
}
-RPC_STATUS UuidToStringA(UUID* Uuid, RPC_CSTR* StringUuid)
+RPC_STATUS UuidToStringA(const UUID* Uuid, RPC_CSTR* StringUuid)
{
*StringUuid = (RPC_CSTR) malloc(36 + 1);
* Format is 32 hex digits partitioned in 5 groups:
* xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
*/
- sprintf_s((char*) *StringUuid, 36 + 1, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
- Uuid->Data1, Uuid->Data2, Uuid->Data3,
- Uuid->Data4[0], Uuid->Data4[1],
- Uuid->Data4[2], Uuid->Data4[3], Uuid->Data4[4],
- Uuid->Data4[5], Uuid->Data4[6], Uuid->Data4[7]);
+ sprintf_s((char*) *StringUuid, 36 + 1,
+ "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+ Uuid->Data1, Uuid->Data2, Uuid->Data3,
+ Uuid->Data4[0], Uuid->Data4[1],
+ Uuid->Data4[2], Uuid->Data4[3], Uuid->Data4[4],
+ Uuid->Data4[5], Uuid->Data4[6], Uuid->Data4[7]);
return RPC_S_OK;
}
-RPC_STATUS UuidToStringW(UUID* Uuid, RPC_WSTR* StringUuid)
+RPC_STATUS UuidToStringW(const UUID* Uuid, RPC_WSTR* StringUuid)
{
WLog_ERR(TAG, "Not implemented");
return 0;
return RPC_S_INVALID_STRING_UUID;
if ((StringUuid[8] != '-') || (StringUuid[13] != '-') ||
- (StringUuid[18] != '-') || (StringUuid[23] != '-'))
+ (StringUuid[18] != '-') || (StringUuid[23] != '-'))
{
return RPC_S_INVALID_STRING_UUID;
}
return RPC_S_INVALID_STRING_UUID;
}
- Uuid->Data1 = ((bin[0] << 28) | (bin[1] << 24) | (bin[2] << 20) | (bin[3] << 16) |
- (bin[4] << 12) | (bin[5] << 8) | (bin[6] << 4) | bin[7]);
+ Uuid->Data1 = ((bin[0] << 28) | (bin[1] << 24) | (bin[2] << 20) |
+ (bin[3] << 16) |
+ (bin[4] << 12) | (bin[5] << 8) | (bin[6] << 4) | bin[7]);
Uuid->Data2 = ((bin[9] << 12) | (bin[10] << 8) | (bin[11] << 4) | bin[12]);
Uuid->Data3 = ((bin[14] << 12) | (bin[15] << 8) | (bin[16] << 4) | bin[17]);
Uuid->Data4[0] = ((bin[19] << 4) | bin[20]);
return 0;
}
-signed int UuidCompare(UUID* Uuid1, UUID* Uuid2, RPC_STATUS* Status)
+signed int UuidCompare(const UUID* Uuid1, const UUID* Uuid2, RPC_STATUS* Status)
{
int index;
*Status = RPC_S_OK;
return RPC_S_OK;
}
-int UuidEqual(UUID* Uuid1, UUID* Uuid2, RPC_STATUS* Status)
+int UuidEqual(const UUID* Uuid1, const UUID* Uuid2, RPC_STATUS* Status)
{
return ((UuidCompare(Uuid1, Uuid2, Status) == 0) ? TRUE : FALSE);
}
-unsigned short UuidHash(UUID* Uuid, RPC_STATUS* Status)
+unsigned short UuidHash(const UUID* Uuid, RPC_STATUS* Status)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-int UuidIsNil(UUID* Uuid, RPC_STATUS* Status)
+int UuidIsNil(const UUID* Uuid, RPC_STATUS* Status)
{
return UuidEqual(Uuid, &UUID_NIL, Status);
}
-RPC_STATUS RpcEpRegisterNoReplaceA(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, RPC_CSTR Annotation)
+RPC_STATUS RpcEpRegisterNoReplaceA(RPC_IF_HANDLE IfSpec,
+ RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, RPC_CSTR Annotation)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcEpRegisterNoReplaceW(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, RPC_WSTR Annotation)
+RPC_STATUS RpcEpRegisterNoReplaceW(RPC_IF_HANDLE IfSpec,
+ RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, RPC_WSTR Annotation)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcEpRegisterA(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, RPC_CSTR Annotation)
+RPC_STATUS RpcEpRegisterA(RPC_IF_HANDLE IfSpec,
+ RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, RPC_CSTR Annotation)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcEpRegisterW(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, RPC_WSTR Annotation)
+RPC_STATUS RpcEpRegisterW(RPC_IF_HANDLE IfSpec,
+ RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector, RPC_WSTR Annotation)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcEpUnregister(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector)
+RPC_STATUS RpcEpUnregister(RPC_IF_HANDLE IfSpec,
+ RPC_BINDING_VECTOR* BindingVector, UUID_VECTOR* UuidVector)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcMgmtEpEltInqBegin(RPC_BINDING_HANDLE EpBinding, unsigned long InquiryType, RPC_IF_ID* IfId,
- unsigned long VersOption, UUID* ObjectUuid, RPC_EP_INQ_HANDLE* InquiryContext)
+RPC_STATUS RpcMgmtEpEltInqBegin(RPC_BINDING_HANDLE EpBinding,
+ unsigned long InquiryType, RPC_IF_ID* IfId,
+ unsigned long VersOption, UUID* ObjectUuid, RPC_EP_INQ_HANDLE* InquiryContext)
{
WLog_ERR(TAG, "Not implemented");
return 0;
return 0;
}
-RPC_STATUS RpcMgmtEpEltInqNextA(RPC_EP_INQ_HANDLE InquiryContext, RPC_IF_ID* IfId,
- RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid, RPC_CSTR* Annotation)
+RPC_STATUS RpcMgmtEpEltInqNextA(RPC_EP_INQ_HANDLE InquiryContext,
+ RPC_IF_ID* IfId,
+ RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid, RPC_CSTR* Annotation)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
-RPC_STATUS RpcMgmtEpEltInqNextW(RPC_EP_INQ_HANDLE InquiryContext, RPC_IF_ID* IfId,
- RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid, RPC_WSTR* Annotation)
+RPC_STATUS RpcMgmtEpEltInqNextW(RPC_EP_INQ_HANDLE InquiryContext,
+ RPC_IF_ID* IfId,
+ RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid, RPC_WSTR* Annotation)
{
WLog_ERR(TAG, "Not implemented");
return 0;
}
RPC_STATUS RpcMgmtEpUnregister(RPC_BINDING_HANDLE EpBinding, RPC_IF_ID* IfId,
- RPC_BINDING_HANDLE Binding, UUID* ObjectUuid)
+ RPC_BINDING_HANDLE Binding, UUID* ObjectUuid)
{
WLog_ERR(TAG, "Not implemented");
return 0;