summaryrefslogtreecommitdiffhomepage
path: root/src/fs/ntapi_tt_mount.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-12-08 21:51:58 -0500
committermidipix <writeonce@midipix.org>2016-12-08 22:00:08 -0500
commit9dabeb003c6f38e7a5ca5d299921138a4ca5065b (patch)
tree4e8464390d7bf80b806f712593031e5334ed457a /src/fs/ntapi_tt_mount.c
parent8076b5e6f85667916a4ed50a191c4caef8da25b6 (diff)
downloadntapi-9dabeb003c6f38e7a5ca5d299921138a4ca5065b.tar.bz2
ntapi-9dabeb003c6f38e7a5ca5d299921138a4ca5065b.tar.xz
__tt_get_dos_drive_device_or_root_handle(): pass drive_letter by value.
Diffstat (limited to 'src/fs/ntapi_tt_mount.c')
-rw-r--r--src/fs/ntapi_tt_mount.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/fs/ntapi_tt_mount.c b/src/fs/ntapi_tt_mount.c
index 344f5c1..c149e53 100644
--- a/src/fs/ntapi_tt_mount.c
+++ b/src/fs/ntapi_tt_mount.c
@@ -80,7 +80,7 @@ static int32_t __stdcall __tt_connect_to_mount_point_manager(void)
static int32_t __stdcall __tt_get_dos_drive_device_or_root_handle(
__out void ** hdrive,
- __in wchar16_t * drive_letter,
+ __in wchar16_t drive_letter,
__in _dos_drive_handle_type handle_type)
{
#define __common_mode (NT_FILE_SYNCHRONOUS_IO_ALERT)
@@ -98,13 +98,10 @@ static int32_t __stdcall __tt_get_dos_drive_device_or_root_handle(
{'\\','?','?','\\'},
'_',':',0,0};
- if (!hdrive || !drive_letter)
- return NT_STATUS_INVALID_PARAMETER;
-
- if ((*drive_letter>='A') && (*drive_letter<='Z'))
- dos_name_buffer.dos_letter = *drive_letter;
- else if ((*drive_letter>='a') && (*drive_letter<='z'))
- dos_name_buffer.dos_letter = *drive_letter + 'A' - 'a';
+ if ((drive_letter>='A') && (drive_letter<='Z'))
+ dos_name_buffer.dos_letter = drive_letter;
+ else if ((drive_letter>='a') && (drive_letter<='z'))
+ dos_name_buffer.dos_letter = drive_letter + 'A' - 'a';
else
return NT_STATUS_INVALID_PARAMETER_2;
@@ -151,7 +148,7 @@ static int32_t __stdcall __tt_get_dos_drive_device_or_root_handle(
int32_t __stdcall __ntapi_tt_get_dos_drive_device_handle(
__out void ** hdevice,
- __in wchar16_t * drive_letter)
+ __in wchar16_t drive_letter)
{
return __tt_get_dos_drive_device_or_root_handle(
hdevice,
@@ -162,7 +159,7 @@ int32_t __stdcall __ntapi_tt_get_dos_drive_device_handle(
int32_t __stdcall __ntapi_tt_get_dos_drive_root_handle(
__out void ** hroot,
- __in wchar16_t * drive_letter)
+ __in wchar16_t drive_letter)
{
return __tt_get_dos_drive_device_or_root_handle(
hroot,
@@ -174,7 +171,7 @@ int32_t __stdcall __ntapi_tt_get_dos_drive_root_handle(
int32_t __stdcall __ntapi_tt_get_dos_drive_device_name(
__in void * hdevice __optional,
- __in wchar16_t * drive_letter __optional,
+ __in wchar16_t drive_letter __optional,
__out nt_mount_dev_name * buffer,
__in uint32_t buffer_size)
{
@@ -203,7 +200,7 @@ int32_t __stdcall __ntapi_tt_get_dos_drive_device_name(
int32_t __stdcall __ntapi_tt_get_dos_drive_mount_points(
__in void * hdevice __optional,
- __in wchar16_t * drive_letter __optional,
+ __in wchar16_t drive_letter __optional,
__in nt_mount_dev_name * dev_name __optional,
__out void * buffer,
__in uint32_t buffer_size)
@@ -347,13 +344,10 @@ int32_t __stdcall __ntapi_tt_get_dos_drive_letter_from_device(
if (!dev_name) {
dev_name = (nt_mount_dev_name *)&dev_name_buffer;
- status = __ntapi_tt_get_dos_drive_device_name(
- hdevice,
- (wchar16_t *)0,
- dev_name,
- sizeof(dev_name_buffer));
- if (status != NT_STATUS_SUCCESS)
+ if ((status = __ntapi_tt_get_dos_drive_device_name(
+ hdevice,0,dev_name,
+ sizeof(dev_name_buffer))))
return status;
}