Author: tfaber
Date: Sun Aug 10 16:20:43 2014
New Revision: 63851
URL:
http://svn.reactos.org/svn/reactos?rev=63851&view=rev
Log:
[KERNEL32]
- Fix some style issues in DefineDosDevice
Modified:
trunk/reactos/dll/win32/kernel32/client/dosdev.c
Modified: trunk/reactos/dll/win32/kernel32/client/dosdev.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/dosdev.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/dosdev.c [iso-8859-1] Sun Aug 10 16:20:43
2014
@@ -35,22 +35,18 @@
BOOL Result;
if (lpDeviceName &&
- ! RtlCreateUnicodeStringFromAsciiz(&DeviceNameU,
- (LPSTR)lpDeviceName))
+ !RtlCreateUnicodeStringFromAsciiz(&DeviceNameU, lpDeviceName))
{
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return 0;
}
if (lpTargetPath &&
- ! RtlCreateUnicodeStringFromAsciiz(&TargetPathU,
- (LPSTR)lpTargetPath))
+ !RtlCreateUnicodeStringFromAsciiz(&TargetPathU, lpTargetPath))
{
if (DeviceNameU.Buffer)
{
- RtlFreeHeap(RtlGetProcessHeap (),
- 0,
- DeviceNameU.Buffer);
+ RtlFreeUnicodeString(&DeviceNameU);
}
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return 0;
@@ -62,16 +58,12 @@
if (TargetPathU.Buffer)
{
- RtlFreeHeap(RtlGetProcessHeap (),
- 0,
- TargetPathU.Buffer);
+ RtlFreeUnicodeString(&TargetPathU);
}
if (DeviceNameU.Buffer)
{
- RtlFreeHeap(RtlGetProcessHeap (),
- 0,
- DeviceNameU.Buffer);
+ RtlFreeUnicodeString(&DeviceNameU);
}
return Result;
}
@@ -114,7 +106,7 @@
ArgumentCount = 1;
BufferSize = 0;
- if (! lpTargetPath)
+ if (!lpTargetPath)
{
RtlInitUnicodeString(&NtTargetPathU,
NULL);
@@ -128,10 +120,10 @@
}
else
{
- if (! RtlDosPathNameToNtPathName_U(lpTargetPath,
- &NtTargetPathU,
- 0,
- 0))
+ if (!RtlDosPathNameToNtPathName_U(lpTargetPath,
+ &NtTargetPathU,
+ NULL,
+ NULL))
{
WARN("RtlDosPathNameToNtPathName_U() failed\n");
BaseSetLastNTError(STATUS_OBJECT_NAME_INVALID);
@@ -151,7 +143,7 @@
CaptureBuffer = CsrAllocateCaptureBuffer(ArgumentCount,
BufferSize);
- if (! CaptureBuffer)
+ if (!CaptureBuffer)
{
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
Result = FALSE;
@@ -161,7 +153,7 @@
DefineDosDeviceRequest->Flags = dwFlags;
CsrCaptureMessageBuffer(CaptureBuffer,
- (PVOID)DeviceUpcaseNameU.Buffer,
+ DeviceUpcaseNameU.Buffer,
DeviceUpcaseNameU.Length,
(PVOID*)&DefineDosDeviceRequest->DeviceName.Buffer);
@@ -173,7 +165,7 @@
if (NtTargetPathU.Buffer)
{
CsrCaptureMessageBuffer(CaptureBuffer,
- (PVOID)NtTargetPathU.Buffer,
+ NtTargetPathU.Buffer,
NtTargetPathU.Length,
(PVOID*)&DefineDosDeviceRequest->TargetPath.Buffer);
}
@@ -212,7 +204,7 @@
dbcv.dbcv_size = sizeof(DEV_BROADCAST_VOLUME);
dbcv.dbcv_devicetype = DBT_DEVTYP_VOLUME;
dbcv.dbcv_reserved = 0;
- dbcv.dbcv_unitmask |=
+ dbcv.dbcv_unitmask |=
(1 << (DeviceUpcaseNameU.Buffer[0] - L'A'));
dbcv.dbcv_flags = DBTF_NET;
(void) BSM_ptr(BSF_SENDNOTIFYMESSAGE | BSF_FLUSHDISK,
@@ -293,7 +285,7 @@
{
CurrentLength = min (ucchMax, MAXUSHORT / 2);
TargetPathU.MaximumLength = TargetPathU.Length = (USHORT)CurrentLength *
sizeof(WCHAR);
-
+
TargetPathA.Length = 0;
TargetPathA.MaximumLength = (USHORT)CurrentLength;