- From efc27b293a1f9c2f86f6f013f312e9e243c5d8aa Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 29 Nov 2024 18:15:10 +0100
- Subject: [PATCH 1/8] cygwin: Add "build64", "installdest64" and "bintarball64"
- for 64bit-only builds
- Add "build64", "installdest64" and "bintarball64" for 64bit-only builds
- to support Visual Studio 2022, which no longer supports building
- for 32bit kernels.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/Makefile | 60 ++++++++++++++++++++++++---------
- cygwin/Makefile.install | 7 ++++
- cygwin/README.txt | 37 +++++++++++++++++---
- cygwin/devel/msnfs41client.bash | 2 +-
- 4 files changed, 85 insertions(+), 21 deletions(-)
- diff --git a/cygwin/Makefile b/cygwin/Makefile
- index 43813de..5993c1a 100644
- --- a/cygwin/Makefile
- +++ b/cygwin/Makefile
- @@ -18,20 +18,6 @@ VS_BUILD_DIR64:=$(PROJECT_BASEDIR_DIR)/build.vc19/x64/Debug/
- #VS_BUILD_DIR32:=$(PROJECT_BASEDIR_DIR)/build.vc19/Release/
- #VS_BUILD_DIR64:=$(PROJECT_BASEDIR_DIR)/build.vc19/x64/Release/
- -# trigger "build" target when these binaries are needed
- -$(VS_BUILD_DIR32)/nfsd.exe \
- - $(VS_BUILD_DIR32)/nfs_mount.exe \
- - $(VS_BUILD_DIR32)/nfs_install.exe \
- - $(VS_BUILD_DIR32)/nfs41_driver.sys \
- - $(VS_BUILD_DIR32)/libtirpc.dll \
- - $(VS_BUILD_DIR32)/nfs41_np.dll \
- - $(VS_BUILD_DIR64)/nfsd.exe \
- - $(VS_BUILD_DIR64)/nfs_mount.exe \
- - $(VS_BUILD_DIR64)/nfs_install.exe \
- - $(VS_BUILD_DIR64)/nfs41_driver.sys \
- - $(VS_BUILD_DIR64)/libtirpc.dll \
- - $(VS_BUILD_DIR64)/nfs41_np.dll: build
- -
- # trigger "build_testutils" target when these binaries are needed
- $(PROJECT_BASEDIR_DIR)/tests/ea/nfs_ea.exe \
- $(PROJECT_BASEDIR_DIR)/tests/winfsinfo1/winfsinfo.exe \
- @@ -60,6 +46,16 @@ build_32bit_debug:
- which MSBuild.exe
- MSBuild.exe '$(shell cygpath -w "$(PROJECT_BASEDIR_DIR)/build.vc19/nfs41-client.sln")' -t:Build -p:Configuration=Debug -p:Platform=x86
- +build_32bit_release_clientutils:
- + @printf '#\n# PATH is %q\n#\n' '$(PATH)'
- + which MSBuild.exe
- + MSBuild.exe '$(shell cygpath -w "$(PROJECT_BASEDIR_DIR)/build.vc19/nfs41-client.sln")' -t:nfs41_np,nfs_mount -p:Configuration=Release -p:Platform=x86
- +
- +build_32bit_debug_clientutils:
- + @printf '#\n# PATH is %q\n#\n' '$(PATH)'
- + which MSBuild.exe
- + MSBuild.exe '$(shell cygpath -w "$(PROJECT_BASEDIR_DIR)/build.vc19/nfs41-client.sln")' -t:nfs41_np,nfs_mount -p:Configuration=Debug -p:Platform=x86
- +
- build_arm_64bit_debug:
- @printf '#\n# PATH is %q\n#\n' '$(PATH)'
- which MSBuild.exe
- @@ -73,6 +69,19 @@ build_testutils:
- build: build_32bit_release build_32bit_debug build_64bit_release build_64bit_debug build_arm_64bit_debug build_testutils
- sync
- +# 64bit kernel only build, for Visual Studio 2022 build
- +# - VS2022 no longe supports building 32bit kernel modules
- +# - we need 32bit nfs_mount.exe for testing
- +# - we need 32bit nfs41_np.dll to support 32bit applications on 64bit machines
- +# - BUG: ARM64 build not working yet
- +build64: \
- + build_32bit_release_clientutils \
- + build_32bit_debug_clientutils \
- + build_64bit_release \
- + build_64bit_debug \
- + build_testutils
- + sync
- +
- #
- # clean target
- #
- @@ -146,7 +155,28 @@ bintarball: installdest
- -e "s/\\$$\{bintarball.base_filename\}/$${base_filename}/g" \
- -e "s/\\$$\{bintarball.archive_sha256hash\}/$${archive_sha256hash}/g" >"$${base_filename}.readme" \
- ) ; \
- - printf "\n#\n# tarball is ready now\n#\n" ; \
- + printf "\n#\n# 32bit+64bit tarball is ready now\n#\n" ; \
- + ls -l "$(DESTDIR)/$${base_filename}.tar.bz2" ; \
- + ls -l "$(DESTDIR)/$${base_filename}.readme"
- + sync
- +
- +bintarball64: installdest64
- + set -o errexit ; set -o xtrace ; \
- + base_filename="msnfs41client_cygwin_binaries_$$(date +%Y%m%d_%Hh%Mm)_git$$(git rev-parse --short HEAD)" ; \
- + ( \
- + cd "$(DESTDIR)" && \
- + tar -cvf - \
- + --owner=SYSTEM:18 \
- + --group=SYSTEM:18 \
- + cygdrive/c/cygwin64 \
- + | \
- + bzip2 -9 >"$${base_filename}.tar.bz2" ; \
- + archive_sha256hash="$$(openssl sha256 -r "$${base_filename}.tar.bz2" | while read a dummy ; do printf "%s\n" "$$a" ; done)" ; \
- + sed -E <"../cygwin/README.bintarball.txt" \
- + -e "s/\\$$\{bintarball.base_filename\}/$${base_filename}/g" \
- + -e "s/\\$$\{bintarball.archive_sha256hash\}/$${archive_sha256hash}/g" >"$${base_filename}.readme" \
- + ) ; \
- + printf "\n#\n# 64bit-only tarball is ready now\n#\n" ; \
- ls -l "$(DESTDIR)/$${base_filename}.tar.bz2" ; \
- ls -l "$(DESTDIR)/$${base_filename}.readme"
- sync
- diff --git a/cygwin/Makefile.install b/cygwin/Makefile.install
- index b973635..1ec9884 100644
- --- a/cygwin/Makefile.install
- +++ b/cygwin/Makefile.install
- @@ -51,6 +51,13 @@ installdest:
- cp $(VS_BUILD_DIR)/nfs_install.* $(DESTDIR)/$(CYGWIN_BASEPATH)/sbin/.
- cp $(VS_BUILD_DIR)/libtirpc.* $(DESTDIR)/$(CYGWIN_BASEPATH)/sbin/.
- cp $(VS_BUILD_DIR)/nfs41_np.* $(DESTDIR)/$(CYGWIN_BASEPATH)/lib/msnfs41client/.
- + if [[ "$(CYGWIN_BASEPATH)" == *64* ]] ; then \
- + mkdir -p -- $(DESTDIR)/$(CYGWIN_BASEPATH)/lib/msnfs41client/i686 ; \
- + cp $(VS_BUILD_DIR32)/../Release/nfs41_np.dll $(DESTDIR)/$(CYGWIN_BASEPATH)/lib/msnfs41client/i686/nfs41_np.dll ; \
- + cp $(VS_BUILD_DIR32)/../Release/nfs41_np.exp $(DESTDIR)/$(CYGWIN_BASEPATH)/lib/msnfs41client/i686/nfs41_np.exp ; \
- + cp $(VS_BUILD_DIR32)/../Release/nfs41_np.lib $(DESTDIR)/$(CYGWIN_BASEPATH)/lib/msnfs41client/i686/nfs41_np.lib ; \
- + cp $(VS_BUILD_DIR32)/../Release/nfs41_np.pdb $(DESTDIR)/$(CYGWIN_BASEPATH)/lib/msnfs41client/i686/nfs41_np.pdb ; \
- + fi
- cp $(VS_BUILD_DIR)/nfs41_driver.* $(DESTDIR)/$(CYGWIN_BASEPATH)/lib/msnfs41client/.
- cp $(PROJECT_BASEDIR_DIR)/nfs41rdr.inf $(DESTDIR)/$(CYGWIN_BASEPATH)/lib/msnfs41client/.
- cp $(PROJECT_BASEDIR_DIR)/etc_netconfig $(DESTDIR)/$(CYGWIN_BASEPATH)/lib/msnfs41client/.
- diff --git a/cygwin/README.txt b/cygwin/README.txt
- index 24f3342..ffce8ad 100644
- --- a/cygwin/README.txt
- +++ b/cygwin/README.txt
- @@ -6,8 +6,8 @@
- ######## Building ms-nfs41-client using Cygwin+Makefile:
- ** Required software:
- -- Visual Studio 19
- - Start Visual Studio 19 installer and import the installer
- +* Windows 10 with Visual Studio 2019
- +- Start Visual Studio 19 installer and import the installer
- config file "ms-nfs41-client/build.vc19/ms-nfs41-client.vsconfig",
- and then install Visual Studio.
- (Note that due to a bug in the VS installer it is sometimes
- @@ -19,15 +19,42 @@
- (see "ms-nfs41-clientcygwin/README.bintarball.txt" for Cygwin 32bit
- and 64bit installation instructions)
- -** Build the project using VS19/VS22+Cygwin command line (bash/ksh93):
- +* Windows 10/11 with Visual Studio 2022
- +- Start Visual Studio 2022 installer and import the installer
- + config file "ms-nfs41-client/build.vc19/ms-nfs41-client.vsconfig",
- + and then install Visual Studio.
- + (Note that due to a bug in the VS installer it is sometimes
- + required to manually add another (random) component to be installed,
- + otherwise the imported config might be ignored)
- +- WDK for Windows 11, version 1591, from
- + https://go.microsoft.com/fwlink/?linkid=2286137
- +- Cygwin 64bit >= 3.5.0
- + (see "ms-nfs41-clientcygwin/README.bintarball.txt" for Cygwin 32bit
- + and 64bit installation instructions)
- +
- +
- +** Build the project
- +* using Visual Studio 2019+Cygwin command line (bash/ksh93):
- +# this creates a 32bit+kernel+64bit-kernel build for Windows 10+11
- export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/:$PATH"
- -# VS22 use: $ export PATH="/cygdrive/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/:$PATH"
- git clone https://github.com/kofemann/ms-nfs41-client.git
- cd ms-nfs41-client
- cd cygwin
- +make build
- make installdest
- +make bintarball
- +
- +* using Visual Studio 2022+Cygwin command line (bash/ksh93):
- +# this creates a 64bit-kernel only build for Windows 11
- +export PATH="/cygdrive/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/:$PATH"
- +git clone https://github.com/kofemann/ms-nfs41-client.git
- +cd ms-nfs41-client
- +cd cygwin
- +make build64
- +make installdest64
- +make bintarball64
- -# Note that $ make installdest # can fail on SMB/NFSv4.1 filesystems
- +# Note that $ make installdest #/$ make installdest64 # can fail on SMB/NFSv4.1 filesystems
- # with a "link.exe" crash.
- # Workaround is to disable incremental linking before building, e.g. do
- # ---- snip ----
- diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
- index 739ab30..4337a02 100755
- --- a/cygwin/devel/msnfs41client.bash
- +++ b/cygwin/devel/msnfs41client.bash
- @@ -314,7 +314,7 @@ function nfsclient_adddriver
- #
- if is_windows_64bit ; then
- # copy from the 32bit install dir
- - cp '../../../../../cygdrive/c/cygwin/lib/msnfs41client/nfs41_np.dll' '/cygdrive/c/Windows/SysWOW64/'
- + cp './i686/nfs41_np.dll' '/cygdrive/c/Windows/SysWOW64/'
- fi
- return 0
- --
- 2.45.1
- From 15c0e33c6f14883c3d46176dc37da4d6912ea17b Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 2 Dec 2024 14:25:50 +0100
- Subject: [PATCH 2/8] dll: Implement nfs41_np |NPGetConnection3()|
- Implement nfs41_np |NPGetConnection3()|
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- dll/nfs41_np.c | 50 +++++++++++++++++++++++++++++++++++++++++++++-----
- 1 file changed, 45 insertions(+), 5 deletions(-)
- diff --git a/dll/nfs41_np.c b/dll/nfs41_np.c
- index fb25f5c..5e81099 100644
- --- a/dll/nfs41_np.c
- +++ b/dll/nfs41_np.c
- @@ -1011,19 +1011,50 @@ out:
- DWORD APIENTRY
- NPGetConnection(
- - __in LPWSTR lpLocalName,
- + __in LPWSTR lpLocalName,
- __out_bcount(*lpBufferSize) LPWSTR lpRemoteName,
- - __inout LPDWORD lpBufferSize )
- + __inout LPDWORD lpBufferSize)
- {
- - DWORD Status = 0;
- + DWORD Status = 0;
- + DbgP((L"--> NPGetConnection(lpLocalName='%s')\n",
- + lpLocalName));
- + Status = NPGetConnection3(lpLocalName,
- + WNGETCON_CONNECTED, lpRemoteName, lpBufferSize);
- + if (Status == WN_SUCCESS) {
- + DbgP((L"<-- NPGetConnection(lpRemoteName='%.*s',*lpBufferSize=%d) returns %d\n",
- + (int)*lpBufferSize,
- + lpRemoteName,
- + (int)*lpBufferSize,
- + (int)Status));
- + }
- + else {
- + DbgP((L"<-- NPGetConnection() returns %d\n", (int)Status));
- + }
- + return Status;
- +}
- +
- +DWORD APIENTRY
- +NPGetConnection3(
- + __in LPCWSTR lpLocalName,
- + __in DWORD dwLevel,
- + __out_bcount(*lpBufferSize) LPWSTR lpRemoteName,
- + __inout LPDWORD lpBufferSize)
- +{
- + DWORD Status = 0;
- HANDLE hMutex, hMemory;
- PNFS41NP_SHARED_MEMORY pSharedMemory;
- #ifdef NFS41_DRIVER_USE_AUTHENTICATIONID_FOR_MOUNT_NAMESPACE
- LUID authenticationid = { .LowPart = 0, .HighPart = 0L };
- #endif /* NFS41_DRIVER_USE_AUTHENTICATIONID_FOR_MOUNT_NAMESPACE */
- - DbgP((L"--> NPGetConnection(lpLocalName='%s')\n", lpLocalName));
- + DbgP((L"--> NPGetConnection3(lpLocalName='%s',dwLevel=%d)\n",
- + lpLocalName, (int)dwLevel));
- +
- + if (dwLevel != WNGETCON_CONNECTED) {
- + Status = WN_SUCCESS;
- + goto out;
- + }
- if (lpLocalName == NULL) {
- lpLocalName = NFS41NP_LOCALNAME_UNC_MARKER;
- @@ -1108,7 +1139,16 @@ NPGetConnection(
- CloseSharedMemory( &hMutex, &hMemory, (PVOID)&pSharedMemory);
- out:
- - DbgP((L"<-- NPGetConnection returns %d\n", (int)Status));
- + if (Status == WN_SUCCESS) {
- + DbgP((L"<-- NPGetConnection3(lpRemoteName='%.*s',*lpBufferSize=%d) returns %d\n",
- + (int)*lpBufferSize,
- + lpRemoteName,
- + (int)*lpBufferSize,
- + (int)Status));
- + }
- + else {
- + DbgP((L"<-- NPGetConnection3() returns %d\n", (int)Status));
- + }
- return Status;
- }
- --
- 2.45.1
- From 5b65e678622c7af502532cf743826d851a833aa7 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 2 Dec 2024 16:08:39 +0100
- Subject: [PATCH 3/8] mount: Fix broken DOS device autoselction (nfs_mount '*'
- ...)
- Fix broken DOS device autoselction (e.g. $ nfs_mount -o rw '*' ... #)
- Reported-by: Takeshi Nishimura <takeshi.nishimura.linux@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- mount/mount.c | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
- diff --git a/mount/mount.c b/mount/mount.c
- index 388bfa9..cec8e35 100644
- --- a/mount/mount.c
- +++ b/mount/mount.c
- @@ -1053,7 +1053,13 @@ static DWORD DoMount(
- NetResource.dwType = RESOURCETYPE_DISK;
- if (pLocalName) {
- /* drive letter is chosen automatically if lpLocalName == "*" */
- - NetResource.lpLocalName = *pLocalName == L'*' ? NULL : pLocalName;
- + if (*pLocalName == L'*') {
- + NetResource.lpLocalName = NULL;
- + Flags |= CONNECT_REDIRECT;
- + }
- + else {
- + NetResource.lpLocalName = pLocalName;
- + }
- }
- else {
- NetResource.lpLocalName = NULL;
- --
- 2.45.1
- From f24dbd34bcd56c14a1034e89ddd7767a028984f6 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 2 Dec 2024 16:31:47 +0100
- Subject: [PATCH 4/8] mount: Unrecognized options+arguments should be fatal
- Unrecognized options+arguments should be fatal, otherwise
- admins can get unwanted surprises.
- Reported-by: Takeshi Nishimura <takeshi.nishimura.linux@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- mount/mount.c | 15 ++++++++++-----
- 1 file changed, 10 insertions(+), 5 deletions(-)
- diff --git a/mount/mount.c b/mount/mount.c
- index cec8e35..c9e0464 100644
- --- a/mount/mount.c
- +++ b/mount/mount.c
- @@ -373,10 +373,13 @@ opt_o_argv_i_again:
- goto out_free;
- }
- }
- - else
- - (void)fwprintf(stderr, L"Unrecognized option "
- - L"'%s', disregarding.\n",
- + else {
- + (void)fwprintf(stderr,
- + L"Unrecognized option '%s'\n",
- argv[i]);
- + result = 1;
- + goto out;
- + }
- }
- /* Windows-style "nfs_mount /?" help */
- else if (!wcscmp(argv[i], L"/?")) {
- @@ -394,9 +397,11 @@ opt_o_argv_i_again:
- pRemoteName = argv[i];
- }
- else {
- - (void)fwprintf(stderr, L"Unrecognized argument "
- - L"'%s', disregarding.\n",
- + (void)fwprintf(stderr,
- + L"Unrecognized argument '%s'.\n",
- argv[i]);
- + result = 1;
- + goto out;
- }
- }
- --
- 2.45.1
- From dca1c641cced6461ca3a6111aba6958f734b5f5b Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 2 Dec 2024 16:35:24 +0100
- Subject: [PATCH 5/8] mount: Fix copy&paste&clipboard mistake added with commit
- #6981ffb29ed771c0a7120d587f0342bc74400bda
- Fix copy&paste&clipboard mistake added with commit
- paste)
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- mount/mount.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
- diff --git a/mount/mount.c b/mount/mount.c
- index c9e0464..0b5f313 100644
- --- a/mount/mount.c
- +++ b/mount/mount.c
- @@ -368,7 +368,7 @@ opt_o_argv_i_again:
- if (!wcscmp(argv[i], L"nfs")) {
- result = ERROR_BAD_ARGUMENTS;
- (void)fwprintf(stderr, L"Filesystem type '%s' "
- - L"not supported.\n\n./build.vc19/x64/Debug/nfs_mount.exe", argv[i]);
- + L"not supported.\n\n.", argv[i]);
- PrintMountUsage(argv[0]);
- goto out_free;
- }
- --
- 2.45.1
- From df1880f412ccc0297c2d9e3990c0727bf6223fdc Mon Sep 17 00:00:00 2001
- From: Dan Shelton <dan.f.shelton@gmail.com>
- Date: Mon, 2 Dec 2024 17:00:50 +0100
- Subject: [PATCH 6/8] daemon,sys: Fix printf fmt '%*s' to '%.*s'
- Fix printf fmt '%*s' to '%.*s', otherwise - depending on
- printf implementation - we can get space padding characters.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/acl.c | 4 ++--
- daemon/setattr.c | 4 ++--
- sys/nfs41sys_mount.c | 2 +-
- 3 files changed, 5 insertions(+), 5 deletions(-)
- diff --git a/daemon/acl.c b/daemon/acl.c
- index 27e04f2..159ad1f 100644
- --- a/daemon/acl.c
- +++ b/daemon/acl.c
- @@ -1114,13 +1114,13 @@ add_domain:
- (!strncmp(who_out, "Administrators@", who_size+1))) {
- domain = "BUILTIN";
- DPRINTF(1,
- - ("map_sid2nfs4ace_who: Fixup '%*s' domain='%s'\n",
- + ("map_sid2nfs4ace_who: Fixup '%.*s' domain='%s'\n",
- (int)who_size+1, who_out, domain));
- }
- else if (!strncmp(who_out, "SYSTEM@", who_size+1)) {
- domain = "NT AUTHORITY";
- DPRINTF(1,
- - ("map_sid2nfs4ace_who: Fixup '%*s' domain='%s'\n",
- + ("map_sid2nfs4ace_who: Fixup '%.*s' domain='%s'\n",
- (int)who_size+1, who_out, domain));
- }
- #endif /* NFS41_DRIVER_WS2022_HACKS */
- diff --git a/daemon/setattr.c b/daemon/setattr.c
- index 84efb70..79709da 100644
- --- a/daemon/setattr.c
- +++ b/daemon/setattr.c
- @@ -352,7 +352,7 @@ static int handle_nfs41_rename(void *daemon_context, setattr_upcall_args *args)
- if (dst_path.len == 0) {
- eprintf("handle_nfs41_rename(args->path='%s'): "
- "WideCharToMultiByte() failed to convert destination "
- - "filename '%*S', lasterr=%d.\n",
- + "filename '%.*S', lasterr=%d.\n",
- args->path,
- (int)(rename->FileNameLength/sizeof(WCHAR)),
- rename->FileName,
- @@ -511,7 +511,7 @@ static int handle_nfs41_link(void *daemon_context, setattr_upcall_args *args)
- if (dst_path.len == 0) {
- eprintf("handle_nfs41_link(args->path='%s'): "
- "WideCharToMultiByte() failed to convert destination "
- - "filename '%*S', lasterr=%d.\n",
- + "filename '%.*S', lasterr=%d.\n",
- args->path,
- (int)(link->FileNameLength/sizeof(WCHAR)),
- link->FileName, (int)GetLastError());
- diff --git a/sys/nfs41sys_mount.c b/sys/nfs41sys_mount.c
- index 37b7f0c..8cc45f4 100644
- --- a/sys/nfs41sys_mount.c
- +++ b/sys/nfs41sys_mount.c
- @@ -427,7 +427,7 @@ NTSTATUS nfs41_MountConfig_ParseOptions(
- Name = (LPWSTR)Option->EaName;
- NameLen = Option->EaNameLength/sizeof(WCHAR);
- - DbgP("nfs41_MountConfig_ParseOptions: Name='%*S'/NameLen=%d\n",
- + DbgP("nfs41_MountConfig_ParseOptions: Name='%.*S'/NameLen=%d\n",
- (int)NameLen, Name, (int)NameLen);
- usValue.Length = usValue.MaximumLength = Option->EaValueLength;
- --
- 2.45.1
- From b80472c735c24c185c1a95c52c132dfe4c07b6c4 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 2 Dec 2024 17:13:05 +0100
- Subject: [PATCH 7/8] cygwin: Fix s/driver letter/drive letter/
- Fix s/driver letter/drive letter/
- Reported-by: Takeshi Nishimura <takeshi.nishimura.linux@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/README.bintarball.txt | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
- diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
- index f335787..0afaecc 100644
- --- a/cygwin/README.bintarball.txt
- +++ b/cygwin/README.bintarball.txt
- @@ -43,14 +43,14 @@ NFSv4.1 filesystem driver for Windows 10/11&Windows Server 2019
- characters in the mount path, independent of current locale.
- - UNC paths
- - - Mounting UNC paths without DOS driver letterpacman -S --noconfirm
- + - Mounting UNC paths without DOS drive letter
- - IPv6 support in UNC paths
- - /sbin/nfs_mount prints UNC paths in Win32+Cygwin/MSYS2 formats
- - Cygwin/MSYS2 bash+ksh93 support UNC paths, e.g.
- cd //derfwnb4966@2049/nfs4/bigdisk/mysqldb4/
- - WSL support
- - - Mount Windows NFSv4.1 shares via driver letter or UNC path
- + - Mount Windows NFSv4.1 shares via drive letter or UNC path
- in WSL via mount -t drvfs
- - Supports NFS owner/group to WSL uid/gid mapping
- @@ -369,14 +369,14 @@ does not wait until nfsd*.exe is available for accepting mounts.
- # WSL usage:
- -Example 1: Mount Windows NFSv4.1 share via Windows driver letter
- -# Mount NFSv4.1 share in Windows to driver letter 'N':
- +Example 1: Mount Windows NFSv4.1 share via Windows drive letter
- +# Mount NFSv4.1 share in Windows to drive letter 'N':
- ---- snip ----
- $ /sbin/nfs_mount -o rw 'N' nfs://10.49.202.230//bigdisk
- Successfully mounted '10.49.202.230@2049' to drive 'N:'
- ---- snip ----
- -# Within WSL mount driver letter 'N' to /mnt/n
- +# Within WSL mount drive letter 'N' to /mnt/n
- ---- snip ----
- $ sudo bash
- $ mkdir /mnt/n
- --
- 2.45.1
- From 00c3c7f4206cff1efd3bbd13c1ca3c7de851fa6b Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 2 Dec 2024 18:42:58 +0100
- Subject: [PATCH 8/8] build.vc19,daemon,mount: Use
- |_CRT_STDIO_ISO_WIDE_SPECIFIERS| for portability
- Use |_CRT_STDIO_ISO_WIDE_SPECIFIERS| for portability so we can
- use wide-char streams in libtirpc, url parser etc. in the future
- without issues with non-portable string format specifers (i.e.
- UCRT |fwprintf()| uses "%s" for wide-strings by default
- (without |_CRT_STDIO_ISO_WIDE_SPECIFIERS|) while ISO C99 uses
- "%S"/"%ls".
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- build.vc19/libtirpc/libtirpc.vcxproj | 12 ++--
- build.vc19/nfs41_np/nfs41_np.vcxproj | 12 ++--
- build.vc19/nfs_install/nfs_install.vcxproj | 12 ++--
- build.vc19/nfs_mount/nfs_mount.vcxproj | 12 ++--
- build.vc19/nfsd/nfsd.vcxproj | 12 ++--
- daemon/service.c | 35 ++++++-----
- mount/enum.c | 16 +++--
- mount/mount.c | 72 ++++++++++++----------
- mount/options.c | 12 ++--
- mount/urlparser1.c | 6 ++
- 10 files changed, 114 insertions(+), 87 deletions(-)
- diff --git a/build.vc19/libtirpc/libtirpc.vcxproj b/build.vc19/libtirpc/libtirpc.vcxproj
- index a231975..c2b6670 100644
- --- a/build.vc19/libtirpc/libtirpc.vcxproj
- +++ b/build.vc19/libtirpc/libtirpc.vcxproj
- @@ -120,7 +120,7 @@
- </PrecompiledHeader>
- <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- - <PreprocessorDefinitions>FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;PORTMAP;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;LIBTIRPC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;PORTMAP;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;LIBTIRPC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <StringPooling>true</StringPooling>
- @@ -143,7 +143,7 @@
- </PrecompiledHeader>
- <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- - <PreprocessorDefinitions>FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;PORTMAP;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;LIBTIRPC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;PORTMAP;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;LIBTIRPC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <StringPooling>true</StringPooling>
- @@ -166,7 +166,7 @@
- </PrecompiledHeader>
- <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- - <PreprocessorDefinitions>FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;PORTMAP;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;LIBTIRPC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;PORTMAP;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;LIBTIRPC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <StringPooling>true</StringPooling>
- @@ -191,7 +191,7 @@
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- - <PreprocessorDefinitions>FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;PORTMAP;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;NDEBUG;_WINDOWS;_USRDLL;LIBTIRPC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;PORTMAP;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;NDEBUG;_WINDOWS;_USRDLL;LIBTIRPC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <StringPooling>true</StringPooling>
- @@ -216,7 +216,7 @@
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- - <PreprocessorDefinitions>FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;PORTMAP;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;NDEBUG;_WINDOWS;_USRDLL;LIBTIRPC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;PORTMAP;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;NDEBUG;_WINDOWS;_USRDLL;LIBTIRPC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <StringPooling>true</StringPooling>
- @@ -241,7 +241,7 @@
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- - <PreprocessorDefinitions>FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;PORTMAP;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;NDEBUG;_WINDOWS;_USRDLL;LIBTIRPC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;PORTMAP;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;NDEBUG;_WINDOWS;_USRDLL;LIBTIRPC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <StringPooling>true</StringPooling>
- diff --git a/build.vc19/nfs41_np/nfs41_np.vcxproj b/build.vc19/nfs41_np/nfs41_np.vcxproj
- index 867d7d4..3b7e8e9 100644
- --- a/build.vc19/nfs41_np/nfs41_np.vcxproj
- +++ b/build.vc19/nfs41_np/nfs41_np.vcxproj
- @@ -120,7 +120,7 @@
- </PrecompiledHeader>
- <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- - <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- @@ -139,7 +139,7 @@
- </PrecompiledHeader>
- <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- - <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- @@ -158,7 +158,7 @@
- </PrecompiledHeader>
- <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- - <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- @@ -179,7 +179,7 @@
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- - <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;NDEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- @@ -201,7 +201,7 @@
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- - <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;NDEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- @@ -223,7 +223,7 @@
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- - <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;NDEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- diff --git a/build.vc19/nfs_install/nfs_install.vcxproj b/build.vc19/nfs_install/nfs_install.vcxproj
- index 0650cfe..85eac67 100644
- --- a/build.vc19/nfs_install/nfs_install.vcxproj
- +++ b/build.vc19/nfs_install/nfs_install.vcxproj
- @@ -120,7 +120,7 @@
- </PrecompiledHeader>
- <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- - <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- @@ -137,7 +137,7 @@
- </PrecompiledHeader>
- <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- - <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- @@ -154,7 +154,7 @@
- </PrecompiledHeader>
- <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- - <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- @@ -173,7 +173,7 @@
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- - <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- @@ -193,7 +193,7 @@
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- - <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- @@ -213,7 +213,7 @@
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- - <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- diff --git a/build.vc19/nfs_mount/nfs_mount.vcxproj b/build.vc19/nfs_mount/nfs_mount.vcxproj
- index b94bfb2..b17cc2a 100644
- --- a/build.vc19/nfs_mount/nfs_mount.vcxproj
- +++ b/build.vc19/nfs_mount/nfs_mount.vcxproj
- @@ -120,7 +120,7 @@
- </PrecompiledHeader>
- <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- - <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- @@ -138,7 +138,7 @@
- </PrecompiledHeader>
- <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- - <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- @@ -156,7 +156,7 @@
- </PrecompiledHeader>
- <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- - <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- @@ -176,7 +176,7 @@
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- - <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- @@ -197,7 +197,7 @@
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- - <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- @@ -218,7 +218,7 @@
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- - <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- diff --git a/build.vc19/nfsd/nfsd.vcxproj b/build.vc19/nfsd/nfsd.vcxproj
- index ad5db46..65bba64 100644
- --- a/build.vc19/nfsd/nfsd.vcxproj
- +++ b/build.vc19/nfsd/nfsd.vcxproj
- @@ -120,7 +120,7 @@
- </PrecompiledHeader>
- <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- - <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;STANDALONE_NFSD;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;STANDALONE_NFSD;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\include;..\..\libtirpc\tirpc;..\..\sys;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <BasicRuntimeChecks>Default</BasicRuntimeChecks>
- @@ -142,7 +142,7 @@
- </PrecompiledHeader>
- <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- - <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;STANDALONE_NFSD;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;STANDALONE_NFSD;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\include;..\..\libtirpc\tirpc;..\..\sys;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <BasicRuntimeChecks>Default</BasicRuntimeChecks>
- @@ -164,7 +164,7 @@
- </PrecompiledHeader>
- <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- - <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;STANDALONE_NFSD;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;STANDALONE_NFSD;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\include;..\..\libtirpc\tirpc;..\..\sys;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <BasicRuntimeChecks>Default</BasicRuntimeChecks>
- @@ -188,7 +188,7 @@
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- - <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\include;..\..\libtirpc\tirpc;..\..\sys;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <BufferSecurityCheck>false</BufferSecurityCheck>
- @@ -212,7 +212,7 @@
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- - <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\include;..\..\libtirpc\tirpc;..\..\sys;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <BufferSecurityCheck>false</BufferSecurityCheck>
- @@ -236,7 +236,7 @@
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- - <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- + <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;_CRT_STDIO_ISO_WIDE_SPECIFIERS=1;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\include;..\..\libtirpc\tirpc;..\..\sys;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <BufferSecurityCheck>false</BufferSecurityCheck>
- diff --git a/daemon/service.c b/daemon/service.c
- index d30d43c..bbf34b4 100644
- --- a/daemon/service.c
- +++ b/daemon/service.c
- @@ -21,6 +21,11 @@ FUNCTIONS:
- GetLastErrorText( LPTSTR lpszBuf, DWORD dwSize );
- ---------------------------------------------------------------------------*/
- +
- +#ifndef _CRT_STDIO_ISO_WIDE_SPECIFIERS
- +#error Code requires ISO wide-char behaviour
- +#endif /* !_CRT_STDIO_ISO_WIDE_SPECIFIERS */
- +
- #include <windows.h>
- #ifndef STANDALONE_NFSD
- #include <stdio.h>
- @@ -303,7 +308,7 @@ VOID AddToMessageLog(LPTSTR lpszMsg)
- //
- hEventSource = RegisterEventSource(NULL, TEXT(SZSERVICENAME));
- - _stprintf_s(szMsg,(sizeof(SZSERVICENAME) / sizeof(TCHAR)) + 100, TEXT("%s error: %d"), TEXT(SZSERVICENAME), dwErr);
- + _stprintf_s(szMsg,(sizeof(SZSERVICENAME) / sizeof(TCHAR)) + 100, TEXT("%ls error: %d"), TEXT(SZSERVICENAME), dwErr);
- lpszStrings[0] = szMsg;
- lpszStrings[1] = lpszMsg;
- @@ -355,7 +360,7 @@ void CmdInstallService()
- if ( GetModuleFileName( NULL, szPath, 512 ) == 0 )
- {
- - _tprintf(TEXT("Unable to install %s - %s\n"), TEXT(SZSERVICEDISPLAYNAME), GetLastErrorText(szErr, 256));
- + _tprintf(TEXT("Unable to install %ls - %ls\n"), TEXT(SZSERVICEDISPLAYNAME), GetLastErrorText(szErr, 256));
- return;
- }
- @@ -383,18 +388,18 @@ void CmdInstallService()
- if ( schService )
- {
- - _tprintf(TEXT("%s installed.\n"), TEXT(SZSERVICEDISPLAYNAME) );
- + _tprintf(TEXT("%ls installed.\n"), TEXT(SZSERVICEDISPLAYNAME) );
- CloseServiceHandle(schService);
- }
- else
- {
- - _tprintf(TEXT("CreateService failed - %s\n"), GetLastErrorText(szErr, 256));
- + _tprintf(TEXT("CreateService failed - %ls\n"), GetLastErrorText(szErr, 256));
- }
- CloseServiceHandle(schSCManager);
- }
- else
- - _tprintf(TEXT("OpenSCManager failed - %s\n"), GetLastErrorText(szErr,256));
- + _tprintf(TEXT("OpenSCManager failed - %ls\n"), GetLastErrorText(szErr,256));
- }
- @@ -431,7 +436,7 @@ void CmdRemoveService()
- // try to stop the service
- if ( ControlService( schService, SERVICE_CONTROL_STOP, &ssStatus ) )
- {
- - _tprintf(TEXT("Stopping %s."), TEXT(SZSERVICEDISPLAYNAME));
- + _tprintf(TEXT("Stopping %ls."), TEXT(SZSERVICEDISPLAYNAME));
- Sleep( 1000 );
- while ( QueryServiceStatus( schService, &ssStatus ) )
- @@ -446,28 +451,28 @@ void CmdRemoveService()
- }
- if ( ssStatus.dwCurrentState == SERVICE_STOPPED )
- - _tprintf(TEXT("\n%s stopped.\n"), TEXT(SZSERVICEDISPLAYNAME) );
- + _tprintf(TEXT("\n%ls stopped.\n"), TEXT(SZSERVICEDISPLAYNAME) );
- else
- - _tprintf(TEXT("\n%s failed to stop.\n"), TEXT(SZSERVICEDISPLAYNAME) );
- + _tprintf(TEXT("\n%ls failed to stop.\n"), TEXT(SZSERVICEDISPLAYNAME) );
- }
- // now remove the service
- if ( DeleteService(schService) )
- - _tprintf(TEXT("%s removed.\n"), TEXT(SZSERVICEDISPLAYNAME) );
- + _tprintf(TEXT("%ls removed.\n"), TEXT(SZSERVICEDISPLAYNAME) );
- else
- - _tprintf(TEXT("DeleteService failed - %s\n"), GetLastErrorText(szErr,256));
- + _tprintf(TEXT("DeleteService failed - %ls\n"), GetLastErrorText(szErr,256));
- CloseServiceHandle(schService);
- }
- else
- - _tprintf(TEXT("OpenService failed - %s\n"), GetLastErrorText(szErr,256));
- + _tprintf(TEXT("OpenService failed - %ls\n"), GetLastErrorText(szErr,256));
- CloseServiceHandle(schSCManager);
- }
- else
- - _tprintf(TEXT("OpenSCManager failed - %s\n"), GetLastErrorText(szErr,256));
- + _tprintf(TEXT("OpenSCManager failed - %ls\n"), GetLastErrorText(szErr,256));
- }
- @@ -511,7 +516,7 @@ void CmdDebugService(int argc, char ** argv)
- lpszArgv = argv;
- #endif
- - _tprintf(TEXT("Debugging %s.\n"), TEXT(SZSERVICEDISPLAYNAME));
- + _tprintf(TEXT("Debugging %ls.\n"), TEXT(SZSERVICEDISPLAYNAME));
- SetConsoleCtrlHandler( ControlHandler, TRUE );
- @@ -546,7 +551,7 @@ BOOL WINAPI ControlHandler ( DWORD dwCtrlType )
- {
- case CTRL_BREAK_EVENT: // use Ctrl+C or Ctrl+Break to simulate
- case CTRL_C_EVENT: // SERVICE_CONTROL_STOP in debug mode
- - _tprintf(TEXT("Stopping %s.\n"), TEXT(SZSERVICEDISPLAYNAME));
- + _tprintf(TEXT("Stopping %ls.\n"), TEXT(SZSERVICEDISPLAYNAME));
- ServiceStop();
- return TRUE;
- break;
- @@ -590,7 +595,7 @@ LPTSTR GetLastErrorText( LPTSTR lpszBuf, DWORD dwSize )
- if (NULL != lpszTemp)
- {
- lpszTemp[lstrlen(lpszTemp)-2] = TEXT('\0'); //remove cr and newline character
- - _stprintf_s( lpszBuf, dwSize, TEXT("%s (0x%x)"), lpszTemp, GetLastError() );
- + _stprintf_s( lpszBuf, dwSize, TEXT("%ls (0x%x)"), lpszTemp, GetLastError() );
- }
- }
- diff --git a/mount/enum.c b/mount/enum.c
- index ab436d3..669023c 100644
- --- a/mount/enum.c
- +++ b/mount/enum.c
- @@ -20,6 +20,14 @@
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- */
- +#if ((__STDC_VERSION__-0) < 201710L)
- +#error Code requires ISO C17
- +#endif
- +
- +#ifndef _CRT_STDIO_ISO_WIDE_SPECIFIERS
- +#error Code requires ISO wide-char behaviour
- +#endif /* !_CRT_STDIO_ISO_WIDE_SPECIFIERS */
- +
- #include <Windows.h>
- #include <stdbool.h>
- #include <stdio.h>
- @@ -203,7 +211,7 @@ void PrintMountLine(
- #pragma warning( pop )
- }
- - (void)wprintf(L"%-8s\t%-50s\t%-50s\t%-50S\n",
- + (void)wprintf(L"%-8ls\t%-50ls\t%-50ls\t%-50s\n",
- local, remote, cygwin_unc_buffer, cygwin_nfsurl_buffer);
- free(utf8unc);
- @@ -238,9 +246,9 @@ DWORD EnumMounts(
- if (result)
- goto out_free;
- - (void)wprintf(L"Listing '%s' mounts:\n\n",
- + (void)wprintf(L"Listing '%ls' mounts:\n\n",
- NFS41_PROVIDER_NAME_U);
- - (void)wprintf(L"%-8s\t%-50s\t%-50s\t%-50s\n",
- + (void)wprintf(L"%-8ls\t%-50ls\t%-50ls\t%-50ls\n",
- L"Volume", L"Remote path", L"Cygwin UNC path", L"URL");
- do
- @@ -269,7 +277,7 @@ DWORD EnumMounts(
- result = WNetCloseEnum(hEnum);
- - (void)wprintf(L"\nFound %d share%s.\n", dwTotal,
- + (void)wprintf(L"\nFound %d share%ls.\n", dwTotal,
- (dwTotal == 1) ? L"" : L"s");
- out_free:
- diff --git a/mount/mount.c b/mount/mount.c
- index 0b5f313..5b872a2 100644
- --- a/mount/mount.c
- +++ b/mount/mount.c
- @@ -24,6 +24,10 @@
- #error Code requires ISO C17
- #endif
- +#ifndef _CRT_STDIO_ISO_WIDE_SPECIFIERS
- +#error Code requires ISO wide-char behaviour
- +#endif /* !_CRT_STDIO_ISO_WIDE_SPECIFIERS */
- +
- #include <crtdbg.h>
- #include <Windows.h>
- #include <strsafe.h>
- @@ -80,10 +84,10 @@ static
- void PrintMountUsage(LPWSTR pProcess)
- {
- (void)fwprintf(stderr,
- - L"Usage: %s [options] <drive letter|*> <hostname>:<path>\n"
- - "Usage: %s [options] <hostname>:<path>\n"
- - "Usage: %s -d [options] <drive letter>\n"
- - "Usage: %s\n"
- + L"Usage: %ls [options] <drive letter|*> <hostname>:<path>\n"
- + "Usage: %ls [options] <hostname>:<path>\n"
- + "Usage: %ls -d [options] <drive letter>\n"
- + "Usage: %ls\n"
- "* Options:\n"
- "\t-h, --help, /?\thelp\n"
- @@ -174,7 +178,7 @@ static
- void PrintUmountUsage(LPWSTR pProcess)
- {
- (void)fwprintf(stderr,
- - L"Usage: %s [options] <drive letter>\n"
- + L"Usage: %ls [options] <drive letter>\n"
- "* Options:\n"
- "\t-h, --help, /?\thelp\n"
- @@ -367,7 +371,7 @@ opt_o_argv_i_again:
- if (!wcscmp(argv[i], L"nfs")) {
- result = ERROR_BAD_ARGUMENTS;
- - (void)fwprintf(stderr, L"Filesystem type '%s' "
- + (void)fwprintf(stderr, L"Filesystem type '%ls' "
- L"not supported.\n\n.", argv[i]);
- PrintMountUsage(argv[0]);
- goto out_free;
- @@ -375,7 +379,7 @@ opt_o_argv_i_again:
- }
- else {
- (void)fwprintf(stderr,
- - L"Unrecognized option '%s'\n",
- + L"Unrecognized option '%ls'\n",
- argv[i]);
- result = 1;
- goto out;
- @@ -398,7 +402,7 @@ opt_o_argv_i_again:
- }
- else {
- (void)fwprintf(stderr,
- - L"Unrecognized argument '%s'.\n",
- + L"Unrecognized argument '%ls'.\n",
- argv[i]);
- result = 1;
- goto out;
- @@ -409,7 +413,7 @@ opt_o_argv_i_again:
- if (pLocalName) {
- if (!ParseDriveLetter(pLocalName, szLocalName)) {
- result = ERROR_BAD_ARGUMENTS;
- - (void)fwprintf(stderr, L"Invalid drive letter '%s'. "
- + (void)fwprintf(stderr, L"Invalid drive letter '%ls'. "
- L"Expected 'C' or 'C:'.\n\n",
- pLocalName);
- PrintMountUsage(argv[0]);
- @@ -503,7 +507,7 @@ int umount_main(int argc, wchar_t *argv[])
- }
- else {
- (void)fwprintf(stderr, L"Unrecognized option "
- - L"'%s', disregarding.\n",
- + L"'%ls', disregarding.\n",
- argv[i]);
- result = ERROR_BAD_ARGUMENTS;
- }
- @@ -520,7 +524,7 @@ int umount_main(int argc, wchar_t *argv[])
- }
- else {
- (void)fwprintf(stderr, L"Unrecognized argument "
- - L"'%s', disregarding.\n",
- + L"'%ls', disregarding.\n",
- argv[i]);
- }
- }
- @@ -534,7 +538,7 @@ int umount_main(int argc, wchar_t *argv[])
- if (!ParseDriveLetter(pLocalName, szLocalName)) {
- result = ERROR_BAD_ARGUMENTS;
- - (void)fwprintf(stderr, L"Invalid drive letter '%s'. "
- + (void)fwprintf(stderr, L"Invalid drive letter '%ls'. "
- L"Expected 'C' or 'C:'.\n\n",
- pLocalName);
- PrintUmountUsage(argv[0]);
- @@ -604,7 +608,7 @@ int __cdecl wmain(int argc, wchar_t *argv[])
- goto out;
- }
- else {
- - (void)fwprintf(stderr, L"%s: Unknown mode\n", argv[0]);
- + (void)fwprintf(stderr, L"%ls: Unknown mode\n", argv[0]);
- result = 1;
- goto out;
- }
- @@ -738,7 +742,7 @@ static DWORD ParseRemoteName(
- if (url_parser_parse(uctx) < 0) {
- result = ERROR_BAD_ARGUMENTS;
- - (void)fwprintf(stderr, L"Error parsing nfs://-URL '%S'.\n", premotename_utf8);
- + (void)fwprintf(stderr, L"Error parsing nfs://-URL '%s'.\n", premotename_utf8);
- goto out;
- }
- @@ -774,7 +778,7 @@ static DWORD ParseRemoteName(
- result = ERROR_BAD_ARGUMENTS;
- (void)fwprintf(stderr,
- L"Unsupported nfs://-URL parameter "
- - L"'%S' value '%S'.\n",
- + L"'%s' value '%s'.\n",
- pname, pvalue);
- goto out;
- }
- @@ -790,7 +794,7 @@ static DWORD ParseRemoteName(
- result = ERROR_BAD_ARGUMENTS;
- (void)fwprintf(stderr,
- L"Unsupported nfs://-URL parameter "
- - L"'%S' value '%S'.\n",
- + L"'%s' value '%s'.\n",
- pname, pvalue);
- goto out;
- }
- @@ -798,7 +802,7 @@ static DWORD ParseRemoteName(
- else {
- result = ERROR_BAD_ARGUMENTS;
- (void)fwprintf(stderr,
- - L"Unsupported nfs://-URL parameter '%S'.\n",
- + L"Unsupported nfs://-URL parameter '%s'.\n",
- pname);
- goto out;
- }
- @@ -811,7 +815,7 @@ static DWORD ParseRemoteName(
- hostname_wstr = utf8str2wcs(uctx->hostport.hostname);
- if (!hostname_wstr) {
- result = GetLastError();
- - (void)fwprintf(stderr, L"Cannot convert URL host '%S', lasterr=%d\n",
- + (void)fwprintf(stderr, L"Cannot convert URL host '%s', lasterr=%d\n",
- uctx->hostport.hostname, result);
- goto out;
- }
- @@ -835,7 +839,7 @@ static DWORD ParseRemoteName(
- pEnd = mountstrmem = utf8str2wcs(uctx->path);
- if (!mountstrmem) {
- result = GetLastError();
- - (void)fwprintf(stderr, L"Cannot convert URL path '%S', lasterr=%d\n",
- + (void)fwprintf(stderr, L"Cannot convert URL path '%s', lasterr=%d\n",
- uctx->path, result);
- goto out;
- }
- @@ -920,7 +924,7 @@ static DWORD ParseRemoteName(
- c = premotename[i];
- if (!(iswxdigit(c) || (c == L':'))) {
- fwprintf(stderr, L"Failed to parse raw IPv6 "
- - L"address, illegal character '%c' found.\n",
- + L"address, illegal character '%lc' found.\n",
- c);
- result = ERROR_BAD_ARGUMENTS;
- goto out;
- @@ -942,11 +946,11 @@ static DWORD ParseRemoteName(
- * too
- */
- (void)swprintf(srvname, SRVNAME_LEN,
- - L"%s.ipv6-literal.net@%d", premotename, port);
- + L"%ls.ipv6-literal.net@%d", premotename, port);
- }
- else {
- /* ALWAYS add port number to hostname, so UNC paths use it too */
- - (void)swprintf(srvname, SRVNAME_LEN, L"%s@%d",
- + (void)swprintf(srvname, SRVNAME_LEN, L"%ls@%d",
- premotename, port);
- }
- @@ -955,15 +959,15 @@ static DWORD ParseRemoteName(
- * address without ':', or just random garbage
- */
- if (wcschr(srvname, L':')) {
- - fwprintf(stderr,
- - L"Illegal ':' character hostname '%s'.\n", srvname);
- + (void)fwprintf(stderr,
- + L"Illegal ':' character hostname '%ls'.\n", srvname);
- result = ERROR_BAD_ARGUMENTS;
- goto out;
- }
- #ifdef DEBUG_MOUNT
- (void)fwprintf(stderr,
- - L"srvname='%s', mntpt='%s'\n",
- + L"srvname='%ls', mntpt='%ls'\n",
- srvname,
- pEnd);
- #endif
- @@ -993,7 +997,7 @@ static DWORD ParseRemoteName(
- #ifdef DEBUG_MOUNT
- (void)fwprintf(stderr,
- - L"pConnectionName='%s', pParsedRemoteName='%s', use_nfspubfh='%d'\n",
- + L"pConnectionName='%ls', pParsedRemoteName='%ls', use_nfspubfh='%d'\n",
- pConnectionName,
- pParsedRemoteName,
- (int)use_nfspubfh);
- @@ -1029,7 +1033,7 @@ static DWORD DoMount(
- #ifdef DEBUG_MOUNT
- (void)fwprintf(stderr,
- - L"DoMount(pLocalName='%s', pRemoteName='%s', pParsedRemoteName='%s')\n",
- + L"DoMount(pLocalName='%ls', pRemoteName='%ls', pParsedRemoteName='%ls')\n",
- pLocalName,
- pRemoteName,
- pParsedRemoteName);
- @@ -1042,8 +1046,8 @@ static DWORD DoMount(
- result = WNetGetConnectionW(pLocalName, (LPWSTR)szExisting, &dwLength);
- if (result == NO_ERROR) {
- result = ERROR_ALREADY_ASSIGNED;
- - (void)fwprintf(stderr, L"Mount failed, drive '%s' is "
- - L"already assigned to '%s'.\n",
- + (void)fwprintf(stderr, L"Mount failed, drive '%ls' is "
- + L"already assigned to '%ls'.\n",
- pLocalName, szExisting);
- return result;
- }
- @@ -1085,11 +1089,11 @@ static DWORD DoMount(
- szConnection, &ConnectSize, &ConnectResult);
- if (result == NO_ERROR) {
- - (void)wprintf(L"Successfully mounted '%s' to drive '%s'\n",
- + (void)wprintf(L"Successfully mounted '%ls' to drive '%ls'\n",
- pParsedRemoteName, szConnection);
- }
- else {
- - (void)fwprintf(stderr, L"WNetUseConnectionW('%s', '%s') "
- + (void)fwprintf(stderr, L"WNetUseConnectionW('%ls', '%ls') "
- L"failed with error code %u.\n",
- pLocalName, pRemoteName, result);
- }
- @@ -1109,15 +1113,15 @@ static DWORD DoUnmount(
- switch (result)
- {
- case NO_ERROR:
- - (void)wprintf(L"Drive '%s' unmounted successfully.\n",
- + (void)wprintf(L"Drive '%ls' unmounted successfully.\n",
- pLocalName);
- break;
- case ERROR_NOT_CONNECTED:
- - (void)fwprintf(stderr, L"Drive '%s' is not currently "
- + (void)fwprintf(stderr, L"Drive '%ls' is not currently "
- L"connected.\n", pLocalName);
- break;
- default:
- - (void)fwprintf(stderr, L"WNetCancelConnection2W('%s') failed "
- + (void)fwprintf(stderr, L"WNetCancelConnection2W('%ls') failed "
- L"with error code %u.\n", pLocalName, result);
- break;
- }
- diff --git a/mount/options.c b/mount/options.c
- index 4f3ca54..0c28756 100644
- --- a/mount/options.c
- +++ b/mount/options.c
- @@ -20,6 +20,10 @@
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- */
- +#ifndef _CRT_STDIO_ISO_WIDE_SPECIFIERS
- +#error Code requires ISO wide-char behaviour
- +#endif /* !_CRT_STDIO_ISO_WIDE_SPECIFIERS */
- +
- #include <crtdbg.h>
- #include <Windows.h>
- #include <strsafe.h>
- @@ -124,9 +128,9 @@ BOOL InsertOption(
- if (FindOptionByName(Name, Options, &Current)) {
- (void)fwprintf(stderr, L"Found a duplicate option "
- L"'%s%s%s' while parsing '%s%s%s'.\n",
- - (PTCH)Current->EaName,
- + (PWCH)Current->EaName,
- Current->EaValueLength ? L"=" : L"",
- - (PTCH)(Current->EaName + Current->EaNameLength + sizeof(wchar_t)),
- + (PWCH)(Current->EaName + Current->EaNameLength + sizeof(wchar_t)),
- Name, ValueLen ? L"=" : Value, Value);
- return FALSE;
- }
- @@ -197,7 +201,7 @@ BOOL ParseMountOptions(
- IN LPWSTR Arg,
- IN OUT PMOUNT_OPTION_LIST Options)
- {
- - PTCH pos, comma, equals;
- + PWCH pos, comma, equals;
- pos = Arg;
- for (;;)
- @@ -237,7 +241,7 @@ BOOL ParseMountOptions(
- out_empty_option:
- (void)fwprintf(stderr, L"Found an empty option while "
- - L"reading mount options at '%s'.\n",
- + L"reading mount options at '%ls'.\n",
- pos);
- return FALSE;
- }
- diff --git a/mount/urlparser1.c b/mount/urlparser1.c
- index 8fcae52..66303a1 100644
- --- a/mount/urlparser1.c
- +++ b/mount/urlparser1.c
- @@ -25,6 +25,12 @@
- #error Code requires ISO C17
- #endif
- +#ifdef _MSC_VER
- +#ifndef _CRT_STDIO_ISO_WIDE_SPECIFIERS
- +#error Code requires ISO wide-char behaviour
- +#endif /* !_CRT_STDIO_ISO_WIDE_SPECIFIERS */
- +#endif /* _MSC_VER */
- +
- #include <stdlib.h>
- #include <stdbool.h>
- #include <string.h>
- --
- 2.45.1
msnfs41client: Patches for nfs_mount/np issues, DOS drive autoselection fix, VS2022 64bit-only build, UCRT ISO widefmt defaults+misc, 2024-12-02
Posted by Anonymous on Mon 2nd Dec 2024 18:12
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.