aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/nt_path_converter
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2015-05-11 13:12:30 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2015-05-11 13:12:30 +0300
commit46060275f1576cbf4b3601d50485d81d969c7a43 (patch)
treec51a61eb04336932dedb873508e016fe7f71239c /src/nt_path_converter
parentremove unused `#include`s (diff)
downloadwindows7-drivers-46060275f1576cbf4b3601d50485d81d969c7a43.tar.gz
windows7-drivers-46060275f1576cbf4b3601d50485d81d969c7a43.zip
nt_path_converter: logging & \0-termination
Diffstat (limited to 'src/nt_path_converter')
-rw-r--r--src/nt_path_converter/device.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/nt_path_converter/device.c b/src/nt_path_converter/device.c
index 602a7e5..fbffd27 100644
--- a/src/nt_path_converter/device.c
+++ b/src/nt_path_converter/device.c
@@ -35,20 +35,27 @@ static NTSTATUS handle_convert_nt_path(void *in_buf,
UNICODE_STRING uUnresolved, uResolved;
NTSTATUS status = STATUS_SUCCESS;
+ DbgPrint("nt_path_converter: unresolved path: %ws\n", (WCHAR *) in_buf);
+ DbgPrint("nt_path_converter: unresolved size: %lu\n", in_buf_size);
+
RtlInitUnicodeString(&uUnresolved, (WCHAR *) in_buf);
status = nt2dos(&uResolved, &uUnresolved);
if (!NT_SUCCESS(status))
return status;
- *nbwritten = uResolved.Length;
+ *nbwritten = uResolved.Length + sizeof(WCHAR);
+
+ DbgPrint("nt_path_converter: resolved path: %wZ\n", &uResolved);
+ DbgPrint("nt_path_converter: resolved size: %Iu\n", *nbwritten);
- if (out_buf_size < uResolved.Length)
+ if (out_buf_size < *nbwritten)
{
status = STATUS_BUFFER_OVERFLOW;
goto FREE_RESOLVED;
}
+ RtlFillMemory(out_buf, *nbwritten, L'\0');
RtlCopyMemory(out_buf, uResolved.Buffer, uResolved.Length);
FREE_RESOLVED: