From 735784e85b9c7168b156224689da60a6e4d62e1e Mon Sep 17 00:00:00 2001 From: Olga Kornievskaia Date: Mon, 19 Mar 2012 16:52:20 -0400 Subject: [PATCH] notepad specific fixes removing notepad opens file as a directory ifdef for volume query notepad supplies insufficient buffer space but doesn't like buffer_too_small error code. it seems to be fine with partial buffer filled and buffer_overflow error. --- daemon/open.c | 2 -- sys/nfs41_driver.c | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/daemon/open.c b/daemon/open.c index 7ae9825..c36fbf5 100644 --- a/daemon/open.c +++ b/daemon/open.c @@ -507,10 +507,8 @@ static int handle_open(nfs41_upcall *upcall) if (args->create_opts & FILE_DIRECTORY_FILE) { eprintf("trying to open file %s as a directory\n", state->path.path); -#ifdef NOTEPAD_OPEN_FILE_AS_DIRFILE_FIXED status = ERROR_BAD_FILE_TYPE; goto out_free_state; -#endif } } else if (info.type == NF4LNK) { dprintf(2, "handle nfs41_open: SYMLINK\n"); diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c index 8436f33..37d0b7c 100644 --- a/sys/nfs41_driver.c +++ b/sys/nfs41_driver.c @@ -4082,8 +4082,9 @@ NTSTATUS nfs41_QueryVolumeInformation( RxContext->Info.LengthRemaining -= DevExt->VolAttrsLen; status = STATUS_SUCCESS; } else { - RxContext->InformationToReturn = DevExt->VolAttrsLen; - status = STATUS_BUFFER_TOO_SMALL; + RtlCopyMemory(RxContext->Info.Buffer, DevExt->VolAttrs, + RxContext->Info.LengthRemaining); + status = STATUS_BUFFER_OVERFLOW; } goto out; case FileFsDeviceInformation: