1 /* NFSv4.1 client for Windows
2 * Copyright © 2012 The Regents of the University of Michigan
4 * Olga Kornievskaia <aglo@umich.edu>
5 * Casey Bodley <cbodley@umich.edu>
7 * This library is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation; either version 2.1 of the License, or (at
10 * your option) any later version.
12 * This library is distributed in the hope that it will be useful, but
13 * without any warranty; without even the implied warranty of merchantability
14 * or fitness for a particular purpose. See the GNU Lesser General Public
15 * License for more details.
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
27 #include "nfs41_driver.h"
31 #include <pseh/pseh2.h>
34 #define DbgP(_x_) NFS41DbgPrint _x_
38 #define TRACE_TAG L"[NFS41_NP]"
39 #define WNNC_DRIVER( major, minor ) ( major * 0x00010000 + minor )
42 ULONG _cdecl
NFS41DbgPrint( __in LPTSTR Format
, ... )
48 va_start( marker
, Format
);
51 //StringCchVPrintfW( szbuffer, 127, Format, marker );
52 StringCchVPrintfW( szbuffer
, 256, Format
, marker
);
53 szbuffer
[255] = (TCHAR
)0;
54 OutputDebugString( TRACE_TAG
);
55 OutputDebugString( szbuffer
);
61 int filter(unsigned int code
)
63 DbgP((L
"####Got exception %u\n", code
));
64 return EXCEPTION_CONTINUE_SEARCH
;
76 This routine opens the shared memory for exclusive manipulation
80 phMutex - the mutex handle
82 phMemory - the memory handle
84 pMemory - a ptr. to the shared memory which is set if successful
88 WN_SUCCESS -- if successful
98 *phMutex
= CreateMutex(NULL
, FALSE
, TEXT(NFS41NP_MUTEX_NAME
));
101 dwStatus
= GetLastError();
102 DbgP((TEXT("OpenSharedMemory: OpenMutex failed\n")));
103 goto OpenSharedMemoryAbort1
;
106 WaitForSingleObject(*phMutex
, INFINITE
);
108 *phMemory
= OpenFileMapping(FILE_MAP_WRITE
,
110 TEXT(NFS41_USER_SHARED_MEMORY_NAME
));
111 if (*phMemory
== NULL
)
113 dwStatus
= GetLastError();
114 DbgP((TEXT("OpenSharedMemory: OpenFileMapping failed\n")));
115 goto OpenSharedMemoryAbort2
;
118 *pMemory
= MapViewOfFile(*phMemory
, FILE_MAP_WRITE
, 0, 0, 0);
119 if (*pMemory
== NULL
)
121 dwStatus
= GetLastError();
122 DbgP((TEXT("OpenSharedMemory: MapViewOfFile failed\n")));
123 goto OpenSharedMemoryAbort3
;
126 return ERROR_SUCCESS
;
128 OpenSharedMemoryAbort3
:
129 CloseHandle(*phMemory
);
131 OpenSharedMemoryAbort2
:
132 ReleaseMutex(*phMutex
);
133 CloseHandle(*phMutex
);
136 OpenSharedMemoryAbort1
:
137 DbgP((TEXT("OpenSharedMemory: return dwStatus: %d\n"), dwStatus
));
151 This routine relinquishes control of the shared memory after exclusive
156 hMutex - the mutex handle
158 hMemory - the memory handle
160 pMemory - a ptr. to the shared memory which is set if successful
168 UnmapViewOfFile(*pMemory
);
173 CloseHandle(*hMemory
);
178 if (ReleaseMutex(*hMutex
) == FALSE
)
180 DbgP((TEXT("CloseSharedMemory: ReleaseMutex error: %d\n"), GetLastError()));
182 CloseHandle(*hMutex
);
187 static DWORD
StoreConnectionInfo(
188 IN LPCWSTR LocalName
,
189 IN LPCWSTR ConnectionName
,
190 IN USHORT ConnectionNameLength
,
191 IN LPNETRESOURCE lpNetResource
)
194 HANDLE hMutex
, hMemory
;
195 PNFS41NP_SHARED_MEMORY pSharedMemory
;
196 PNFS41NP_NETRESOURCE pNfs41NetResource
;
198 BOOLEAN FreeEntryFound
= FALSE
;
201 status
= OpenSharedMemory(&hMutex
, &hMemory
, (PVOID
*)&pSharedMemory
);
203 status
= OpenSharedMemory(&hMutex
, &hMemory
, &(PVOID
)pSharedMemory
);
208 DbgP((TEXT("StoreConnectionInfo: NextIndex %d, NumResources %d\n"),
209 pSharedMemory
->NextAvailableIndex
,
210 pSharedMemory
->NumberOfResourcesInUse
));
212 for (Index
= 0; Index
< pSharedMemory
->NextAvailableIndex
; Index
++)
214 if (!pSharedMemory
->NetResources
[Index
].InUse
)
216 FreeEntryFound
= TRUE
;
217 DbgP((TEXT("Reusing existing index %d\n"), Index
));
224 if (pSharedMemory
->NextAvailableIndex
>= NFS41NP_MAX_DEVICES
) {
225 status
= WN_NO_MORE_DEVICES
;
228 Index
= pSharedMemory
->NextAvailableIndex
++;
229 DbgP((TEXT("Using new index %d\n"), Index
));
232 pSharedMemory
->NumberOfResourcesInUse
+= 1;
234 pNfs41NetResource
= &pSharedMemory
->NetResources
[Index
];
236 pNfs41NetResource
->InUse
= TRUE
;
237 pNfs41NetResource
->dwScope
= lpNetResource
->dwScope
;
238 pNfs41NetResource
->dwType
= lpNetResource
->dwType
;
239 pNfs41NetResource
->dwDisplayType
= lpNetResource
->dwDisplayType
;
240 pNfs41NetResource
->dwUsage
= RESOURCEUSAGE_CONNECTABLE
;
241 pNfs41NetResource
->LocalNameLength
= (USHORT
)(wcslen(LocalName
) + 1) * sizeof(WCHAR
);
242 pNfs41NetResource
->RemoteNameLength
= (USHORT
)(wcslen(lpNetResource
->lpRemoteName
) + 1) * sizeof(WCHAR
);
243 pNfs41NetResource
->ConnectionNameLength
= ConnectionNameLength
;
245 StringCchCopy(pNfs41NetResource
->LocalName
,
246 pNfs41NetResource
->LocalNameLength
,
248 StringCchCopy(pNfs41NetResource
->RemoteName
,
249 pNfs41NetResource
->RemoteNameLength
,
250 lpNetResource
->lpRemoteName
);
251 StringCchCopy(pNfs41NetResource
->ConnectionName
,
252 pNfs41NetResource
->ConnectionNameLength
,
255 // TODO: copy mount options -cbodley
259 CloseSharedMemory(&hMutex
, &hMemory
, (PVOID
*)&pSharedMemory
);
261 CloseSharedMemory(&hMutex
, &hMemory
, &(PVOID
)pSharedMemory
);
270 IN PVOID InputDataBuf
,
271 IN ULONG InputDataLen
,
272 IN PVOID OutputDataBuf
,
273 IN PULONG pOutputDataLen
)
275 HANDLE DeviceHandle
; // The mini rdr device handle
280 DbgP((L
"[aglo] calling CreateFile\n"));
281 DeviceHandle
= CreateFile(
282 NFS41_USER_DEVICE_NAME
,
283 GENERIC_READ
| GENERIC_WRITE
,
284 FILE_SHARE_READ
| FILE_SHARE_WRITE
,
285 (LPSECURITY_ATTRIBUTES
)NULL
,
290 DbgP((L
"[aglo] after CreateFile Device Handle\n"));
291 if ( INVALID_HANDLE_VALUE
!= DeviceHandle
)
294 DbgP((L
"[aglo] calling DeviceIoControl\n"));
295 rc
= DeviceIoControl(
304 } _SEH2_EXCEPT(_SEH2_GetExceptionCode()) {
305 DbgP((L
"#### In except\n"));
307 DbgP((L
"[aglo] returned from DeviceIoControl %08lx\n", rc
));
310 DbgP((L
"[aglo] SendTo_NFS41Driver: returning error from DeviceIoctl\n"));
311 Status
= GetLastError( );
315 DbgP((L
"[aglo] SendTo_NFS41Driver: The DeviceIoctl call succeded\n"));
317 CloseHandle(DeviceHandle
);
321 Status
= GetLastError( );
322 DbgP((L
"[aglo] SendTo_NFS41Driver: error %08lx opening device \n", Status
));
324 DbgP((L
"[aglo] returned from SendTo_NFS41Driver %08lx\n", Status
));
335 DbgP(( L
"[aglo] GetNetCaps %d\n", nIndex
));
339 case WNNC_SPEC_VERSION
:
340 rc
= WNNC_SPEC_VERSION51
;
344 rc
= WNNC_NET_RDR2SAMPLE
;
347 case WNNC_DRIVER_VERSION
:
348 rc
= WNNC_DRIVER(1, 0);
351 case WNNC_CONNECTION
:
352 rc
= WNNC_CON_GETCONNECTIONS
|
353 WNNC_CON_CANCELCONNECTION
|
354 WNNC_CON_ADDCONNECTION
|
355 WNNC_CON_ADDCONNECTION3
;
358 case WNNC_ENUMERATION
:
359 rc
= WNNC_ENUM_LOCAL
;
379 __in PLUID lpLogonId
,
380 __in PCWSTR lpAuthentInfoType
,
381 __in PVOID lpAuthentInfo
,
382 __in PCWSTR lpPreviousAuthentInfoType
,
383 __in PVOID lpPreviousAuthentInfo
,
384 __in PWSTR lpStationName
,
385 __in PVOID StationHandle
,
386 __out PWSTR
*lpLogonScript
)
388 *lpLogonScript
= NULL
;
389 DbgP(( L
"[aglo] NPLogonNotify: returning WN_SUCCESS\n" ));
394 NPPasswordChangeNotify (
395 __in LPCWSTR lpAuthentInfoType
,
396 __in LPVOID lpAuthentInfo
,
397 __in LPCWSTR lpPreviousAuthentInfoType
,
398 __in LPVOID lpPreviousAuthentInfo
,
399 __in LPWSTR lpStationName
,
400 LPVOID StationHandle
,
403 DbgP(( L
"[aglo] NPPasswordChangeNotify: WN_NOT_SUPPORTED\n" ));
404 SetLastError( WN_NOT_SUPPORTED
);
405 return WN_NOT_SUPPORTED
;
412 __in LPNETRESOURCE lpNetResource
,
413 __in_opt LPWSTR lpPassword
,
414 __in_opt LPWSTR lpUserName
,
420 __in LPNETRESOURCE lpNetResource
,
421 __in_opt LPWSTR lpPassword
,
422 __in_opt LPWSTR lpUserName
)
424 return NPAddConnection3( NULL
, lpNetResource
, lpPassword
, lpUserName
, 0 );
430 __in LPNETRESOURCE lpNetResource
,
431 __in_opt LPWSTR lpPassword
,
432 __in_opt LPWSTR lpUserName
,
436 WCHAR wszScratch
[128];
439 CONNECTION_INFO Connection
;
440 LPWSTR ConnectionName
;
441 WCHAR ServerName
[MAX_PATH
];
445 DbgP(( L
"[aglo] NPAddConnection3('%s', '%s')\n",
446 lpNetResource
->lpLocalName
, lpNetResource
->lpRemoteName
));
447 DbgP(( L
"[aglo] username = '%s', passwd = '%s'\n", lpUserName
, lpPassword
));
449 Status
= InitializeConnectionInfo(&Connection
,
450 (PMOUNT_OPTION_BUFFER
)lpNetResource
->lpComment
,
453 DbgP(( L
"InitializeConnectionInfo failed with %d\n", Status
));
457 // \device\miniredirector\;<DriveLetter>:\Server\Share
459 // local name, must start with "X:"
460 if (lstrlen(lpNetResource
->lpLocalName
) < 2 ||
461 lpNetResource
->lpLocalName
[1] != L
':') {
462 Status
= WN_BAD_LOCALNAME
;
466 LocalName
[0] = (WCHAR
) toupper(lpNetResource
->lpLocalName
[0]);
468 LocalName
[2] = L
'\0';
469 StringCchCopyW( ConnectionName
, MAX_PATH
, NFS41_DEVICE_NAME
);
470 StringCchCatW( ConnectionName
, MAX_PATH
, L
"\\;" );
471 StringCchCatW( ConnectionName
, MAX_PATH
, LocalName
);
473 // remote name, must start with "\\"
474 if (lpNetResource
->lpRemoteName
[0] == L
'\0' ||
475 lpNetResource
->lpRemoteName
[0] != L
'\\' ||
476 lpNetResource
->lpRemoteName
[1] != L
'\\') {
477 Status
= WN_BAD_NETNAME
;
481 /* note: remotename comes as \\server but we need to add \server thus +1 pointer */
482 p
= lpNetResource
->lpRemoteName
+ 1;
483 ServerName
[0] = L
'\\';
486 /* convert servername ending unix slash to windows slash */
489 /* deal with servername ending with any slash */
492 ServerName
[i
] = p
[i
];
493 if (p
[i
] == L
'\\') break;
496 ServerName
[i
] = L
'\0';
497 StringCchCatW( ConnectionName
, MAX_PATH
, ServerName
);
498 /* insert the "nfs4" in between the server name and the path,
499 * just to make sure all calls to our driver come thru this */
500 StringCchCatW( ConnectionName
, MAX_PATH
, L
"\\nfs4" );
502 #ifdef CONVERT_2_UNIX_SLASHES
503 /* convert all windows slashes to unix slashes */
508 if(q
[j
] == L
'\0') break;
509 if (q
[j
] == L
'\\') q
[j
] = L
'/';
514 /* convert all unix slashes to windows slashes */
519 if(q
[j
] == L
'\0') break;
520 if (q
[j
] == L
'/') q
[j
] = L
'\\';
525 StringCchCatW( ConnectionName
, MAX_PATH
, &p
[i
]);
526 DbgP(( L
"[aglo] Full Connect Name: %s\n", ConnectionName
));
527 DbgP(( L
"[aglo] Full Connect Name Length: %d %d\n",
528 (wcslen(ConnectionName
) + 1) * sizeof(WCHAR
),
529 (lstrlen(ConnectionName
) + 1) * sizeof(WCHAR
)));
531 if ( QueryDosDevice( LocalName
, wszScratch
, 128 )
532 || GetLastError() != ERROR_FILE_NOT_FOUND
) {
533 Status
= WN_ALREADY_CONNECTED
;
537 MarshalConnectionInfo(&Connection
);
539 Status
= SendTo_NFS41Driver( IOCTL_NFS41_ADDCONN
,
540 Connection
.Buffer
, Connection
.BufferSize
,
543 DbgP(( L
"[aglo] SendTo_NFS41Driver failed with %d\n", Status
));
547 DbgP(( L
"[aglo] calling DefineDosDevice\n"));
548 if ( !DefineDosDevice( DDD_RAW_TARGET_PATH
|
549 DDD_NO_BROADCAST_SYSTEM
,
550 lpNetResource
->lpLocalName
,
552 Status
= GetLastError();
553 DbgP(( L
"[aglo] DefineDosDevice failed with %d\n", Status
));
557 // The connection was established and the local device mapping
558 // added. Include this in the list of mapped devices.
559 Status
= StoreConnectionInfo(LocalName
, ConnectionName
,
560 Connection
.Buffer
->NameLength
, lpNetResource
);
562 DbgP(( L
"[aglo] StoreConnectionInfo failed with %d\n", Status
));
567 FreeConnectionInfo(&Connection
);
568 DbgP(( L
"[aglo] NPAddConnection3: status %08X\n", Status
));
571 DefineDosDevice(DDD_REMOVE_DEFINITION
| DDD_RAW_TARGET_PATH
|
572 DDD_EXACT_MATCH_ON_REMOVE
, LocalName
, ConnectionName
);
574 SendTo_NFS41Driver(IOCTL_NFS41_DELCONN
, ConnectionName
,
575 Connection
.Buffer
->NameLength
, NULL
, &CopyBytes
);
586 HANDLE hMutex
, hMemory
;
587 PNFS41NP_SHARED_MEMORY pSharedMemory
;
589 DbgP((TEXT("NPCancelConnection\n")));
590 DbgP((TEXT("NPCancelConnection: ConnectionName: %S\n"), lpName
));
592 Status
= OpenSharedMemory( &hMutex
,
594 (PVOID
)&pSharedMemory
);
596 if (Status
== WN_SUCCESS
)
599 PNFS41NP_NETRESOURCE pNetResource
;
600 Status
= WN_NOT_CONNECTED
;
602 DbgP((TEXT("NPCancelConnection: NextIndex %d, NumResources %d\n"),
603 pSharedMemory
->NextAvailableIndex
,
604 pSharedMemory
->NumberOfResourcesInUse
));
606 for (Index
= 0; Index
< pSharedMemory
->NextAvailableIndex
; Index
++)
608 pNetResource
= &pSharedMemory
->NetResources
[Index
];
610 if (pNetResource
->InUse
)
612 if ( ( (wcslen(lpName
) + 1) * sizeof(WCHAR
) ==
613 pNetResource
->LocalNameLength
)
614 && ( !wcscmp(lpName
, pNetResource
->LocalName
) ))
618 DbgP((TEXT("NPCancelConnection: Connection Found:\n")));
622 Status
= SendTo_NFS41Driver( IOCTL_NFS41_DELCONN
,
623 pNetResource
->ConnectionName
,
624 pNetResource
->ConnectionNameLength
,
628 if (Status
!= WN_SUCCESS
)
630 DbgP((TEXT("NPCancelConnection: SendToMiniRdr returned Status %lx\n"),Status
));
634 if (DefineDosDevice(DDD_REMOVE_DEFINITION
| DDD_RAW_TARGET_PATH
| DDD_EXACT_MATCH_ON_REMOVE
,
636 pNetResource
->ConnectionName
) == FALSE
)
638 DbgP((TEXT("RemoveDosDevice: DefineDosDevice error: %d\n"), GetLastError()));
639 Status
= GetLastError();
643 pNetResource
->InUse
= FALSE
;
644 pSharedMemory
->NumberOfResourcesInUse
--;
646 if (Index
+1 == pSharedMemory
->NextAvailableIndex
)
647 pSharedMemory
->NextAvailableIndex
--;
652 DbgP((TEXT("NPCancelConnection: Name %S EntryName %S\n"),
653 lpName
,pNetResource
->LocalName
));
655 DbgP((TEXT("NPCancelConnection: Name Length %d Entry Name Length %d\n"),
656 pNetResource
->LocalNameLength
,pNetResource
->LocalName
));
658 DbgP((TEXT("NPCancelConnection: Name Length %d Entry Name Length %d\n"),
659 (wcslen(lpName
) + 1) * sizeof(WCHAR
), pNetResource
->LocalNameLength
));
665 CloseSharedMemory( &hMutex
,
667 (PVOID
)&pSharedMemory
);
675 __in LPWSTR lpLocalName
,
676 __out_bcount(*lpBufferSize
) LPWSTR lpRemoteName
,
677 __inout LPDWORD lpBufferSize
)
681 HANDLE hMutex
, hMemory
;
682 PNFS41NP_SHARED_MEMORY pSharedMemory
;
684 Status
= OpenSharedMemory( &hMutex
,
686 (PVOID
)&pSharedMemory
);
688 if (Status
== WN_SUCCESS
)
691 PNFS41NP_NETRESOURCE pNetResource
;
692 Status
= WN_NOT_CONNECTED
;
694 for (Index
= 0; Index
< pSharedMemory
->NextAvailableIndex
; Index
++)
696 pNetResource
= &pSharedMemory
->NetResources
[Index
];
698 if (pNetResource
->InUse
)
700 if ( ( (wcslen(lpLocalName
) + 1) * sizeof(WCHAR
) ==
701 pNetResource
->LocalNameLength
)
702 && ( !wcscmp(lpLocalName
, pNetResource
->LocalName
) ))
704 if (*lpBufferSize
< pNetResource
->RemoteNameLength
)
706 *lpBufferSize
= pNetResource
->RemoteNameLength
;
707 Status
= WN_MORE_DATA
;
711 *lpBufferSize
= pNetResource
->RemoteNameLength
;
712 CopyMemory( lpRemoteName
,
713 pNetResource
->RemoteName
,
714 pNetResource
->RemoteNameLength
);
722 CloseSharedMemory( &hMutex
, &hMemory
, (PVOID
)&pSharedMemory
);
733 LPNETRESOURCE lpNetResource
,
738 DbgP((L
"[aglo] NPOpenEnum\n"));
744 case RESOURCE_CONNECTED
:
746 *lphEnum
= HeapAlloc( GetProcessHeap( ), HEAP_ZERO_MEMORY
, sizeof( ULONG
) );
754 Status
= WN_OUT_OF_MEMORY
;
760 case RESOURCE_CONTEXT
:
762 Status
= WN_NOT_SUPPORTED
;
767 DbgP((L
"[aglo] NPOpenEnum returning Status %lx\n",Status
));
777 LPDWORD lpBufferSize
)
779 DWORD Status
= WN_SUCCESS
;
781 LPNETRESOURCE pNetResource
;
782 ULONG SpaceNeeded
= 0;
783 ULONG SpaceAvailable
;
785 HANDLE hMutex
, hMemory
;
786 PNFS41NP_SHARED_MEMORY pSharedMemory
;
787 PNFS41NP_NETRESOURCE pNfsNetResource
;
788 INT Index
= *(PULONG
)hEnum
;
791 DbgP((L
"[aglo] NPEnumResource\n"));
793 DbgP((L
"[aglo] NPEnumResource Count Requested %d\n", *lpcCount
));
795 pNetResource
= (LPNETRESOURCE
) lpBuffer
;
796 SpaceAvailable
= *lpBufferSize
;
798 StringZone
= (PWCHAR
) ((PBYTE
)lpBuffer
+ *lpBufferSize
);
800 Status
= OpenSharedMemory( &hMutex
,
802 (PVOID
)&pSharedMemory
);
804 if ( Status
== WN_SUCCESS
)
806 Status
= WN_NO_MORE_ENTRIES
;
807 for (Index
= *(PULONG
)hEnum
; EntriesCopied
< *lpcCount
&&
808 Index
< pSharedMemory
->NextAvailableIndex
; Index
++)
810 pNfsNetResource
= &pSharedMemory
->NetResources
[Index
];
812 if (pNfsNetResource
->InUse
)
814 SpaceNeeded
= sizeof( NETRESOURCE
);
815 SpaceNeeded
+= pNfsNetResource
->LocalNameLength
;
816 SpaceNeeded
+= pNfsNetResource
->RemoteNameLength
;
817 SpaceNeeded
+= 5 * sizeof(WCHAR
); // comment
818 SpaceNeeded
+= sizeof(NFS41_PROVIDER_NAME_U
); // provider name
819 if ( SpaceNeeded
> SpaceAvailable
)
821 Status
= WN_MORE_DATA
;
822 DbgP((L
"[aglo] NPEnumResource More Data Needed - %d\n", SpaceNeeded
));
823 *lpBufferSize
= SpaceNeeded
;
828 SpaceAvailable
-= SpaceNeeded
;
830 pNetResource
->dwScope
= pNfsNetResource
->dwScope
;
831 pNetResource
->dwType
= pNfsNetResource
->dwType
;
832 pNetResource
->dwDisplayType
= pNfsNetResource
->dwDisplayType
;
833 pNetResource
->dwUsage
= pNfsNetResource
->dwUsage
;
835 // setup string area at opposite end of buffer
836 SpaceNeeded
-= sizeof( NETRESOURCE
);
837 StringZone
= (PWCHAR
)( (PBYTE
) StringZone
- SpaceNeeded
);
839 StringCchCopy( StringZone
,
840 pNfsNetResource
->LocalNameLength
,
841 pNfsNetResource
->LocalName
);
842 pNetResource
->lpLocalName
= StringZone
;
843 StringZone
+= pNfsNetResource
->LocalNameLength
/sizeof(WCHAR
);
845 StringCchCopy( StringZone
,
846 pNfsNetResource
->RemoteNameLength
,
847 pNfsNetResource
->RemoteName
);
848 pNetResource
->lpRemoteName
= StringZone
;
849 StringZone
+= pNfsNetResource
->RemoteNameLength
/sizeof(WCHAR
);
851 pNetResource
->lpComment
= StringZone
;
852 *StringZone
++ = L
'A';
853 *StringZone
++ = L
'_';
854 *StringZone
++ = L
'O';
855 *StringZone
++ = L
'K';
856 *StringZone
++ = L
'\0';
857 // copy provider name
858 pNetResource
->lpProvider
= StringZone
;
859 StringCbCopyW( StringZone
, sizeof(NFS41_PROVIDER_NAME_U
), NFS41_PROVIDER_NAME_U
);
860 StringZone
+= sizeof(NFS41_PROVIDER_NAME_U
)/sizeof(WCHAR
);
862 // set new bottom of string zone
863 StringZone
= (PWCHAR
)( (PBYTE
) StringZone
- SpaceNeeded
);
869 CloseSharedMemory( &hMutex
, &hMemory
, (PVOID
*)&pSharedMemory
);
872 *lpcCount
= EntriesCopied
;
873 *(PULONG
) hEnum
= Index
;
875 DbgP((L
"[aglo] NPEnumResource entries returned: %d\n", EntriesCopied
));
884 DbgP((L
"[aglo] NPCloseEnum\n"));
885 HeapFree( GetProcessHeap( ), 0, (PVOID
) hEnum
);
891 LPNETRESOURCE lpNetResource
,
893 LPDWORD lpBufferSize
)
895 DbgP(( L
"[aglo] NPGetResourceParent: WN_NOT_SUPPORTED\n" ));
896 return WN_NOT_SUPPORTED
;
900 NPGetResourceInformation(
901 __in LPNETRESOURCE lpNetResource
,
902 __out_bcount(*lpBufferSize
) LPVOID lpBuffer
,
903 __inout LPDWORD lpBufferSize
,
904 __deref_out LPWSTR
*lplpSystem
)
906 DbgP(( L
"[aglo] NPGetResourceInformation: WN_NOT_SUPPORTED\n" ));
907 return WN_NOT_SUPPORTED
;
915 LPDWORD lpBufferSize
)
917 DbgP(( L
"[aglo] NPGetUniversalName: WN_NOT_SUPPORTED\n" ));
918 return WN_NOT_SUPPORTED
;