- diff --git a/daemon/fileinfoutil.c b/daemon/fileinfoutil.c
- index 3466cfd..ce845e1 100644
- --- a/daemon/fileinfoutil.c
- +++ b/daemon/fileinfoutil.c
- @@ -95,6 +95,28 @@ ULONG nfs_file_info_to_attributes(
- return attrs ? attrs : FILE_ATTRIBUTE_NORMAL;
- }
- +#if 1
- +static
- +bool ends_with_pagefile_sys(const char *s)
- +{
- + static const char suffix[] = "pagefile.sys";
- + size_t n, m;
- +
- + if (s == NULL) {
- + return false;
- + }
- +
- + n = strlen(s);
- + m = sizeof(suffix) - 1;
- +
- + if (n < m) {
- + return false;
- + }
- +
- + return (memcmp(s + (n - m), suffix, m) == 0)?true:false;
- +}
- +#endif
- +
- void nfs_to_basic_info(
- IN const char *restrict name,
- IN const nfs41_superblock *restrict superblock,
- @@ -142,6 +164,19 @@ void nfs_to_basic_info(
- basic_out->FileAttributes =
- nfs_file_info_to_attributes(superblock, info);
- +
- +#if 1
- + if (ends_with_pagefile_sys(name)) {
- + DPRINTF(1, ("nfs_to_basic_info(name='%s'): "
- + "hack: set FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM "
- + "for pagefile.sys\n",
- + name));
- +
- + basic_out->FileAttributes |=
- + FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
- + basic_out->FileAttributes &= ~FILE_ATTRIBUTE_SPARSE_FILE;
- + }
- +#endif
- }
- void nfs_to_standard_info(
- @@ -221,6 +256,7 @@ void nfs_to_remote_protocol_info(
- {
- (void)memset(rpi_out, 0, sizeof(FILE_REMOTE_PROTOCOL_INFORMATION));
- +#if 0
- rpi_out->StructureVersion = 4;
- rpi_out->StructureSize = sizeof(FILE_REMOTE_PROTOCOL_INFORMATION);
- rpi_out->Protocol = WNNC_NET_RDR2SAMPLE; /* FIXME! */
- @@ -237,6 +273,44 @@ void nfs_to_remote_protocol_info(
- * |REMOTE_PROTOCOL_FLAG_INTEGRITY| (krb5i) in case of Krb5 auth
- */
- rpi_out->Flags = 0;
- +#else
- + /* Pretend to be SMB */
- + rpi_out->StructureVersion = 4;
- + rpi_out->StructureSize = 116;
- + rpi_out->Protocol = WNNC_NET_SMB;
- + rpi_out->ProtocolMajorVersion = 3;
- + rpi_out->ProtocolMinorVersion = 1;
- + rpi_out->ProtocolRevision = 1;
- + rpi_out->Reserved = 0x0;
- + rpi_out->Flags = REMOTE_PROTOCOL_FLAG_MUTUAL_AUTH;
- + rpi_out->GenericReserved.Reserved[0]=0x0;
- + rpi_out->GenericReserved.Reserved[1]=0x0;
- + rpi_out->GenericReserved.Reserved[2]=0x0;
- + rpi_out->GenericReserved.Reserved[3]=0x0;
- + rpi_out->GenericReserved.Reserved[4]=0x0;
- + rpi_out->GenericReserved.Reserved[5]=0x0;
- + rpi_out->GenericReserved.Reserved[6]=0x0;
- + rpi_out->GenericReserved.Reserved[7]=0x0;
- + rpi_out->ProtocolSpecific.Reserved[0]=0x6f;
- + rpi_out->ProtocolSpecific.Reserved[1]=0x0;
- + rpi_out->ProtocolSpecific.Reserved[2]=0x0;
- + rpi_out->ProtocolSpecific.Reserved[3]=0x0;
- + rpi_out->ProtocolSpecific.Reserved[4]=0x0;
- + rpi_out->ProtocolSpecific.Reserved[5]=0x0;
- + rpi_out->ProtocolSpecific.Reserved[6]=0x0;
- + rpi_out->ProtocolSpecific.Reserved[7]=0x0;
- + rpi_out->ProtocolSpecific.Reserved[8]=0x0;
- + rpi_out->ProtocolSpecific.Reserved[9]=0x0;
- + rpi_out->ProtocolSpecific.Reserved[10]=0x0;
- + rpi_out->ProtocolSpecific.Reserved[11]=0x0;
- + rpi_out->ProtocolSpecific.Reserved[12]=0x0;
- + rpi_out->ProtocolSpecific.Reserved[13]=0x0;
- + rpi_out->ProtocolSpecific.Reserved[14]=0x0;
- + rpi_out->ProtocolSpecific.Reserved[15]=0x800000;
- +
- + DPRINTF(0, ("nfs_to_remote_protocol_info: "
- + "returning fake WNNC_NET_SMB info\n"));
- +#endif
- }
- #ifdef NFS41_DRIVER_WSL_SUPPORT
- diff --git a/include/from_kernel.h b/include/from_kernel.h
- index b9640a1..da354ed 100644
- --- a/include/from_kernel.h
- +++ b/include/from_kernel.h
- @@ -388,6 +388,18 @@ typedef struct _FILE_REMOTE_PROTOCOL_INFORMATION
- } ProtocolSpecificReserved;
- #else
- union {
- + struct {
- + struct {
- + ULONG Capabilities;
- + } Server;
- + struct {
- + ULONG Capabilities;
- + ULONG CachingFlags;
- + UCHAR ShareType;
- + UCHAR Reserved0[3];
- + ULONG Reserved1;
- + } Share;
- + } Smb2;
- ULONG Reserved[16];
- } ProtocolSpecific;
- #endif /* (_WIN32_WINNT < _WIN32_WINNT_WIN8) */
- diff --git a/sys/nfs41sys_driver.c b/sys/nfs41sys_driver.c
- index 39689ab..f697ada 100644
- --- a/sys/nfs41sys_driver.c
- +++ b/sys/nfs41sys_driver.c
- @@ -1478,7 +1478,7 @@ NTSTATUS DriverEntry(
- DbgP("DriverEntry: calling RxRegisterMinirdr\n");
- status = RxRegisterMinirdr(&nfs41_dev, drv, &nfs41_ops, flags, &dev_name,
- sizeof(NFS41_DEVICE_EXTENSION),
- - FILE_DEVICE_NETWORK_FILE_SYSTEM, FILE_REMOTE_DEVICE);
- + FILE_DEVICE_NETWORK_FILE_SYSTEM, 0/*FILE_REMOTE_DEVICE*/);
- if (status != STATUS_SUCCESS) {
- print_error("RxRegisterMinirdr failed: 0x%08lx\n", status);
- goto out;
- diff --git a/sys/nfs41sys_volinfo.c b/sys/nfs41sys_volinfo.c
- index 017dcb6..9c52ba5 100644
- --- a/sys/nfs41sys_volinfo.c
- +++ b/sys/nfs41sys_volinfo.c
- @@ -187,7 +187,7 @@ NTSTATUS nfs41_QueryVolumeInformation(
- goto out;
- }
- pDevInfo->DeviceType = RxContext->pFcb->pNetRoot->DeviceType;
- - pDevInfo->Characteristics = FILE_REMOTE_DEVICE | FILE_DEVICE_IS_MOUNTED;
- + pDevInfo->Characteristics = /*FILE_REMOTE_DEVICE |*/ FILE_DEVICE_IS_MOUNTED;
- RxContext->Info.LengthRemaining -= SizeUsed;
- status = STATUS_SUCCESS;
- goto out;
Try to get pagefile.sys working
Posted by Anonymous on Sat 1st Nov 2025 14:05
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.
nrubsig.kpaste.net RSS