- From 466cac711f321214eb71d15eeba68f224c669d4f Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 6 Jun 2024 11:32:45 +0200
- Subject: [PATCH 1/6] dll: Add thread ID to nfs41_np debug output
- Add thread ID to nfs41_np debug output
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- dll/nfs41_np.c | 15 +++++----------
- 1 file changed, 5 insertions(+), 10 deletions(-)
- diff --git a/dll/nfs41_np.c b/dll/nfs41_np.c
- index dfd7b88..1b23eb3 100644
- --- a/dll/nfs41_np.c
- +++ b/dll/nfs41_np.c
- @@ -41,7 +41,7 @@
- #else
- #define DbgP(_x_)
- #endif
- -#define TRACE_TAG L"[NFS41_NP] "
- +#define TRACE_TAG L"[NFS41_NP]"
- #define WNNC_DRIVER(major, minor) ((major * 0x00010000) + (minor))
- @@ -55,17 +55,12 @@ ULONG _cdecl NFS41DbgPrint(__in LPTSTR fmt, ...)
- va_list marker;
- va_start(marker, fmt);
- -#pragma warning( push )
- - /*
- - * Disable "'wcscpy': This function or variable may be unsafe",
- - * in this context it is safe to use
- - */
- -#pragma warning (disable : 4996)
- - (void)wcscpy(szbp, TRACE_TAG);
- -#pragma warning( pop )
- + (void)StringCchPrintfW(szbp, SZBUFFER_SIZE-(szbp - szbuffer),
- + TRACE_TAG TEXT("[thr=%04x] "), (int)GetCurrentThreadId());
- szbp += wcslen(szbp);
- - StringCchVPrintfW(szbp, SZBUFFER_SIZE-(szbp - szbuffer), fmt, marker);
- + (void)StringCchVPrintfW(szbp, SZBUFFER_SIZE-(szbp - szbuffer),
- + fmt, marker);
- szbuffer[SZBUFFER_SIZE-1] = L'\0';
- OutputDebugString(szbuffer);
- --
- 2.45.1
- From 961cb19c0814ac2dfac901ab5e08f2cefbd49a8e Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 6 Jun 2024 13:39:20 +0200
- Subject: [PATCH 2/6] dll: Minor nfs41_np cleanup
- Minor nfs41_np cleanup
- Reviewed-by: Dan Shelton <dan.f.shelton@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- dll/nfs41_np.c | 1340 ++++++++++++++++++++++++------------------------
- 1 file changed, 683 insertions(+), 657 deletions(-)
- diff --git a/dll/nfs41_np.c b/dll/nfs41_np.c
- index 1b23eb3..9a4d7cd 100644
- --- a/dll/nfs41_np.c
- +++ b/dll/nfs41_np.c
- @@ -1,5 +1,5 @@
- -/* NFSv4.1 client for Windows
- - * Copyright (C) 2012 The Regents of the University of Michigan
- +/* NFSv4.1 client for Windows
- + * Copyright (C) 2012 The Regents of the University of Michigan
- *
- * Olga Kornievskaia <aglo@umich.edu>
- * Casey Bodley <cbodley@umich.edu>
- @@ -7,16 +7,16 @@
- *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- - * the Free Software Foundation; either version 2.1 of the License, or (at
- - * your option) any later version.
- - *
- - * This library is distributed in the hope that it will be useful, but
- - * without any warranty; without even the implied warranty of merchantability
- - * or fitness for a particular purpose. See the GNU Lesser General Public
- - * License for more details.
- - *
- - * You should have received a copy of the GNU Lesser General Public License
- - * along with this library; if not, write to the Free Software Foundation,
- + * the Free Software Foundation; either version 2.1 of the License, or (at
- + * your option) any later version.
- + *
- + * This library is distributed in the hope that it will be useful, but
- + * without any warranty; without even the implied warranty of merchantability
- + * or fitness for a particular purpose. See the GNU Lesser General Public
- + * License for more details.
- + *
- + * You should have received a copy of the GNU Lesser General Public License
- + * along with this library; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- */
- @@ -28,6 +28,7 @@
- #include <npapi.h>
- #include <devioctl.h>
- #include <strsafe.h>
- +#include <stdbool.h>
- #include "nfs41_build_features.h"
- #include "nfs41_driver.h"
- @@ -42,8 +43,10 @@
- #define DbgP(_x_)
- #endif
- #define TRACE_TAG L"[NFS41_NP]"
- -#define WNNC_DRIVER(major, minor) ((major * 0x00010000) + (minor))
- +#define WNNC_DRIVER(major, minor) (((major) * 0x00010000) + (minor))
- +#define PTR2PTRDIFF_T(p) (((char *)(p))-((char *)0))
- +#define HANDLE2INT(h) ((int)PTR2PTRDIFF_T(h))
- ULONG _cdecl NFS41DbgPrint(__in LPTSTR fmt, ...)
- {
- @@ -56,7 +59,7 @@ ULONG _cdecl NFS41DbgPrint(__in LPTSTR fmt, ...)
- va_start(marker, fmt);
- (void)StringCchPrintfW(szbp, SZBUFFER_SIZE-(szbp - szbuffer),
- - TRACE_TAG TEXT("[thr=%04x] "), (int)GetCurrentThreadId());
- + TRACE_TAG L"[thr=%04x] ", (int)GetCurrentThreadId());
- szbp += wcslen(szbp);
- (void)StringCchVPrintfW(szbp, SZBUFFER_SIZE-(szbp - szbuffer),
- @@ -69,149 +72,142 @@ ULONG _cdecl NFS41DbgPrint(__in LPTSTR fmt, ...)
- return rc;
- }
- -
- -int filter(unsigned int code)
- -{
- - DbgP((L"####Got exception %u\n", code));
- - return EXCEPTION_CONTINUE_SEARCH;
- -}
- -
- -DWORD
- -OpenSharedMemory(
- - PHANDLE phMutex,
- - PHANDLE phMemory,
- - PVOID *pMemory)
- -/*++
- -
- -Routine Description:
- -
- - This routine opens the shared memory for exclusive manipulation
- -
- -Arguments:
- -
- - phMutex - the mutex handle
- -
- - phMemory - the memory handle
- -
- - pMemory - a ptr. to the shared memory which is set if successful
- -
- -Return Value:
- -
- - WN_SUCCESS -- if successful
- -
- ---*/
- -{
- - DWORD dwStatus;
- -
- - *phMutex = 0;
- - *phMemory = 0;
- - *pMemory = NULL;
- -
- - *phMutex = CreateMutex(NULL, FALSE, TEXT(NFS41NP_MUTEX_NAME));
- - if (*phMutex == NULL)
- - {
- - dwStatus = GetLastError();
- - DbgP((TEXT("OpenSharedMemory: OpenMutex failed\n")));
- - goto OpenSharedMemoryAbort1;
- - }
- -
- - WaitForSingleObject(*phMutex, INFINITE);
- -
- - *phMemory = OpenFileMapping(FILE_MAP_WRITE,
- - FALSE,
- - TEXT(NFS41_USER_SHARED_MEMORY_NAME));
- - if (*phMemory == NULL)
- - {
- - dwStatus = GetLastError();
- - DbgP((TEXT("OpenSharedMemory: OpenFileMapping failed\n")));
- - goto OpenSharedMemoryAbort2;
- - }
- -
- - *pMemory = MapViewOfFile(*phMemory, FILE_MAP_WRITE, 0, 0, 0);
- - if (*pMemory == NULL)
- - {
- - dwStatus = GetLastError();
- - DbgP((TEXT("OpenSharedMemory: MapViewOfFile failed\n")));
- - goto OpenSharedMemoryAbort3;
- - }
- -
- - return ERROR_SUCCESS;
- -
- -OpenSharedMemoryAbort3:
- - CloseHandle(*phMemory);
- -
- -OpenSharedMemoryAbort2:
- - ReleaseMutex(*phMutex);
- - CloseHandle(*phMutex);
- - *phMutex = NULL;
- -
- -OpenSharedMemoryAbort1:
- - DbgP((TEXT("OpenSharedMemory: return dwStatus: %d\n"), dwStatus));
- -
- - return dwStatus;
- -}
- -
- -VOID
- -CloseSharedMemory(
- - PHANDLE hMutex,
- - PHANDLE hMemory,
- - PVOID *pMemory)
- -/*++
- -
- -Routine Description:
- -
- - This routine relinquishes control of the shared memory after exclusive
- - manipulation
- -
- -Arguments:
- -
- - hMutex - the mutex handle
- -
- - hMemory - the memory handle
- -
- - pMemory - a ptr. to the shared memory which is set if successful
- -
- -Return Value:
- -
- ---*/
- -{
- - if (*pMemory)
- - {
- - UnmapViewOfFile(*pMemory);
- - *pMemory = NULL;
- - }
- - if (*hMemory)
- - {
- - CloseHandle(*hMemory);
- - *hMemory = 0;
- - }
- - if (*hMutex)
- - {
- - if (ReleaseMutex(*hMutex) == FALSE)
- - {
- - DbgP((TEXT("CloseSharedMemory: ReleaseMutex error: %d\n"), GetLastError()));
- - }
- - CloseHandle(*hMutex);
- - *hMutex = 0;
- - }
- -}
- -
- -static DWORD StoreConnectionInfo(
- - IN LPCWSTR LocalName,
- - IN LPCWSTR ConnectionName,
- - IN USHORT ConnectionNameLength,
- - IN LPNETRESOURCE lpNetResource)
- -{
- - DWORD status;
- - HANDLE hMutex, hMemory;
- - PNFS41NP_SHARED_MEMORY pSharedMemory;
- - PNFS41NP_NETRESOURCE pNfs41NetResource;
- - INT Index;
- - BOOLEAN FreeEntryFound = FALSE;
- +
- +int filter(unsigned int code)
- +{
- + DbgP((L"####Got exception %u\n", code));
- + return EXCEPTION_CONTINUE_SEARCH;
- +}
- +
- +static
- +DWORD OpenSharedMemory(
- + PHANDLE phMutex,
- + PHANDLE phMemory,
- + PVOID *pMemory)
- +/*++
- +
- +Routine Description:
- +
- + This routine opens the shared memory for exclusive manipulation
- +
- +Arguments:
- + phMutex - the mutex handle
- + phMemory - the memory handle
- + pMemory - a ptr. to the shared memory which is set if successful
- +
- +Return Value:
- + WN_SUCCESS -- if successful
- +
- +--*/
- +{
- + DWORD dwStatus;
- +
- + *phMutex = 0;
- + *phMemory = 0;
- + *pMemory = NULL;
- +
- + DbgP((L"--> OpenSharedMemory()\n"));
- +
- + *phMutex = CreateMutexA(NULL, FALSE, NFS41NP_MUTEX_NAME);
- + if (*phMutex == NULL) {
- + dwStatus = GetLastError();
- + DbgP((L"OpenSharedMemory: "
- + "CreateMutexA() failed, lasterr=%d\n",
- + dwStatus));
- + goto OpenSharedMemoryAbort1;
- + }
- +
- + (void)WaitForSingleObject(*phMutex, INFINITE);
- +
- + *phMemory = OpenFileMappingA(FILE_MAP_WRITE,
- + FALSE,
- + NFS41_USER_SHARED_MEMORY_NAME);
- + if (*phMemory == NULL) {
- + dwStatus = GetLastError();
- + DbgP((L"OpenFileMappingA() failed, lasterr=%d\n", dwStatus));
- + goto OpenSharedMemoryAbort2;
- + }
- +
- + *pMemory = MapViewOfFile(*phMemory, FILE_MAP_WRITE, 0, 0, 0);
- + if (*pMemory == NULL) {
- + dwStatus = GetLastError();
- + DbgP((L"MapViewOfFile failed, lasterr=%d\n", dwStatus));
- + goto OpenSharedMemoryAbort3;
- + }
- +
- + DbgP((L"<-- OpenSharedMemory() returns ERROR_SUCCESS\n"));
- + return ERROR_SUCCESS;
- +
- +OpenSharedMemoryAbort3:
- + (void)CloseHandle(*phMemory);
- +
- +OpenSharedMemoryAbort2:
- + (void)ReleaseMutex(*phMutex);
- + (void)CloseHandle(*phMutex);
- + *phMutex = NULL;
- +
- +OpenSharedMemoryAbort1:
- + DbgP((L"<-- OpenSharedMemory: return dwStatus: %d\n", dwStatus));
- +
- + return dwStatus;
- +}
- +
- +static
- +VOID CloseSharedMemory(
- + PHANDLE hMutex,
- + PHANDLE hMemory,
- + PVOID *pMemory)
- +/*++
- +
- +Routine Description:
- + This routine relinquishes control of the shared memory after
- + exclusive manipulation
- +
- +Arguments:
- + hMutex - the mutex handle
- + hMemory - the memory handle
- + pMemory - a ptr. to the shared memory which is set if successful
- +
- +Return Value:
- +
- +--*/
- +{
- + DbgP((L"--> CloseSharedMemory\n"));
- + if (*pMemory) {
- + (void)UnmapViewOfFile(*pMemory);
- + *pMemory = NULL;
- + }
- + if (*hMemory) {
- + (void)CloseHandle(*hMemory);
- + *hMemory = 0;
- + }
- + if (*hMutex) {
- + if (ReleaseMutex(*hMutex) == FALSE) {
- + DbgP((L"ReleaseMutex error: %d\n", (int)GetLastError()));
- + }
- + (void)CloseHandle(*hMutex);
- + *hMutex = 0;
- + }
- + DbgP((L"<-- CloseSharedMemory\n"));
- +}
- +
- +static DWORD StoreConnectionInfo(
- + IN LPCWSTR LocalName,
- + IN LPCWSTR ConnectionName,
- + IN USHORT ConnectionNameLength,
- + IN LPNETRESOURCE lpNetResource)
- +{
- + DWORD status;
- + HANDLE hMutex, hMemory;
- + PNFS41NP_SHARED_MEMORY pSharedMemory;
- + PNFS41NP_NETRESOURCE pNfs41NetResource;
- + INT i;
- + bool FreeEntryFound = false;
- DbgP((L"--> StoreConnectionInfo\n"));
- - status = OpenSharedMemory(&hMutex, &hMemory, &(PVOID)pSharedMemory);
- + status = OpenSharedMemory(&hMutex, &hMemory,
- + &(PVOID)pSharedMemory);
- if (status)
- goto out;
- @@ -219,215 +215,232 @@ static DWORD StoreConnectionInfo(
- pSharedMemory->NextAvailableIndex,
- pSharedMemory->NumberOfResourcesInUse));
- - for (Index = 0; Index < pSharedMemory->NextAvailableIndex; Index++)
- - {
- - if (!pSharedMemory->NetResources[Index].InUse)
- - {
- - FreeEntryFound = TRUE;
- - DbgP((TEXT("Reusing existing index %d\n"), Index));
- - break;
- - }
- - }
- -
- - if (!FreeEntryFound)
- - {
- - if (pSharedMemory->NextAvailableIndex >= NFS41NP_MAX_DEVICES) {
- - status = WN_NO_MORE_DEVICES;
- - goto out_close;
- - }
- - Index = pSharedMemory->NextAvailableIndex++;
- - DbgP((TEXT("Using new index %d\n"), Index));
- - }
- -
- - pSharedMemory->NumberOfResourcesInUse += 1;
- -
- - pNfs41NetResource = &pSharedMemory->NetResources[Index];
- -
- - pNfs41NetResource->InUse = TRUE;
- - pNfs41NetResource->dwScope = lpNetResource->dwScope;
- - pNfs41NetResource->dwType = lpNetResource->dwType;
- - pNfs41NetResource->dwDisplayType = lpNetResource->dwDisplayType;
- - pNfs41NetResource->dwUsage = RESOURCEUSAGE_CONNECTABLE;
- - pNfs41NetResource->LocalNameLength = (USHORT)(wcslen(LocalName) + 1) * sizeof(WCHAR);
- - pNfs41NetResource->RemoteNameLength = (USHORT)(wcslen(lpNetResource->lpRemoteName) + 1) * sizeof(WCHAR);
- - pNfs41NetResource->ConnectionNameLength = ConnectionNameLength;
- -
- - StringCchCopy(pNfs41NetResource->LocalName,
- - pNfs41NetResource->LocalNameLength,
- - LocalName);
- - StringCchCopy(pNfs41NetResource->RemoteName,
- - pNfs41NetResource->RemoteNameLength,
- - lpNetResource->lpRemoteName);
- - StringCchCopy(pNfs41NetResource->ConnectionName,
- - pNfs41NetResource->ConnectionNameLength,
- - ConnectionName);
- -
- - // TODO: copy mount options -cbodley
- -
- + for (i = 0; i < pSharedMemory->NextAvailableIndex; i++)
- + {
- + if (!pSharedMemory->NetResources[i].InUse) {
- + FreeEntryFound = true;
- + DbgP((L"Reusing existing index %d\n", i));
- + break;
- + }
- + }
- +
- + if (!FreeEntryFound) {
- + if (pSharedMemory->NextAvailableIndex >= NFS41NP_MAX_DEVICES) {
- + status = WN_NO_MORE_DEVICES;
- + goto out_close;
- + }
- + i = pSharedMemory->NextAvailableIndex++;
- + DbgP((L"Using new index %d\n", i));
- + }
- +
- + pSharedMemory->NumberOfResourcesInUse += 1;
- +
- + pNfs41NetResource = &pSharedMemory->NetResources[i];
- +
- + pNfs41NetResource->InUse = TRUE;
- + pNfs41NetResource->dwScope = lpNetResource->dwScope;
- + pNfs41NetResource->dwType = lpNetResource->dwType;
- + pNfs41NetResource->dwDisplayType =
- + lpNetResource->dwDisplayType;
- + pNfs41NetResource->dwUsage = RESOURCEUSAGE_CONNECTABLE;
- + pNfs41NetResource->LocalNameLength =
- + (USHORT)(wcslen(LocalName) + 1) * sizeof(WCHAR);
- + pNfs41NetResource->RemoteNameLength =
- + (USHORT)(wcslen(lpNetResource->lpRemoteName)+1)*sizeof(WCHAR);
- + pNfs41NetResource->ConnectionNameLength = ConnectionNameLength;
- +
- + (void)StringCchCopy(pNfs41NetResource->LocalName,
- + pNfs41NetResource->LocalNameLength,
- + LocalName);
- + (void)StringCchCopy(pNfs41NetResource->RemoteName,
- + pNfs41NetResource->RemoteNameLength,
- + lpNetResource->lpRemoteName);
- + (void)StringCchCopy(pNfs41NetResource->ConnectionName,
- + pNfs41NetResource->ConnectionNameLength,
- + ConnectionName);
- +
- + // TODO: copy mount options -cbodley
- +
- out_close:
- CloseSharedMemory(&hMutex, &hMemory, &(PVOID)pSharedMemory);
- out:
- - DbgP((TEXT("<-- StoreConnectionInfo returns %d\n"), (int)status));
- + DbgP((L"<-- StoreConnectionInfo returns %d\n", (int)status));
- return status;
- }
- -ULONG
- -SendTo_NFS41Driver(
- - IN ULONG IoctlCode,
- - IN PVOID InputDataBuf,
- - IN ULONG InputDataLen,
- - IN PVOID OutputDataBuf,
- - IN PULONG pOutputDataLen)
- -{
- - HANDLE DeviceHandle; // The mini rdr device handle
- +static
- +ULONG SendTo_NFS41Driver(
- + IN ULONG IoctlCode,
- + IN PVOID InputDataBuf,
- + IN ULONG InputDataLen,
- + IN PVOID OutputDataBuf,
- + IN PULONG pOutputDataLen)
- +{
- + HANDLE DeviceHandle; // The mini rdr device handle
- BOOL rc = FALSE;
- ULONG Status;
- - DbgP((TEXT("--> SendTo_NFS41Driver\n")));
- + DbgP((L"--> SendTo_NFS41Driver\n"));
- Status = WN_SUCCESS;
- - DbgP((L"calling CreateFile\n"));
- - DeviceHandle = CreateFile(
- + DbgP((L"calling CreateFileW\n"));
- + DeviceHandle = CreateFileW(
- NFS41_USER_DEVICE_NAME,
- GENERIC_READ | GENERIC_WRITE,
- - FILE_SHARE_READ | FILE_SHARE_WRITE,
- - (LPSECURITY_ATTRIBUTES)NULL,
- - OPEN_EXISTING,
- + FILE_SHARE_READ | FILE_SHARE_WRITE,
- + (LPSECURITY_ATTRIBUTES)NULL,
- + OPEN_EXISTING,
- 0,
- - (HANDLE) NULL );
- + (HANDLE)NULL);
- + DbgP((L"after CreateFileW() Device Handle\n"));
- - DbgP((L"after CreateFile Device Handle\n"));
- - if ( INVALID_HANDLE_VALUE != DeviceHandle )
- - {
- - __try {
- + if (DeviceHandle == INVALID_HANDLE_VALUE) {
- + Status = GetLastError();
- + DbgP((L"SendTo_NFS41Driver: error %08lx opening device\n",
- + Status));
- + goto out;
- + }
- +
- + __try {
- DbgP((L"calling DeviceIoControl\n"));
- rc = DeviceIoControl(
- DeviceHandle,
- IoctlCode,
- - InputDataBuf,
- - InputDataLen,
- - OutputDataBuf,
- - *pOutputDataLen,
- - pOutputDataLen,
- - NULL );
- - } __except(filter(GetExceptionCode())) {
- - DbgP((L"#### In except\n"));
- - }
- - DbgP((L"returned from DeviceIoControl %08lx\n", rc));
- - if ( !rc )
- - {
- - DbgP((L"SendTo_NFS41Driver: returning error from DeviceIoctl\n"));
- - Status = GetLastError( );
- - }
- - else
- - {
- - DbgP((L"SendTo_NFS41Driver: The DeviceIoctl call succeded\n"));
- - }
- - CloseHandle(DeviceHandle);
- + InputDataBuf,
- + InputDataLen,
- + OutputDataBuf,
- + *pOutputDataLen,
- + pOutputDataLen,
- + NULL);
- + } __except(filter(GetExceptionCode())) {
- + DbgP((L"#### DeviceIoControl() exception\n"));
- }
- - else
- - {
- - Status = GetLastError( );
- - DbgP((L"SendTo_NFS41Driver: error %08lx opening device \n", Status));
- + Status = GetLastError();
- + DbgP((L"DeviceIoControl returned rc=%08lx\n", rc));
- + if (!rc) {
- + DbgP((L"SendTo_NFS41Driver: "
- + "returning error from DeviceIoctl\n"));
- }
- - DbgP((TEXT("<-- SendTo_NFS41Driver returns %d\n"), Status));
- + else {
- + DbgP((L"SendTo_NFS41Driver: DeviceIoctl() success\n"));
- + Status = WN_SUCCESS;
- + }
- + (void)CloseHandle(DeviceHandle);
- +out:
- + DbgP((L"<-- SendTo_NFS41Driver returns %d\n", Status));
- return Status;
- }
- -DWORD APIENTRY
- -NPGetCaps(
- - DWORD nIndex )
- +static
- +const char *netcaps2string(DWORD idx)
- {
- - DWORD rc = 0;
- +#define NETCAPS_TO_STRLITERAL(e) case e: return #e
- + switch(idx) {
- + NETCAPS_TO_STRLITERAL(WNNC_SPEC_VERSION);
- + NETCAPS_TO_STRLITERAL(WNNC_NET_TYPE);
- + NETCAPS_TO_STRLITERAL(WNNC_DRIVER_VERSION);
- + NETCAPS_TO_STRLITERAL(WNNC_CONNECTION);
- + NETCAPS_TO_STRLITERAL(WNNC_ENUMERATION);
- + NETCAPS_TO_STRLITERAL(WNNC_START);
- + NETCAPS_TO_STRLITERAL(WNNC_USER);
- + NETCAPS_TO_STRLITERAL(WNNC_DIALOG);
- + NETCAPS_TO_STRLITERAL(WNNC_ADMIN);
- + NETCAPS_TO_STRLITERAL(WNNC_CONNECTION_FLAGS);
- + }
- + return "<unknown WNNC_* index>";
- +}
- - DbgP(( L"GetNetCaps %d\n", nIndex ));
- - switch ( nIndex )
- - {
- +DWORD APIENTRY
- +NPGetCaps(
- + DWORD nIndex )
- +{
- + DWORD rc = 0;
- +
- + DbgP((L"--> GetNetCaps(nIndex='%S'(=%d)\n",
- + netcaps2string(nIndex), nIndex));
- + switch(nIndex) {
- case WNNC_SPEC_VERSION:
- - rc = WNNC_SPEC_VERSION51;
- - break;
- -
- - case WNNC_NET_TYPE:
- - rc = WNNC_NET_RDR2SAMPLE;
- - break;
- -
- - case WNNC_DRIVER_VERSION:
- - rc = WNNC_DRIVER(1, 0);
- - break;
- -
- - case WNNC_CONNECTION:
- - rc = WNNC_CON_GETCONNECTIONS |
- - WNNC_CON_CANCELCONNECTION |
- - WNNC_CON_ADDCONNECTION |
- - WNNC_CON_ADDCONNECTION3;
- - break;
- -
- - case WNNC_ENUMERATION:
- - rc = WNNC_ENUM_LOCAL;
- - break;
- -
- - case WNNC_START:
- - rc = 1;
- - break;
- -
- - case WNNC_USER:
- - case WNNC_DIALOG:
- - case WNNC_ADMIN:
- - default:
- + rc = WNNC_SPEC_VERSION51;
- + break;
- + case WNNC_NET_TYPE:
- + rc = WNNC_NET_RDR2SAMPLE;
- + break;
- + case WNNC_DRIVER_VERSION:
- + rc = WNNC_DRIVER(1, 0);
- + break;
- + case WNNC_CONNECTION:
- + rc = WNNC_CON_GETCONNECTIONS |
- + WNNC_CON_CANCELCONNECTION |
- + WNNC_CON_ADDCONNECTION |
- + WNNC_CON_ADDCONNECTION3;
- + break;
- + case WNNC_ENUMERATION:
- + rc = WNNC_ENUM_LOCAL;
- + break;
- + case WNNC_START:
- + rc = 1;
- + break;
- + case WNNC_USER:
- + case WNNC_DIALOG:
- + case WNNC_ADMIN:
- + case WNNC_CONNECTION_FLAGS:
- + default:
- rc = 0;
- break;
- }
- + DbgP((L"<-- GetNetCaps returns %d\n", (int)rc));
- return rc;
- }
- -DWORD APIENTRY
- -NPLogonNotify(
- - __in PLUID lpLogonId,
- - __in PCWSTR lpAuthentInfoType,
- - __in PVOID lpAuthentInfo,
- - __in PCWSTR lpPreviousAuthentInfoType,
- - __in PVOID lpPreviousAuthentInfo,
- - __in PWSTR lpStationName,
- - __in PVOID StationHandle,
- +DWORD APIENTRY
- +NPLogonNotify(
- + __in PLUID lpLogonId,
- + __in PCWSTR lpAuthentInfoType,
- + __in PVOID lpAuthentInfo,
- + __in PCWSTR lpPreviousAuthentInfoType,
- + __in PVOID lpPreviousAuthentInfo,
- + __in PWSTR lpStationName,
- + __in PVOID StationHandle,
- __out PWSTR *lpLogonScript)
- {
- *lpLogonScript = NULL;
- - DbgP(( L"NPLogonNotify: returning WN_SUCCESS\n" ));
- + DbgP((L"NPLogonNotify: returning WN_SUCCESS\n"));
- return WN_SUCCESS;
- }
- -DWORD APIENTRY
- -NPPasswordChangeNotify (
- - __in LPCWSTR lpAuthentInfoType,
- - __in LPVOID lpAuthentInfo,
- - __in LPCWSTR lpPreviousAuthentInfoType,
- - __in LPVOID lpPreviousAuthentInfo,
- - __in LPWSTR lpStationName,
- +DWORD APIENTRY
- +NPPasswordChangeNotify (
- + __in LPCWSTR lpAuthentInfoType,
- + __in LPVOID lpAuthentInfo,
- + __in LPCWSTR lpPreviousAuthentInfoType,
- + __in LPVOID lpPreviousAuthentInfo,
- + __in LPWSTR lpStationName,
- LPVOID StationHandle,
- DWORD dwChangeInfo )
- {
- - DbgP(( L"NPPasswordChangeNotify: WN_NOT_SUPPORTED\n" ));
- - SetLastError( WN_NOT_SUPPORTED );
- + DbgP(( L"NPPasswordChangeNotify: WN_NOT_SUPPORTED\n"));
- + SetLastError(WN_NOT_SUPPORTED);
- return WN_NOT_SUPPORTED;
- }
- -
- -DWORD APIENTRY
- -NPAddConnection(
- - __in LPNETRESOURCE lpNetResource,
- - __in_opt LPWSTR lpPassword,
- - __in_opt LPWSTR lpUserName )
- -{
- - return NPAddConnection3( NULL, lpNetResource, lpPassword, lpUserName, 0 );
- -}
- -
- -DWORD APIENTRY
- -NPAddConnection3(
- - __in HWND hwndOwner,
- - __in LPNETRESOURCE lpNetResource,
- - __in_opt LPWSTR lpPassword,
- - __in_opt LPWSTR lpUserName,
- +
- +DWORD APIENTRY
- +NPAddConnection(
- + __in LPNETRESOURCE lpNetResource,
- + __in_opt LPWSTR lpPassword,
- + __in_opt LPWSTR lpUserName )
- +{
- + return NPAddConnection3(NULL, lpNetResource, lpPassword,
- + lpUserName, 0);
- +}
- +
- +DWORD APIENTRY
- +NPAddConnection3(
- + __in HWND hwndOwner,
- + __in LPNETRESOURCE lpNetResource,
- + __in_opt LPWSTR lpPassword,
- + __in_opt LPWSTR lpUserName,
- __in DWORD dwFlags)
- {
- DWORD Status;
- @@ -443,7 +456,9 @@ NPAddConnection3(
- DbgP((L"--> NPAddConnection3(lpNetResource->lpLocalName='%s', "
- L"lpNetResource->lpRemoteName='%s', "
- L"username='%s', passwd='%s')\n",
- - lpNetResource->lpLocalName, lpNetResource->lpRemoteName, lpUserName, lpPassword));
- + lpNetResource->lpLocalName,
- + lpNetResource->lpRemoteName,lpUserName,
- + lpPassword));
- Status = InitializeConnectionInfo(&Connection,
- (PMOUNT_OPTION_BUFFER)lpNetResource->lpComment,
- @@ -453,12 +468,13 @@ NPAddConnection3(
- goto out;
- }
- - // \device\miniredirector\;<DriveLetter>:\Server\Share
- -
- + // \device\miniredirector\;<DriveLetter>:\Server\Share
- +
- // local name, must start with "X:"
- if (lstrlen(lpNetResource->lpLocalName) < 2 ||
- lpNetResource->lpLocalName[1] != L':') {
- - DbgP((L"lpNetResource->lpLocalName(='%s') is not a device letter\n",
- + DbgP((L"lpNetResource->lpLocalName(='%s') "
- + "is not a device letter\n",
- lpNetResource->lpLocalName));
- Status = WN_BAD_LOCALNAME;
- goto out;
- @@ -467,65 +483,73 @@ NPAddConnection3(
- LocalName[0] = towupper(lpNetResource->lpLocalName[0]);
- LocalName[1] = L':';
- LocalName[2] = L'\0';
- - StringCchCopyW( ConnectionName, NFS41_SYS_MAX_PATH_LEN, NFS41_DEVICE_NAME );
- - StringCchCatW( ConnectionName, NFS41_SYS_MAX_PATH_LEN, L"\\;" );
- - StringCchCatW( ConnectionName, NFS41_SYS_MAX_PATH_LEN, LocalName );
- + (void)StringCchCopyW(ConnectionName,
- + NFS41_SYS_MAX_PATH_LEN, NFS41_DEVICE_NAME);
- + (void)StringCchCatW(ConnectionName,
- + NFS41_SYS_MAX_PATH_LEN, L"\\;");
- + (void)StringCchCatW(ConnectionName,
- + NFS41_SYS_MAX_PATH_LEN, LocalName);
- // remote name, must start with "\\"
- - if (lpNetResource->lpRemoteName[0] == L'\0' ||
- - lpNetResource->lpRemoteName[0] != L'\\' ||
- - lpNetResource->lpRemoteName[1] != L'\\') {
- - Status = WN_BAD_NETNAME;
- - goto out;
- - }
- -
- - /* note: remotename comes as \\server but we need to add \server thus +1 pointer */
- - p = lpNetResource->lpRemoteName + 1;
- - ServerName[0] = L'\\';
- - i = 1;
- - for(;;) {
- - /* convert servername ending unix slash to windows slash */
- - if (p[i] == L'/')
- - p[i] = L'\\';
- - /* deal with servername ending with any slash */
- - if (p[i] == L'\0')
- - p[i] = L'\\';
- - ServerName[i] = p[i];
- - if (p[i] == L'\\') break;
- + if ((lpNetResource->lpRemoteName[0] == L'\0') ||
- + (lpNetResource->lpRemoteName[0] != L'\\') ||
- + (lpNetResource->lpRemoteName[1] != L'\\')) {
- + Status = WN_BAD_NETNAME;
- + goto out;
- + }
- +
- + /*
- + * Note: remotename comes as \\server but we need to
- + * add \server thus +1 pointer
- + */
- + p = lpNetResource->lpRemoteName + 1;
- + ServerName[0] = L'\\';
- + i = 1;
- + for(;;) {
- + /* convert servername ending unix slash to windows slash */
- + if (p[i] == L'/')
- + p[i] = L'\\';
- + /* deal with servername ending with any slash */
- + if (p[i] == L'\0')
- + p[i] = L'\\';
- + ServerName[i] = p[i];
- + if (p[i] == L'\\') break;
- i++;
- }
- ServerName[i] = L'\0';
- - StringCchCatW( ConnectionName, NFS41_SYS_MAX_PATH_LEN, ServerName);
- + (void)StringCchCatW(ConnectionName,
- + NFS41_SYS_MAX_PATH_LEN, ServerName);
- #ifndef NFS41_DRIVER_MOUNT_DOES_NFS4_PREFIX
- /* insert the "nfs4" in between the server name and the path,
- * just to make sure all calls to our driver come thru this */
- - StringCchCatW( ConnectionName, NFS41_SYS_MAX_PATH_LEN, L"\\nfs4" );
- + (void)StringCchCatW(ConnectionName,
- + NFS41_SYS_MAX_PATH_LEN, L"\\nfs4");
- #endif /* NFS41_DRIVER_MOUNT_DOES_NFS4_PREFIX */
- #ifdef CONVERT_2_UNIX_SLASHES
- /* convert all windows slashes to unix slashes */
- - {
- - PWCHAR q = p;
- - DWORD j = 0;
- - for(;;) {
- - if(q[j] == L'\0') break;
- - if (q[j] == L'\\') q[j] = L'/';
- - j++;
- - }
- - }
- -#else
- - /* convert all unix slashes to windows slashes */
- - {
- - PWCHAR q = p;
- - DWORD j = 0;
- - for(;;) {
- - if(q[j] == L'\0') break;
- - if (q[j] == L'/') q[j] = L'\\';
- - j++;
- + {
- + PWCHAR q = p;
- + DWORD j = 0;
- + for(;;) {
- + if(q[j] == L'\0') break;
- + if (q[j] == L'\\') q[j] = L'/';
- + j++;
- }
- }
- -#endif
- +#else
- + /* convert all unix slashes to windows slashes */
- + {
- + PWCHAR q = p;
- + DWORD j = 0;
- + for(;;) {
- + if(q[j] == L'\0') break;
- + if (q[j] == L'/') q[j] = L'\\';
- + j++;
- + }
- + }
- +#endif /* CONVERT_2_UNIX_SLASHES */
- #if 1
- /*
- @@ -554,15 +578,17 @@ NPAddConnection3(
- #ifdef NFS41_DRIVER_MOUNT_DOES_NFS4_PREFIX
- if (wcsncmp(&p[i], L"\\nfs4", 5) != 0) {
- - DbgP(( L"Connection name '%s' not prefixed with '\\nfs41'\n", &p[i]));
- + DbgP((L"Connection name '%s' not prefixed with '\\nfs41'\n",
- + &p[i]));
- Status = WN_BAD_NETNAME;
- goto out;
- }
- #endif /* NFS41_DRIVER_MOUNT_DOES_NFS4_PREFIX */
- - StringCchCatW( ConnectionName, NFS41_SYS_MAX_PATH_LEN, &p[i]);
- - DbgP(( L"Full Connect Name: '%s'\n", ConnectionName ));
- - DbgP(( L"Full Connect Name Length: %d %d\n",
- + (void)StringCchCatW(ConnectionName,
- + NFS41_SYS_MAX_PATH_LEN, &p[i]);
- + DbgP((L"Full Connect Name: '%s'\n", ConnectionName));
- + DbgP((L"Full Connect Name Length: %d %d\n",
- (wcslen(ConnectionName) + 1) * sizeof(WCHAR),
- (lstrlen(ConnectionName) + 1) * sizeof(WCHAR)));
- @@ -577,341 +603,340 @@ NPAddConnection3(
- goto out;
- }
- - MarshalConnectionInfo(&Connection);
- -
- - Status = SendTo_NFS41Driver( IOCTL_NFS41_ADDCONN,
- + MarshalConnectionInfo(&Connection);
- +
- + Status = SendTo_NFS41Driver(IOCTL_NFS41_ADDCONN,
- Connection.Buffer, Connection.BufferSize,
- - NULL, &CopyBytes );
- + NULL, &CopyBytes);
- DbgP(( L"SendTo_NFS41Driver() returned %d\n", Status));
- if (Status) {
- goto out;
- }
- - DbgP((L"DefineDosDevice(lpNetResource->lpLocalName='%s',ConnectionName='%s')\n", lpNetResource->lpLocalName, ConnectionName));
- - if ( !DefineDosDevice( DDD_RAW_TARGET_PATH |
- - DDD_NO_BROADCAST_SYSTEM,
- - lpNetResource->lpLocalName,
- - ConnectionName ) ) {
- + DbgP((L"DefineDosDevice(lpNetResource->lpLocalName='%s', "
- + L"ConnectionName='%s')\n",
- + lpNetResource->lpLocalName, ConnectionName));
- + if (!DefineDosDevice(DDD_RAW_TARGET_PATH |
- + DDD_NO_BROADCAST_SYSTEM,
- + lpNetResource->lpLocalName,
- + ConnectionName)) {
- Status = GetLastError();
- - DbgP(( L"DefineDosDevice(lpNetResource->lpLocalName='%s',"
- + DbgP((L"DefineDosDevice(lpNetResource->lpLocalName='%s',"
- L"ConnectionName='%s') failed with %d\n",
- lpNetResource->lpLocalName, ConnectionName, Status));
- goto out_delconn;
- }
- - // The connection was established and the local device mapping
- - // added. Include this in the list of mapped devices.
- + // The connection was established and the local device mapping
- + // added. Include this in the list of mapped devices.
- Status = StoreConnectionInfo(LocalName, ConnectionName,
- Connection.Buffer->NameLength, lpNetResource);
- if (Status) {
- - DbgP(( L"StoreConnectionInfo failed with %d\n", Status));
- + DbgP((L"StoreConnectionInfo failed with %d\n", Status));
- goto out_undefine;
- }
- out:
- FreeConnectionInfo(&Connection);
- - DbgP((TEXT("<-- NPAddConnection3 returns %d\n"), (int)Status));
- + DbgP((L"<-- NPAddConnection3 returns %d\n", (int)Status));
- return Status;
- out_undefine:
- - DefineDosDevice(DDD_REMOVE_DEFINITION | DDD_RAW_TARGET_PATH |
- - DDD_EXACT_MATCH_ON_REMOVE, LocalName, ConnectionName);
- -out_delconn:
- - SendTo_NFS41Driver(IOCTL_NFS41_DELCONN, ConnectionName,
- - Connection.Buffer->NameLength, NULL, &CopyBytes);
- - goto out;
- -}
- -
- -DWORD APIENTRY
- -NPCancelConnection(
- - __in LPWSTR lpName,
- - __in BOOL fForce )
- -{
- - DWORD Status = 0;
- -
- + (void)DefineDosDevice(DDD_REMOVE_DEFINITION |
- + DDD_RAW_TARGET_PATH |
- + DDD_EXACT_MATCH_ON_REMOVE,
- + LocalName, ConnectionName);
- +out_delconn:
- + SendTo_NFS41Driver(IOCTL_NFS41_DELCONN, ConnectionName,
- + Connection.Buffer->NameLength, NULL, &CopyBytes);
- + goto out;
- +}
- +
- +DWORD APIENTRY
- +NPCancelConnection(
- + __in LPWSTR lpName,
- + __in BOOL fForce )
- +{
- + DWORD Status = 0;
- +
- HANDLE hMutex, hMemory;
- PNFS41NP_SHARED_MEMORY pSharedMemory;
- - DbgP((TEXT("--> NPCancelConnection(lpName='%s', fForce=%d)\n"),
- + DbgP((L"--> NPCancelConnection(lpName='%s', fForce=%d)\n",
- lpName, (int)fForce));
- - Status = OpenSharedMemory( &hMutex,
- - &hMemory,
- - (PVOID)&pSharedMemory);
- -
- - if (Status == WN_SUCCESS)
- - {
- - INT Index;
- - PNFS41NP_NETRESOURCE pNetResource;
- - Status = WN_NOT_CONNECTED;
- -
- - DbgP((TEXT("NPCancelConnection: NextIndex %d, NumResources %d\n"),
- - pSharedMemory->NextAvailableIndex,
- - pSharedMemory->NumberOfResourcesInUse));
- -
- - for (Index = 0; Index < pSharedMemory->NextAvailableIndex; Index++)
- - {
- - pNetResource = &pSharedMemory->NetResources[Index];
- -
- - if (pNetResource->InUse)
- - {
- - if ( ( (wcslen(lpName) + 1) * sizeof(WCHAR) ==
- - pNetResource->LocalNameLength)
- - && ( !wcscmp(lpName, pNetResource->LocalName) ))
- - {
- - ULONG CopyBytes;
- -
- - DbgP((TEXT("NPCancelConnection: Connection Found:\n")));
- -
- - CopyBytes = 0;
- -
- - Status = SendTo_NFS41Driver( IOCTL_NFS41_DELCONN,
- - pNetResource->ConnectionName,
- - pNetResource->ConnectionNameLength,
- - NULL,
- - &CopyBytes );
- -
- - if (Status != WN_SUCCESS)
- - {
- - DbgP((TEXT("NPCancelConnection: SendToMiniRdr returned Status %lx\n"),Status));
- - break;
- - }
- -
- - if (DefineDosDevice(DDD_REMOVE_DEFINITION | DDD_RAW_TARGET_PATH | DDD_EXACT_MATCH_ON_REMOVE,
- - lpName,
- - pNetResource->ConnectionName) == FALSE)
- - {
- - DbgP((TEXT("RemoveDosDevice: DefineDosDevice error: %d\n"), GetLastError()));
- - Status = GetLastError();
- - }
- - else
- - {
- - pNetResource->InUse = FALSE;
- - pSharedMemory->NumberOfResourcesInUse--;
- -
- - if (Index+1 == pSharedMemory->NextAvailableIndex)
- - pSharedMemory->NextAvailableIndex--;
- - }
- + Status = OpenSharedMemory(&hMutex,
- + &hMemory,
- + (PVOID)&pSharedMemory);
- +
- + if (Status != WN_SUCCESS)
- + goto out;
- +
- + INT Index;
- + PNFS41NP_NETRESOURCE pNetResource;
- + Status = WN_NOT_CONNECTED;
- +
- + DbgP((L"NPCancelConnection: NextIndex %d, NumResources %d\n",
- + pSharedMemory->NextAvailableIndex,
- + pSharedMemory->NumberOfResourcesInUse));
- +
- + for (Index = 0; Index < pSharedMemory->NextAvailableIndex; Index++)
- + {
- + pNetResource = &pSharedMemory->NetResources[Index];
- +
- + if (pNetResource->InUse) {
- + if ((((wcslen(lpName)+1) * sizeof(WCHAR)) ==
- + pNetResource->LocalNameLength) &&
- + (!wcscmp(lpName, pNetResource->LocalName))) {
- + ULONG CopyBytes;
- +
- + DbgP((L"NPCancelConnection: Connection Found:\n"));
- +
- + CopyBytes = 0;
- +
- + Status = SendTo_NFS41Driver( IOCTL_NFS41_DELCONN,
- + pNetResource->ConnectionName,
- + pNetResource->ConnectionNameLength,
- + NULL,
- + &CopyBytes);
- +
- + if (Status != WN_SUCCESS) {
- + DbgP((L"SendToMiniRdr returned Status %lx\n",
- + Status));
- break;
- }
- - DbgP((TEXT("NPCancelConnection: Name '%s' EntryName '%s'\n"),
- - lpName,pNetResource->LocalName));
- - DbgP((TEXT("NPCancelConnection: Name Length %d Entry Name Length %d\n"),
- - pNetResource->LocalNameLength,pNetResource->LocalName));
- -
- - }
- - }
- -
- - CloseSharedMemory( &hMutex,
- - &hMemory,
- - (PVOID)&pSharedMemory);
- + if (DefineDosDevice(DDD_REMOVE_DEFINITION |
- + DDD_RAW_TARGET_PATH | DDD_EXACT_MATCH_ON_REMOVE,
- + lpName,
- + pNetResource->ConnectionName) == FALSE) {
- + DbgP((L"DefineDosDevice error: %d\n",
- + GetLastError()));
- + Status = GetLastError();
- + }
- + else {
- + pNetResource->InUse = FALSE;
- + pSharedMemory->NumberOfResourcesInUse--;
- +
- + if (Index+1 == pSharedMemory->NextAvailableIndex)
- + pSharedMemory->NextAvailableIndex--;
- + }
- + break;
- + }
- +
- + DbgP((L"Name '%s' EntryName '%s'\n",
- + lpName,pNetResource->LocalName));
- + DbgP((L"Name Length %d Entry Name Length %d\n",
- + pNetResource->LocalNameLength,
- + pNetResource->LocalName));
- + }
- }
- - DbgP((TEXT("<-- NPCancelConnection returns %d\n"), (int)Status));
- + CloseSharedMemory(&hMutex,
- + &hMemory,
- + (PVOID)&pSharedMemory);
- +out:
- + DbgP((L"<-- NPCancelConnection returns %d\n", (int)Status));
- return Status;
- }
- -DWORD APIENTRY
- -NPGetConnection(
- - __in LPWSTR lpLocalName,
- - __out_bcount(*lpBufferSize) LPWSTR lpRemoteName,
- - __inout LPDWORD lpBufferSize )
- -{
- - DWORD Status = 0;
- -
- +DWORD APIENTRY
- +NPGetConnection(
- + __in LPWSTR lpLocalName,
- + __out_bcount(*lpBufferSize) LPWSTR lpRemoteName,
- + __inout LPDWORD lpBufferSize )
- +{
- + DWORD Status = 0;
- +
- HANDLE hMutex, hMemory;
- PNFS41NP_SHARED_MEMORY pSharedMemory;
- - DbgP((TEXT("--> NPGetConnection(lpLocalName='%s')\n"), lpLocalName));
- -
- - Status = OpenSharedMemory( &hMutex,
- - &hMemory,
- - (PVOID)&pSharedMemory);
- -
- - if (Status == WN_SUCCESS)
- - {
- - INT Index;
- - PNFS41NP_NETRESOURCE pNetResource;
- - Status = WN_NOT_CONNECTED;
- -
- - for (Index = 0; Index < pSharedMemory->NextAvailableIndex; Index++)
- - {
- - pNetResource = &pSharedMemory->NetResources[Index];
- -
- - if (pNetResource->InUse)
- - {
- - if ( ( (wcslen(lpLocalName) + 1) * sizeof(WCHAR) ==
- - pNetResource->LocalNameLength)
- - && ( !wcscmp(lpLocalName, pNetResource->LocalName) ))
- - {
- - if (*lpBufferSize < pNetResource->RemoteNameLength)
- - {
- - *lpBufferSize = pNetResource->RemoteNameLength;
- - Status = WN_MORE_DATA;
- - }
- - else
- - {
- - *lpBufferSize = pNetResource->RemoteNameLength;
- - CopyMemory( lpRemoteName,
- - pNetResource->RemoteName,
- - pNetResource->RemoteNameLength);
- - Status = WN_SUCCESS;
- - }
- - break;
- - }
- - }
- - }
- -
- - CloseSharedMemory( &hMutex, &hMemory, (PVOID)&pSharedMemory);
- + DbgP((L"--> NPGetConnection(lpLocalName='%s')\n", lpLocalName));
- +
- + Status = OpenSharedMemory(&hMutex,
- + &hMemory,
- + (PVOID)&pSharedMemory);
- + if (Status != WN_SUCCESS)
- + goto out;
- +
- + INT Index;
- + PNFS41NP_NETRESOURCE pNetResource;
- + Status = WN_NOT_CONNECTED;
- +
- + for (Index = 0; Index < pSharedMemory->NextAvailableIndex; Index++)
- + {
- + pNetResource = &pSharedMemory->NetResources[Index];
- +
- + if (pNetResource->InUse) {
- + if ((((wcslen(lpLocalName)+1)*sizeof(WCHAR)) ==
- + pNetResource->LocalNameLength) &&
- + (!wcscmp(lpLocalName, pNetResource->LocalName))) {
- + if (*lpBufferSize < pNetResource->RemoteNameLength) {
- + *lpBufferSize = pNetResource->RemoteNameLength;
- + Status = WN_MORE_DATA;
- + }
- + else {
- + *lpBufferSize = pNetResource->RemoteNameLength;
- + CopyMemory(lpRemoteName,
- + pNetResource->RemoteName,
- + pNetResource->RemoteNameLength);
- + Status = WN_SUCCESS;
- + }
- + break;
- + }
- + }
- }
- - DbgP((TEXT("<-- NPGetConnection returns %d\n"), (int)Status));
- + CloseSharedMemory( &hMutex, &hMemory, (PVOID)&pSharedMemory);
- +out:
- + DbgP((L"<-- NPGetConnection returns %d\n", (int)Status));
- return Status;
- }
- -DWORD APIENTRY
- -NPOpenEnum(
- - DWORD dwScope,
- - DWORD dwType,
- - DWORD dwUsage,
- - LPNETRESOURCE lpNetResource,
- - LPHANDLE lphEnum )
- +DWORD APIENTRY
- +NPOpenEnum(
- + DWORD dwScope,
- + DWORD dwType,
- + DWORD dwUsage,
- + LPNETRESOURCE lpNetResource,
- + LPHANDLE lphEnum)
- {
- - DWORD Status;
- + DWORD Status;
- DbgP((L" --> NPOpenEnum(dwScope=%d, dwType=%d, dwUsage=%d)\n",
- (int)dwScope, (int)dwType, (int)dwUsage));
- *lphEnum = NULL;
- - switch ( dwScope )
- - {
- - case RESOURCE_CONNECTED:
- - {
- - *lphEnum = HeapAlloc( GetProcessHeap( ), HEAP_ZERO_MEMORY, sizeof( ULONG ) );
- -
- - if (*lphEnum )
- - {
- - Status = WN_SUCCESS;
- - }
- - else
- - {
- - Status = WN_OUT_OF_MEMORY;
- - }
- - break;
- - }
- - break;
- -
- - case RESOURCE_CONTEXT:
- - default:
- - Status = WN_NOT_SUPPORTED;
- - break;
- - }
- + switch(dwScope)
- + {
- + case RESOURCE_CONNECTED:
- + {
- + *lphEnum = HeapAlloc(GetProcessHeap(),
- + HEAP_ZERO_MEMORY, sizeof(ULONG));
- + if (*lphEnum ) {
- + Status = WN_SUCCESS;
- + }
- + else {
- + Status = WN_OUT_OF_MEMORY;
- + }
- + break;
- + }
- + break;
- +
- + case RESOURCE_CONTEXT:
- + default:
- + Status = WN_NOT_SUPPORTED;
- + break;
- + }
- - DbgP((L"<-- NPOpenEnum returns %d\n", (int)Status));
- + DbgP((L"<-- NPOpenEnum returns %d, *lphEnum=0x%x\n",
- + (int)Status, HANDLE2INT(*lphEnum)));
- return(Status);
- }
- -
- -DWORD APIENTRY
- -NPEnumResource(
- - HANDLE hEnum,
- - LPDWORD lpcCount,
- - LPVOID lpBuffer,
- - LPDWORD lpBufferSize)
- -{
- - DWORD Status = WN_SUCCESS;
- - ULONG EntriesCopied;
- - LPNETRESOURCE pNetResource;
- - ULONG SpaceNeeded = 0;
- - ULONG SpaceAvailable;
- - PWCHAR StringZone;
- - HANDLE hMutex, hMemory;
- - PNFS41NP_SHARED_MEMORY pSharedMemory;
- +
- +DWORD APIENTRY
- +NPEnumResource(
- + HANDLE hEnum,
- + LPDWORD lpcCount,
- + LPVOID lpBuffer,
- + LPDWORD lpBufferSize)
- +{
- + DWORD Status = WN_SUCCESS;
- + ULONG EntriesCopied;
- + LPNETRESOURCE pNetResource;
- + ULONG SpaceNeeded = 0;
- + ULONG SpaceAvailable;
- + PWCHAR StringZone;
- + HANDLE hMutex, hMemory;
- + PNFS41NP_SHARED_MEMORY pSharedMemory;
- PNFS41NP_NETRESOURCE pNfsNetResource;
- INT Index = *(PULONG)hEnum;
- - DbgP((L"--> NPEnumResource(*lpcCount=%d)\n", (int)*lpcCount));
- + DbgP((L"--> NPEnumResource(hEnum=0x%x, *lpcCount=%d)\n",
- + HANDLE2INT(hEnum), (int)*lpcCount));
- pNetResource = (LPNETRESOURCE) lpBuffer;
- SpaceAvailable = *lpBufferSize;
- EntriesCopied = 0;
- StringZone = (PWCHAR) ((PBYTE)lpBuffer + *lpBufferSize);
- - Status = OpenSharedMemory( &hMutex,
- - &hMemory,
- - (PVOID)&pSharedMemory);
- -
- - if ( Status == WN_SUCCESS)
- + Status = OpenSharedMemory(&hMutex,
- + &hMemory,
- + (PVOID)&pSharedMemory);
- + if (Status != WN_SUCCESS)
- + goto out;
- +
- + Status = WN_NO_MORE_ENTRIES;
- + for (Index = *(PULONG)hEnum; EntriesCopied < *lpcCount &&
- + Index < pSharedMemory->NextAvailableIndex; Index++)
- {
- - Status = WN_NO_MORE_ENTRIES;
- - for (Index = *(PULONG)hEnum; EntriesCopied < *lpcCount &&
- - Index < pSharedMemory->NextAvailableIndex; Index++)
- + pNfsNetResource = &pSharedMemory->NetResources[Index];
- +
- + if (pNfsNetResource->InUse)
- {
- - pNfsNetResource = &pSharedMemory->NetResources[Index];
- -
- - if (pNfsNetResource->InUse)
- - {
- - SpaceNeeded = sizeof( NETRESOURCE );
- - SpaceNeeded += pNfsNetResource->LocalNameLength;
- - SpaceNeeded += pNfsNetResource->RemoteNameLength;
- - SpaceNeeded += 5 * sizeof(WCHAR); // comment
- - SpaceNeeded += sizeof(NFS41_PROVIDER_NAME_U); // provider name
- - if ( SpaceNeeded > SpaceAvailable )
- - {
- - Status = WN_MORE_DATA;
- - DbgP((L"NPEnumResource More Data Needed - %d\n", SpaceNeeded));
- - *lpBufferSize = SpaceNeeded;
- - break;
- - }
- - else
- - {
- - SpaceAvailable -= SpaceNeeded;
- -
- - pNetResource->dwScope = pNfsNetResource->dwScope;
- - pNetResource->dwType = pNfsNetResource->dwType;
- - pNetResource->dwDisplayType = pNfsNetResource->dwDisplayType;
- - pNetResource->dwUsage = pNfsNetResource->dwUsage;
- -
- - // setup string area at opposite end of buffer
- - SpaceNeeded -= sizeof( NETRESOURCE );
- - StringZone = (PWCHAR)( (PBYTE) StringZone - SpaceNeeded );
- - // copy local name
- - StringCchCopy( StringZone,
- - pNfsNetResource->LocalNameLength,
- - pNfsNetResource->LocalName );
- - pNetResource->lpLocalName = StringZone;
- - StringZone += pNfsNetResource->LocalNameLength/sizeof(WCHAR);
- - // copy remote name
- - StringCchCopy( StringZone,
- - pNfsNetResource->RemoteNameLength,
- - pNfsNetResource->RemoteName );
- - pNetResource->lpRemoteName = StringZone;
- - StringZone += pNfsNetResource->RemoteNameLength/sizeof(WCHAR);
- - // copy comment
- - pNetResource->lpComment = StringZone;
- - *StringZone++ = L'A';
- - *StringZone++ = L'_';
- - *StringZone++ = L'O';
- - *StringZone++ = L'K';
- - *StringZone++ = L'\0';
- - // copy provider name
- - pNetResource->lpProvider = StringZone;
- - StringCbCopyW( StringZone, sizeof(NFS41_PROVIDER_NAME_U), NFS41_PROVIDER_NAME_U );
- - StringZone += sizeof(NFS41_PROVIDER_NAME_U)/sizeof(WCHAR);
- - EntriesCopied++;
- - // set new bottom of string zone
- - StringZone = (PWCHAR)( (PBYTE) StringZone - SpaceNeeded );
- - Status = WN_SUCCESS;
- - }
- - pNetResource++;
- - }
- - }
- - CloseSharedMemory( &hMutex, &hMemory, (PVOID*)&pSharedMemory);
- - }
- -
- + SpaceNeeded = sizeof(NETRESOURCE);
- + SpaceNeeded += pNfsNetResource->LocalNameLength;
- + SpaceNeeded += pNfsNetResource->RemoteNameLength;
- + // comment
- + SpaceNeeded += 5 * sizeof(WCHAR);
- + // provider name
- + SpaceNeeded += sizeof(NFS41_PROVIDER_NAME_U);
- + if (SpaceNeeded > SpaceAvailable) {
- + Status = WN_MORE_DATA;
- + DbgP((L"NPEnumResource: "
- + "More Data Needed, SpaceNeeded=%d\n", SpaceNeeded));
- + *lpBufferSize = SpaceNeeded;
- + break;
- + }
- + else {
- + SpaceAvailable -= SpaceNeeded;
- +
- + pNetResource->dwScope = pNfsNetResource->dwScope;
- + pNetResource->dwType = pNfsNetResource->dwType;
- + pNetResource->dwDisplayType = pNfsNetResource->dwDisplayType;
- + pNetResource->dwUsage = pNfsNetResource->dwUsage;
- +
- + // setup string area at opposite end of buffer
- + SpaceNeeded -= sizeof(NETRESOURCE);
- + StringZone = (PWCHAR)( (PBYTE) StringZone - SpaceNeeded);
- + // copy local name
- + (void)StringCchCopy(StringZone,
- + pNfsNetResource->LocalNameLength,
- + pNfsNetResource->LocalName);
- + pNetResource->lpLocalName = StringZone;
- + StringZone += pNfsNetResource->LocalNameLength/sizeof(WCHAR);
- + // copy remote name
- + (void)StringCchCopy(StringZone,
- + pNfsNetResource->RemoteNameLength,
- + pNfsNetResource->RemoteName);
- + pNetResource->lpRemoteName = StringZone;
- + StringZone += pNfsNetResource->RemoteNameLength/sizeof(WCHAR);
- + // copy comment
- + pNetResource->lpComment = StringZone;
- + *StringZone++ = L'A';
- + *StringZone++ = L'_';
- + *StringZone++ = L'O';
- + *StringZone++ = L'K';
- + *StringZone++ = L'\0';
- + // copy provider name
- + pNetResource->lpProvider = StringZone;
- + (void)StringCbCopyW(StringZone,
- + sizeof(NFS41_PROVIDER_NAME_U), NFS41_PROVIDER_NAME_U);
- + StringZone += sizeof(NFS41_PROVIDER_NAME_U)/sizeof(WCHAR);
- + EntriesCopied++;
- + // set new bottom of string zone
- + StringZone = (PWCHAR)((PBYTE)StringZone - SpaceNeeded);
- + Status = WN_SUCCESS;
- + }
- + pNetResource++;
- + }
- + }
- +
- + CloseSharedMemory(&hMutex, &hMemory, (PVOID*)&pSharedMemory);
- +out:
- *lpcCount = EntriesCopied;
- *(PULONG) hEnum = Index;
- @@ -919,45 +944,46 @@ NPEnumResource(
- return Status;
- }
- -
- -DWORD APIENTRY
- +
- +DWORD APIENTRY
- NPCloseEnum(
- - HANDLE hEnum )
- + HANDLE hEnum)
- {
- - DbgP((L"NPCloseEnum\n"));
- - HeapFree( GetProcessHeap( ), 0, (PVOID) hEnum );
- + DbgP((L"NPCloseEnum(handle=0x%x)\n", HANDLE2INT(hEnum)));
- + HeapFree(GetProcessHeap(), 0, (PVOID)hEnum);
- return WN_SUCCESS;
- }
- -
- -DWORD APIENTRY
- -NPGetResourceParent(
- - LPNETRESOURCE lpNetResource,
- +
- +DWORD APIENTRY
- +NPGetResourceParent(
- + LPNETRESOURCE lpNetResource,
- LPVOID lpBuffer,
- LPDWORD lpBufferSize )
- {
- - DbgP(( L"NPGetResourceParent: WN_NOT_SUPPORTED\n" ));
- + DbgP((L"NPGetResourceParent: WN_NOT_SUPPORTED\n"));
- return WN_NOT_SUPPORTED;
- }
- -DWORD APIENTRY
- -NPGetResourceInformation(
- - __in LPNETRESOURCE lpNetResource,
- - __out_bcount(*lpBufferSize) LPVOID lpBuffer,
- +DWORD APIENTRY
- +NPGetResourceInformation(
- + __in LPNETRESOURCE lpNetResource,
- + __out_bcount(*lpBufferSize) LPVOID lpBuffer,
- __inout LPDWORD lpBufferSize,
- __deref_out LPWSTR *lplpSystem )
- {
- - DbgP(( L"NPGetResourceInformation: WN_NOT_SUPPORTED\n" ));
- + DbgP((L"NPGetResourceInformation: WN_NOT_SUPPORTED\n"));
- return WN_NOT_SUPPORTED;
- }
- -DWORD APIENTRY
- -NPGetUniversalName(
- - LPCWSTR lpLocalPath,
- - DWORD dwInfoLevel,
- +DWORD APIENTRY
- +NPGetUniversalName(
- + LPCWSTR lpLocalPath,
- + DWORD dwInfoLevel,
- LPVOID lpBuffer,
- LPDWORD lpBufferSize )
- {
- - DbgP(( L"NPGetUniversalName(lpLocalPath='%s', dwInfoLevel=%d): WN_NOT_SUPPORTED\n",
- + DbgP((L"NPGetUniversalName(lpLocalPath='%s', dwInfoLevel=%d): "
- + "WN_NOT_SUPPORTED\n",
- lpLocalPath, (int)dwInfoLevel));
- return WN_NOT_SUPPORTED;
- }
- --
- 2.45.1
- From c3980b4603028b08837dfc4c3ad78d76032a78e6 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 6 Jun 2024 13:50:43 +0200
- Subject: [PATCH 3/6] tests/winfsinfo1: Fix build warnings
- Fix build warnings
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/winfsinfo1/winfsinfo.c | 16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
- diff --git a/tests/winfsinfo1/winfsinfo.c b/tests/winfsinfo1/winfsinfo.c
- index 9066056..986ebb5 100644
- --- a/tests/winfsinfo1/winfsinfo.c
- +++ b/tests/winfsinfo1/winfsinfo.c
- @@ -51,7 +51,7 @@ bool getvolumeinfo(const char *progname, const char *filename)
- "%s: Error opening file '%s'. Last error was %d.\n",
- progname,
- filename,
- - GetLastError());
- + (int)GetLastError());
- return EXIT_FAILURE;
- }
- @@ -63,7 +63,7 @@ bool getvolumeinfo(const char *progname, const char *filename)
- (void)fprintf(stderr, "%s: GetVolumeInformationByHandleW() "
- "error. GetLastError()==%d.\n",
- progname,
- - GetLastError());
- + (int)GetLastError());
- res = EXIT_FAILURE;
- goto done;
- }
- @@ -148,7 +148,7 @@ bool get_file_basic_info(const char *progname, const char *filename)
- "%s: Error opening file '%s'. Last error was %d.\n",
- progname,
- filename,
- - GetLastError());
- + (int)GetLastError());
- return EXIT_FAILURE;
- }
- @@ -159,7 +159,7 @@ bool get_file_basic_info(const char *progname, const char *filename)
- (void)fprintf(stderr, "%s: GetFileInformationByHandleEx() "
- "error. GetLastError()==%d.\n",
- progname,
- - GetLastError());
- + (int)GetLastError());
- res = EXIT_FAILURE;
- goto done;
- }
- @@ -237,7 +237,7 @@ bool get_file_standard_info(const char *progname, const char *filename)
- "%s: Error opening file '%s'. Last error was %d.\n",
- progname,
- filename,
- - GetLastError());
- + (int)GetLastError());
- return EXIT_FAILURE;
- }
- @@ -248,7 +248,7 @@ bool get_file_standard_info(const char *progname, const char *filename)
- (void)fprintf(stderr, "%s: GetFileInformationByHandleEx() "
- "error. GetLastError()==%d.\n",
- progname,
- - GetLastError());
- + (int)GetLastError());
- res = EXIT_FAILURE;
- goto done;
- }
- @@ -295,7 +295,7 @@ bool get_filenormalizednameinfo(const char *progname, const char *filename)
- "%s: Error opening file '%s'. Last error was %d.\n",
- progname,
- filename,
- - GetLastError());
- + (int)GetLastError());
- return EXIT_FAILURE;
- }
- @@ -315,7 +315,7 @@ bool get_filenormalizednameinfo(const char *progname, const char *filename)
- (void)fprintf(stderr, "%s: GetFileInformationByHandleEx() "
- "error. GetLastError()==%d.\n",
- progname,
- - GetLastError());
- + (int)GetLastError());
- res = EXIT_FAILURE;
- goto done;
- }
- --
- 2.45.1
- From c97e3264e38ee0e66e033f9570e697c76db73fe7 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 6 Jun 2024 13:55:20 +0200
- Subject: [PATCH 4/6] tests/winfsinfo1: Fix comment about Cygwin-vs-MinGW bug
- Fix comment about Cygwin-vs-MinGW bug, the issue is in the
- MinGW headers, not in Cygwin itself
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/winfsinfo1/winfsinfo.c | 11 +++++++----
- 1 file changed, 7 insertions(+), 4 deletions(-)
- diff --git a/tests/winfsinfo1/winfsinfo.c b/tests/winfsinfo1/winfsinfo.c
- index 986ebb5..99bcc2f 100644
- --- a/tests/winfsinfo1/winfsinfo.c
- +++ b/tests/winfsinfo1/winfsinfo.c
- @@ -300,12 +300,15 @@ bool get_filenormalizednameinfo(const char *progname, const char *filename)
- }
- /*
- - * |FileNormalizedNameInfo| value:
- + * MinGW header bug: Wrong |FileNormalizedNameInfo| value
- * Per
- * https://learn.microsoft.com/en-us/windows/win32/api/minwinbase/ne-minwinbase-file_info_by_handle_class
- - * |FileNormalizedNameInfo| should be |24|, but on Cygwin 3.6 we
- - * get the value |48|. Since |24| works and |48| returns an
- - * "Invalid Parameter" error we assume this is a Cygwin bug.
- + * |FileNormalizedNameInfo| should be |24|, but with older MinGW
- + * headers we get the value |48|.
- + * This has been reported as
- + * https://github.com/mingw-w64/mingw-w64/issues/48 ("Integer
- + * value of |FileNormalizedNameInfo| shifts with Windows
- + * version")
- */
- ok = GetFileInformationByHandleEx(fileHandle,
- 24/*FileNormalizedNameInfo*/,
- --
- 2.45.1
- From 73dd9921ef3c96b10ce1b8141bc9f98acf34c313 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 6 Jun 2024 14:24:41 +0200
- Subject: [PATCH 5/6] cygwin: Install instructions in README.bintarball.txt do
- not work from cmd.exe
- Fix install instructions in README.bintarball.txt, Windows
- cmd.exe will pass 'foo' as 'foo' to curl instead of foo,
- and the mirrors.kernel.org URL is wrong.
- Reported-by: Martin Wege <martin.l.wege@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/README.bintarball.txt | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
- diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
- index 9865131..8599d8f 100644
- --- a/cygwin/README.bintarball.txt
- +++ b/cygwin/README.bintarball.txt
- @@ -135,9 +135,9 @@ echo %PROCESSOR_ARCHITECTURE%
- # Install Cygwin 64bit on Windows 64bit with packages required by "ms-nfs41-client"
- # (Windows NFSv4.1 client):
- # 1. Get installer from https://cygwin.com/setup-x86_64.exe
- -curl --remote-name 'https://www.cygwin.com/setup-x86_64.exe'
- +curl --remote-name "https://www.cygwin.com/setup-x86_64.exe"
- # 2. Run installer with these arguments:
- -setup-x86_64.exe -q --site https://mirrors.kernel.org -P cygwin,cygwin-devel,cygrunsrv,cygutils,cygutils-extra,bash,bzip2,coreutils,getent,gdb,grep,hostname,less,libiconv,libiconv2,pax,pbzip2,procps-ng,sed,tar,time,util-linux,wget,libnfs,make,git,dos2unix,unzip
- +setup-x86_64.exe -q --site "https://mirrors.kernel.org/sourceware/cygwin" -P cygwin,cygwin-devel,cygrunsrv,cygutils,cygutils-extra,bash,bzip2,coreutils,getent,gdb,grep,hostname,less,libiconv,libiconv2,pax,pbzip2,procps-ng,sed,tar,time,util-linux,wget,libnfs,make,git,dos2unix,unzip
- - Cygwin 32bit can be installed like this:
- @@ -145,9 +145,9 @@ setup-x86_64.exe -q --site https://mirrors.kernel.org -P cygwin,cygwin-devel,cyg
- # Install Cygwin 32bit on Windows 32bit with packages required by "ms-nfs41-client"
- # (Windows NFSv4.1 client):
- # 1. Get installer from https://www.cygwin.com/setup-x86.exe
- -curl --remote-name 'https://www.cygwin.com/setup-x86.exe'
- +curl --remote-name "https://www.cygwin.com/setup-x86.exe"
- # 2. Run installer with these arguments:
- -setup-x86.exe --allow-unsupported-windows -q --no-verify --site http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/2022/11/23/063457 -P cygwin,cygwin-devel,cygrunsrv,cygutils,cygutils-extra,bash,bzip2,coreutils,getent,gdb,grep,hostname,less,libiconv,libiconv2,pax,pbzip2,procps-ng,sed,tar,time,util-linux,wget,libnfs,make,git,dos2unix,unzip
- +setup-x86.exe --allow-unsupported-windows -q --no-verify --site "http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/2022/11/23/063457" -P cygwin,cygwin-devel,cygrunsrv,cygutils,cygutils-extra,bash,bzip2,coreutils,getent,gdb,grep,hostname,less,libiconv,libiconv2,pax,pbzip2,procps-ng,sed,tar,time,util-linux,wget,libnfs,make,git,dos2unix,unzip
- ---- snip ----
- --
- 2.45.1
- From e2d81bd2682e52e4859129bac213826181ba974c Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 6 Jun 2024 14:29:44 +0200
- Subject: [PATCH 6/6] cygwin: Fix libnfs-utils package name
- README.bintarball.txt
- Fix libnfs-utils package name README.bintarball.txt,
- s/libnfs/libnfs-utils/
- Reported-by: Martin Wege <martin.l.wege@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/README.bintarball.txt | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
- diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
- index 8599d8f..81e8ab3 100644
- --- a/cygwin/README.bintarball.txt
- +++ b/cygwin/README.bintarball.txt
- @@ -107,7 +107,7 @@ NFSv4.1 client and filesystem driver for Windows 10/11
- util-linux
- wget
- - Packages (recommended):
- - libnfs (for /usr/bin/nfs-ls)
- + libnfs-utils (for /usr/bin/nfs-ls)
- make
- git
- gcc-core
- @@ -137,7 +137,7 @@ echo %PROCESSOR_ARCHITECTURE%
- # 1. Get installer from https://cygwin.com/setup-x86_64.exe
- curl --remote-name "https://www.cygwin.com/setup-x86_64.exe"
- # 2. Run installer with these arguments:
- -setup-x86_64.exe -q --site "https://mirrors.kernel.org/sourceware/cygwin" -P cygwin,cygwin-devel,cygrunsrv,cygutils,cygutils-extra,bash,bzip2,coreutils,getent,gdb,grep,hostname,less,libiconv,libiconv2,pax,pbzip2,procps-ng,sed,tar,time,util-linux,wget,libnfs,make,git,dos2unix,unzip
- +setup-x86_64.exe -q --site "https://mirrors.kernel.org/sourceware/cygwin" -P cygwin,cygwin-devel,cygrunsrv,cygutils,cygutils-extra,bash,bzip2,coreutils,getent,gdb,grep,hostname,less,libiconv,libiconv2,pax,pbzip2,procps-ng,sed,tar,time,util-linux,wget,libnfs-utils,make,git,dos2unix,unzip
- - Cygwin 32bit can be installed like this:
- @@ -147,7 +147,7 @@ setup-x86_64.exe -q --site "https://mirrors.kernel.org/sourceware/cygwin" -P cyg
- # 1. Get installer from https://www.cygwin.com/setup-x86.exe
- curl --remote-name "https://www.cygwin.com/setup-x86.exe"
- # 2. Run installer with these arguments:
- -setup-x86.exe --allow-unsupported-windows -q --no-verify --site "http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/2022/11/23/063457" -P cygwin,cygwin-devel,cygrunsrv,cygutils,cygutils-extra,bash,bzip2,coreutils,getent,gdb,grep,hostname,less,libiconv,libiconv2,pax,pbzip2,procps-ng,sed,tar,time,util-linux,wget,libnfs,make,git,dos2unix,unzip
- +setup-x86.exe --allow-unsupported-windows -q --no-verify --site "http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/2022/11/23/063457" -P cygwin,cygwin-devel,cygrunsrv,cygutils,cygutils-extra,bash,bzip2,coreutils,getent,gdb,grep,hostname,less,libiconv,libiconv2,pax,pbzip2,procps-ng,sed,tar,time,util-linux,wget,libnfs-utils,make,git,dos2unix,unzip
- ---- snip ----
- --
- 2.45.1
msnf41client: nfs41_np fixes&cleanup, docs update+misc, 2024-06-06
Posted by Anonymous on Thu 6th Jun 2024 15:15
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.