Commit e54f6d8f authored by Alexandre Julliard's avatar Alexandre Julliard

mountmgr: Move the macOS credentials support to the Unix library.

parent 07c9dd9b
......@@ -139,7 +139,7 @@ static char *strdupA( const char *str )
return ret;
}
WCHAR *strdupW( const WCHAR *str )
static WCHAR *strdupW( const WCHAR *str )
{
WCHAR *ret;
......
......@@ -433,10 +433,12 @@ static void WINAPI query_symbol_file_callback( TP_CALLBACK_INSTANCE *instance, v
IRP *irp = context;
IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp );
ULONG info = 0;
NTSTATUS status = query_symbol_file( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&info );
struct ioctl_params params = { irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&info };
NTSTATUS status = MOUNTMGR_CALL( query_symbol_file, &params );
irp->IoStatus.Information = info;
irp->IoStatus.u.Status = status;
IoCompleteRequest( irp, IO_NO_INCREMENT );
......@@ -550,52 +552,52 @@ static NTSTATUS WINAPI mountmgr_ioctl( DEVICE_OBJECT *device, IRP *irp )
status = STATUS_NO_MEMORY;
break;
case IOCTL_MOUNTMGR_READ_CREDENTIAL:
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_credential))
if (irpsp->Parameters.DeviceIoControl.InputBufferLength >= sizeof(struct mountmgr_credential))
{
status = STATUS_INVALID_PARAMETER;
break;
struct ioctl_params params = { irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&info };
status = MOUNTMGR_CALL( read_credential, &params );
irp->IoStatus.Information = info;
}
status = read_credential( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&info );
irp->IoStatus.Information = info;
else status = STATUS_INVALID_PARAMETER;
break;
case IOCTL_MOUNTMGR_WRITE_CREDENTIAL:
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_credential))
if (irpsp->Parameters.DeviceIoControl.InputBufferLength >= sizeof(struct mountmgr_credential))
{
status = STATUS_INVALID_PARAMETER;
break;
struct ioctl_params params = { irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&info };
status = MOUNTMGR_CALL( write_credential, &params );
irp->IoStatus.Information = info;
}
status = write_credential( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&info );
irp->IoStatus.Information = info;
else status = STATUS_INVALID_PARAMETER;
break;
case IOCTL_MOUNTMGR_DELETE_CREDENTIAL:
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_credential))
if (irpsp->Parameters.DeviceIoControl.InputBufferLength >= sizeof(struct mountmgr_credential))
{
status = STATUS_INVALID_PARAMETER;
break;
struct ioctl_params params = { irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&info };
status = MOUNTMGR_CALL( delete_credential, &params );
irp->IoStatus.Information = info;
}
status = delete_credential( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&info );
irp->IoStatus.Information = info;
else status = STATUS_INVALID_PARAMETER;
break;
case IOCTL_MOUNTMGR_ENUMERATE_CREDENTIALS:
if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_credential_list))
if (irpsp->Parameters.DeviceIoControl.InputBufferLength >= sizeof(struct mountmgr_credential))
{
status = STATUS_INVALID_PARAMETER;
break;
struct ioctl_params params = { irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&info };
status = MOUNTMGR_CALL( enumerate_credentials, &params );
irp->IoStatus.Information = info;
}
status = enumerate_credentials( irp->AssociatedIrp.SystemBuffer,
irpsp->Parameters.DeviceIoControl.InputBufferLength,
irpsp->Parameters.DeviceIoControl.OutputBufferLength,
&info );
irp->IoStatus.Information = info;
else status = STATUS_INVALID_PARAMETER;
break;
default:
FIXME( "ioctl %x not supported\n", irpsp->Parameters.DeviceIoControl.IoControlCode );
......
......@@ -36,8 +36,6 @@
#define WINE_MOUNTMGR_EXTENSIONS
#include "ddk/mountmgr.h"
extern WCHAR *strdupW( const WCHAR * ) DECLSPEC_HIDDEN;
/* device functions */
enum device_type
......
......@@ -439,4 +439,9 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
set_shell_folder,
get_shell_folder,
dhcp_request,
query_symbol_file,
read_credential,
write_credential,
delete_credential,
enumerate_credentials,
};
......@@ -127,6 +127,14 @@ struct dhcp_request_params
ULONG *ret_size;
};
struct ioctl_params
{
void *buff;
ULONG insize;
ULONG outsize;
ULONG *info;
};
enum mountmgr_funcs
{
unix_run_loop,
......@@ -142,6 +150,11 @@ enum mountmgr_funcs
unix_set_shell_folder,
unix_get_shell_folder,
unix_dhcp_request,
unix_query_symbol_file,
unix_read_credential,
unix_write_credential,
unix_delete_credential,
unix_enumerate_credentials,
};
extern unixlib_handle_t mountmgr_handle;
......@@ -155,8 +168,8 @@ extern void run_dbus_loop(void) DECLSPEC_HIDDEN;
extern void run_diskarbitration_loop(void) DECLSPEC_HIDDEN;
extern NTSTATUS dhcp_request( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS query_symbol_file( void *buff, ULONG insize, ULONG outsize, ULONG *info ) DECLSPEC_HIDDEN;
extern NTSTATUS read_credential( void *buff, ULONG insize, ULONG outsize, ULONG *info ) DECLSPEC_HIDDEN;
extern NTSTATUS write_credential( void *buff, ULONG insize, ULONG outsize, ULONG *info ) DECLSPEC_HIDDEN;
extern NTSTATUS delete_credential( void *buff, ULONG insize, ULONG outsize, ULONG *info ) DECLSPEC_HIDDEN;
extern NTSTATUS enumerate_credentials( void *buff, ULONG insize, ULONG outsize, ULONG *info ) DECLSPEC_HIDDEN;
extern NTSTATUS query_symbol_file( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS read_credential( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS write_credential( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS delete_credential( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS enumerate_credentials( void *args ) DECLSPEC_HIDDEN;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment