ReactOS 0.4.16-dev-1946-g52006dd
nfs41_np.c File Reference
#include <windows.h>
#include <npapi.h>
#include <devioctl.h>
#include <strsafe.h>
#include "nfs41_driver.h"
#include "nfs41_np.h"
#include "options.h"
#include <pseh/pseh2.h>
Include dependency graph for nfs41_np.c:

Go to the source code of this file.

Macros

#define DbgP(_x_)
 
#define TRACE_TAG   L"[NFS41_NP]"
 
#define WNNC_DRIVER(major, minor)   ( major * 0x00010000 + minor )
 

Functions

ULONG _cdecl NFS41DbgPrint (__in LPTSTR Format,...)
 
int filter (unsigned int code)
 
DWORD OpenSharedMemory (PHANDLE phMutex, PHANDLE phMemory, PVOID *pMemory)
 
VOID CloseSharedMemory (PHANDLE hMutex, PHANDLE hMemory, PVOID *pMemory)
 
static DWORD StoreConnectionInfo (IN LPCWSTR LocalName, IN LPCWSTR ConnectionName, IN USHORT ConnectionNameLength, IN LPNETRESOURCE lpNetResource)
 
ULONG SendTo_NFS41Driver (IN ULONG IoctlCode, IN PVOID InputDataBuf, IN ULONG InputDataLen, IN PVOID OutputDataBuf, IN PULONG pOutputDataLen)
 
DWORD APIENTRY NPGetCaps (DWORD nIndex)
 
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)
 
DWORD APIENTRY NPPasswordChangeNotify (__in LPCWSTR lpAuthentInfoType, __in LPVOID lpAuthentInfo, __in LPCWSTR lpPreviousAuthentInfoType, __in LPVOID lpPreviousAuthentInfo, __in LPWSTR lpStationName, LPVOID StationHandle, DWORD dwChangeInfo)
 
DWORD APIENTRY NPAddConnection (__in LPNETRESOURCE lpNetResource, __in_opt LPWSTR lpPassword, __in_opt LPWSTR lpUserName)
 
DWORD APIENTRY NPAddConnection3 (__in HWND hwndOwner, __in LPNETRESOURCE lpNetResource, __in_opt LPWSTR lpPassword, __in_opt LPWSTR lpUserName, __in DWORD dwFlags)
 
DWORD APIENTRY NPCancelConnection (__in LPWSTR lpName, __in BOOL fForce)
 
DWORD APIENTRY NPGetConnection (__in LPWSTR lpLocalName, __out_bcount(*lpBufferSize) LPWSTR lpRemoteName, __inout LPDWORD lpBufferSize)
 
DWORD APIENTRY NPOpenEnum (DWORD dwScope, DWORD dwType, DWORD dwUsage, LPNETRESOURCE lpNetResource, LPHANDLE lphEnum)
 
DWORD APIENTRY NPEnumResource (HANDLE hEnum, LPDWORD lpcCount, LPVOID lpBuffer, LPDWORD lpBufferSize)
 
DWORD APIENTRY NPCloseEnum (HANDLE hEnum)
 
DWORD APIENTRY NPGetResourceParent (LPNETRESOURCE lpNetResource, LPVOID lpBuffer, LPDWORD lpBufferSize)
 
DWORD APIENTRY NPGetResourceInformation (__in LPNETRESOURCE lpNetResource, __out_bcount(*lpBufferSize) LPVOID lpBuffer, __inout LPDWORD lpBufferSize, __deref_out LPWSTR *lplpSystem)
 
DWORD APIENTRY NPGetUniversalName (LPCWSTR lpLocalPath, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpBufferSize)
 

Macro Definition Documentation

◆ DbgP

#define DbgP (   _x_)

Definition at line 36 of file nfs41_np.c.

◆ TRACE_TAG

#define TRACE_TAG   L"[NFS41_NP]"

Definition at line 38 of file nfs41_np.c.

◆ WNNC_DRIVER

#define WNNC_DRIVER (   major,
  minor 
)    ( major * 0x00010000 + minor )

Definition at line 39 of file nfs41_np.c.

Function Documentation

◆ CloseSharedMemory()

VOID CloseSharedMemory ( PHANDLE  hMutex,
PHANDLE  hMemory,
PVOID pMemory 
)

Definition at line 149 of file nfs41_np.c.

171{
172 if (*pMemory)
173 {
175 *pMemory = NULL;
176 }
177 if (*hMemory)
178 {
180 *hMemory = 0;
181 }
182 if (*hMutex)
183 {
184 if (ReleaseMutex(*hMutex) == FALSE)
185 {
186 DbgP((TEXT("CloseSharedMemory: ReleaseMutex error: %d\n"), GetLastError()));
187 }
189 *hMutex = 0;
190 }
191}
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define UnmapViewOfFile
Definition: compat.h:746
FxMemoryObject * pMemory
WDFMEMORY hMemory
#define TEXT(s)
Definition: k32.h:28
HANDLE hMutex
Definition: mutex.c:11
#define DbgP(_x_)
Definition: nfs41_np.c:36
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:618
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by NPCancelConnection(), NPEnumResource(), NPGetConnection(), and StoreConnectionInfo().

◆ filter()

int filter ( unsigned int  code)

Definition at line 67 of file nfs41_np.c.

68{
69 DbgP((L"####Got exception %u\n", code));
71}
#define L(x)
Definition: resources.c:13
#define EXCEPTION_CONTINUE_SEARCH
Definition: excpt.h:91
Definition: inflate.c:139

◆ NFS41DbgPrint()

ULONG _cdecl NFS41DbgPrint ( __in LPTSTR  Format,
  ... 
)

Definition at line 42 of file nfs41_np.c.

43{
44 ULONG rc = 0;
45 TCHAR szbuffer[256];
46
49 {
50#ifndef __REACTOS__
51 //StringCchVPrintfW( szbuffer, 127, Format, marker );
52 StringCchVPrintfW( szbuffer, 256, Format, marker );
53 szbuffer[255] = (TCHAR)0;
54#else
55 StringCchVPrintf( szbuffer, 256, Format, marker );
56#endif
58 OutputDebugString( szbuffer );
59 }
60#ifdef __REACTOS__
62#endif
63
64 return rc;
65}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
int marker
Definition: jpeglib.h:1030
#define TRACE_TAG
Definition: nfs41_np.c:38
#define StringCchVPrintf
Definition: strsafe.h:482
STRSAFEAPI StringCchVPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat, va_list argList)
Definition: strsafe.h:490
uint32_t ULONG
Definition: typedefs.h:59
#define OutputDebugString
Definition: winbase.h:3639
char TCHAR
Definition: xmlstorage.h:189

◆ NPAddConnection()

DWORD APIENTRY NPAddConnection ( __in LPNETRESOURCE  lpNetResource,
__in_opt LPWSTR  lpPassword,
__in_opt LPWSTR  lpUserName 
)

Definition at line 425 of file nfs41_np.c.

429{
430 return NPAddConnection3( NULL, lpNetResource, lpPassword, lpUserName, 0 );
431}
DWORD APIENTRY NPAddConnection3(__in HWND hwndOwner, __in LPNETRESOURCE lpNetResource, __in_opt LPWSTR lpPassword, __in_opt LPWSTR lpUserName, __in DWORD dwFlags)
Definition: nfs41_np.c:434

Referenced by _tryLoadProvider().

◆ NPAddConnection3()

DWORD APIENTRY NPAddConnection3 ( __in HWND  hwndOwner,
__in LPNETRESOURCE  lpNetResource,
__in_opt LPWSTR  lpPassword,
__in_opt LPWSTR  lpUserName,
__in DWORD  dwFlags 
)

Definition at line 434 of file nfs41_np.c.

440{
442 WCHAR wszScratch[128];
443 WCHAR LocalName[3];
444 DWORD CopyBytes = 0;
445 CONNECTION_INFO Connection;
446 LPWSTR ConnectionName;
447 WCHAR ServerName[MAX_PATH];
448 PWCHAR p;
449 DWORD i;
450
451 DbgP(( L"[aglo] NPAddConnection3('%s', '%s')\n",
452 lpNetResource->lpLocalName, lpNetResource->lpRemoteName ));
453 DbgP(( L"[aglo] username = '%s', passwd = '%s'\n", lpUserName, lpPassword));
454
455 Status = InitializeConnectionInfo(&Connection,
456 (PMOUNT_OPTION_BUFFER)lpNetResource->lpComment,
457 &ConnectionName);
458 if (Status) {
459 DbgP(( L"InitializeConnectionInfo failed with %d\n", Status ));
460 goto out;
461 }
462
463 // \device\miniredirector\;<DriveLetter>:\Server\Share
464
465 // local name, must start with "X:"
466 if (lstrlen(lpNetResource->lpLocalName) < 2 ||
467 lpNetResource->lpLocalName[1] != L':') {
469 goto out;
470 }
471
472 LocalName[0] = (WCHAR) toupper(lpNetResource->lpLocalName[0]);
473 LocalName[1] = L':';
474 LocalName[2] = L'\0';
475 StringCchCopyW( ConnectionName, MAX_PATH, NFS41_DEVICE_NAME );
476 StringCchCatW( ConnectionName, MAX_PATH, L"\\;" );
477 StringCchCatW( ConnectionName, MAX_PATH, LocalName );
478
479 // remote name, must start with "\\"
480 if (lpNetResource->lpRemoteName[0] == L'\0' ||
481 lpNetResource->lpRemoteName[0] != L'\\' ||
482 lpNetResource->lpRemoteName[1] != L'\\') {
484 goto out;
485 }
486
487 /* note: remotename comes as \\server but we need to add \server thus +1 pointer */
488 p = lpNetResource->lpRemoteName + 1;
489 ServerName[0] = L'\\';
490 i = 1;
491 for(;;) {
492 /* convert servername ending unix slash to windows slash */
493 if (p[i] == L'/')
494 p[i] = L'\\';
495 /* deal with servername ending with any slash */
496 if (p[i] == L'\0')
497 p[i] = L'\\';
498 ServerName[i] = p[i];
499 if (p[i] == L'\\') break;
500 i++;
501 }
502 ServerName[i] = L'\0';
503 StringCchCatW( ConnectionName, MAX_PATH, ServerName);
504 /* insert the "nfs4" in between the server name and the path,
505 * just to make sure all calls to our driver come thru this */
506 StringCchCatW( ConnectionName, MAX_PATH, L"\\nfs4" );
507
508#ifdef CONVERT_2_UNIX_SLASHES
509 /* convert all windows slashes to unix slashes */
510 {
511 PWCHAR q = p;
512 DWORD j = 0;
513 for(;;) {
514 if(q[j] == L'\0') break;
515 if (q[j] == L'\\') q[j] = L'/';
516 j++;
517 }
518 }
519#else
520 /* convert all unix slashes to windows slashes */
521 {
522 PWCHAR q = p;
523 DWORD j = 0;
524 for(;;) {
525 if(q[j] == L'\0') break;
526 if (q[j] == L'/') q[j] = L'\\';
527 j++;
528 }
529 }
530#endif
531 StringCchCatW( ConnectionName, MAX_PATH, &p[i]);
532 DbgP(( L"[aglo] Full Connect Name: %s\n", ConnectionName ));
533 DbgP(( L"[aglo] Full Connect Name Length: %d %d\n",
534 (wcslen(ConnectionName) + 1) * sizeof(WCHAR),
535 (lstrlen(ConnectionName) + 1) * sizeof(WCHAR)));
536
537 if ( QueryDosDevice( LocalName, wszScratch, 128 )
540 goto out;
541 }
542
543 MarshalConnectionInfo(&Connection);
544
546 Connection.Buffer, Connection.BufferSize,
547 NULL, &CopyBytes );
548 if (Status) {
549 DbgP(( L"[aglo] SendTo_NFS41Driver failed with %d\n", Status));
550 goto out;
551 }
552
553 DbgP(( L"[aglo] calling DefineDosDevice\n"));
556 lpNetResource->lpLocalName,
557 ConnectionName ) ) {
559 DbgP(( L"[aglo] DefineDosDevice failed with %d\n", Status));
560 goto out_delconn;
561 }
562
563 // The connection was established and the local device mapping
564 // added. Include this in the list of mapped devices.
565 Status = StoreConnectionInfo(LocalName, ConnectionName,
566 Connection.Buffer->NameLength, lpNetResource);
567 if (Status) {
568 DbgP(( L"[aglo] StoreConnectionInfo failed with %d\n", Status));
569 goto out_undefine;
570 }
571
572out:
573 FreeConnectionInfo(&Connection);
574 DbgP(( L"[aglo] NPAddConnection3: status %08X\n", Status));
575 return Status;
576out_undefine:
578 DDD_EXACT_MATCH_ON_REMOVE, LocalName, ConnectionName);
579out_delconn:
581 Connection.Buffer->NameLength, NULL, &CopyBytes);
582 goto out;
583}
int toupper(int c)
Definition: utclib.c:881
void MarshalConnectionInfo(IN OUT PCONNECTION_INFO Connection)
Definition: options.c:68
DWORD InitializeConnectionInfo(IN OUT PCONNECTION_INFO Connection, IN PMOUNT_OPTION_BUFFER Options, OUT LPWSTR *ConnectionName)
Definition: options.c:26
void FreeConnectionInfo(IN PCONNECTION_INFO Connection)
Definition: options.c:92
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
Status
Definition: gdiplustypes.h:25
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
GLfloat GLfloat p
Definition: glext.h:8902
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define NFS41_DEVICE_NAME
Definition: nfs41_driver.h:25
#define IOCTL_NFS41_ADDCONN
Definition: nfs41_driver.h:46
#define IOCTL_NFS41_DELCONN
Definition: nfs41_driver.h:47
static DWORD StoreConnectionInfo(IN LPCWSTR LocalName, IN LPCWSTR ConnectionName, IN USHORT ConnectionNameLength, IN LPNETRESOURCE lpNetResource)
Definition: nfs41_np.c:193
ULONG SendTo_NFS41Driver(IN ULONG IoctlCode, IN PVOID InputDataBuf, IN ULONG InputDataLen, IN PVOID OutputDataBuf, IN PULONG pOutputDataLen)
Definition: nfs41_np.c:274
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
USHORT NameLength
Definition: options.h:45
ULONG BufferSize
Definition: options.h:57
PCONNECTION_BUFFER Buffer
Definition: options.h:58
uint16_t * PWCHAR
Definition: typedefs.h:56
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
#define DDD_NO_BROADCAST_SYSTEM
Definition: winbase.h:506
#define DDD_EXACT_MATCH_ON_REMOVE
Definition: winbase.h:505
#define DDD_RAW_TARGET_PATH
Definition: winbase.h:503
#define DDD_REMOVE_DEFINITION
Definition: winbase.h:504
#define DefineDosDevice
Definition: winbase.h:3512
#define lstrlen
Definition: winbase.h:3625
#define QueryDosDevice
Definition: winbase.h:3641
#define WN_BAD_LOCALNAME
Definition: winnetwk.h:136
#define WN_ALREADY_CONNECTED
Definition: winnetwk.h:137
#define WN_BAD_NETNAME
Definition: winnetwk.h:135
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by _tryLoadProvider(), and NPAddConnection().

◆ NPCancelConnection()

DWORD APIENTRY NPCancelConnection ( __in LPWSTR  lpName,
__in BOOL  fForce 
)

Definition at line 586 of file nfs41_np.c.

589{
590 DWORD Status = 0;
591
593 PNFS41NP_SHARED_MEMORY pSharedMemory;
594
595 DbgP((TEXT("NPCancelConnection\n")));
596 DbgP((TEXT("NPCancelConnection: ConnectionName: %S\n"), lpName));
597
599 &hMemory,
600 (PVOID)&pSharedMemory);
601
602 if (Status == WN_SUCCESS)
603 {
604 INT Index;
605 PNFS41NP_NETRESOURCE pNetResource;
607
608 DbgP((TEXT("NPCancelConnection: NextIndex %d, NumResources %d\n"),
609 pSharedMemory->NextAvailableIndex,
610 pSharedMemory->NumberOfResourcesInUse));
611
612 for (Index = 0; Index < pSharedMemory->NextAvailableIndex; Index++)
613 {
614 pNetResource = &pSharedMemory->NetResources[Index];
615
616 if (pNetResource->InUse)
617 {
618 if ( ( (wcslen(lpName) + 1) * sizeof(WCHAR) ==
619 pNetResource->LocalNameLength)
620 && ( !wcscmp(lpName, pNetResource->LocalName) ))
621 {
622 ULONG CopyBytes;
623
624 DbgP((TEXT("NPCancelConnection: Connection Found:\n")));
625
626 CopyBytes = 0;
627
629 pNetResource->ConnectionName,
630 pNetResource->ConnectionNameLength,
631 NULL,
632 &CopyBytes );
633
634 if (Status != WN_SUCCESS)
635 {
636 DbgP((TEXT("NPCancelConnection: SendToMiniRdr returned Status %lx\n"),Status));
637 break;
638 }
639
641 lpName,
642 pNetResource->ConnectionName) == FALSE)
643 {
644 DbgP((TEXT("RemoveDosDevice: DefineDosDevice error: %d\n"), GetLastError()));
646 }
647 else
648 {
649 pNetResource->InUse = FALSE;
650 pSharedMemory->NumberOfResourcesInUse--;
651
652 if (Index+1 == pSharedMemory->NextAvailableIndex)
653 pSharedMemory->NextAvailableIndex--;
654 }
655 break;
656 }
657
658 DbgP((TEXT("NPCancelConnection: Name %S EntryName %S\n"),
659 lpName,pNetResource->LocalName));
660#ifndef __REACTOS__
661 DbgP((TEXT("NPCancelConnection: Name Length %d Entry Name Length %d\n"),
662 pNetResource->LocalNameLength,pNetResource->LocalName));
663#else
664 DbgP((TEXT("NPCancelConnection: Name Length %d Entry Name Length %d\n"),
665 (wcslen(lpName) + 1) * sizeof(WCHAR), pNetResource->LocalNameLength));
666#endif
667
668 }
669 }
670
672 &hMemory,
673 (PVOID)&pSharedMemory);
674 }
675
676 return Status;
677}
VOID CloseSharedMemory(PHANDLE hMutex, PHANDLE hMemory, PVOID *pMemory)
Definition: nfs41_np.c:149
DWORD OpenSharedMemory(PHANDLE phMutex, PHANDLE phMemory, PVOID *pMemory)
Definition: nfs41_np.c:74
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
WCHAR LocalName[MAX_PATH]
Definition: nfs41_np.h:38
USHORT LocalNameLength
Definition: nfs41_np.h:31
USHORT ConnectionNameLength
Definition: nfs41_np.h:33
WCHAR ConnectionName[MAX_PATH]
Definition: nfs41_np.h:40
NFS41NP_NETRESOURCE NetResources[NFS41NP_MAX_DEVICES]
Definition: nfs41_np.h:47
int32_t INT
Definition: typedefs.h:58
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ LPCSTR lpName
Definition: winbase.h:2543
#define WN_NOT_CONNECTED
Definition: winnetwk.h:132
#define WN_SUCCESS
Definition: winnetwk.h:111

Referenced by _tryLoadProvider().

◆ NPCloseEnum()

DWORD APIENTRY NPCloseEnum ( HANDLE  hEnum)

Definition at line 887 of file nfs41_np.c.

889{
890 DbgP((L"[aglo] NPCloseEnum\n"));
891 HeapFree( GetProcessHeap( ), 0, (PVOID) hEnum );
892 return WN_SUCCESS;
893}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735

Referenced by _tryLoadProvider().

◆ NPEnumResource()

DWORD APIENTRY NPEnumResource ( HANDLE  hEnum,
LPDWORD  lpcCount,
LPVOID  lpBuffer,
LPDWORD  lpBufferSize 
)

Definition at line 779 of file nfs41_np.c.

784{
786 ULONG EntriesCopied;
787 LPNETRESOURCE pNetResource;
788 ULONG SpaceNeeded = 0;
789 ULONG SpaceAvailable;
790 PWCHAR StringZone;
792 PNFS41NP_SHARED_MEMORY pSharedMemory;
793 PNFS41NP_NETRESOURCE pNfsNetResource;
794 INT Index = *(PULONG)hEnum;
795
796
797 DbgP((L"[aglo] NPEnumResource\n"));
798
799 DbgP((L"[aglo] NPEnumResource Count Requested %d\n", *lpcCount));
800
801 pNetResource = (LPNETRESOURCE) lpBuffer;
802 SpaceAvailable = *lpBufferSize;
803 EntriesCopied = 0;
804 StringZone = (PWCHAR) ((PBYTE)lpBuffer + *lpBufferSize);
805
807 &hMemory,
808 (PVOID)&pSharedMemory);
809
810 if ( Status == WN_SUCCESS)
811 {
813 for (Index = *(PULONG)hEnum; EntriesCopied < *lpcCount &&
814 Index < pSharedMemory->NextAvailableIndex; Index++)
815 {
816 pNfsNetResource = &pSharedMemory->NetResources[Index];
817
818 if (pNfsNetResource->InUse)
819 {
820 SpaceNeeded = sizeof( NETRESOURCE );
821 SpaceNeeded += pNfsNetResource->LocalNameLength;
822 SpaceNeeded += pNfsNetResource->RemoteNameLength;
823 SpaceNeeded += 5 * sizeof(WCHAR); // comment
824 SpaceNeeded += sizeof(NFS41_PROVIDER_NAME_U); // provider name
825 if ( SpaceNeeded > SpaceAvailable )
826 {
828 DbgP((L"[aglo] NPEnumResource More Data Needed - %d\n", SpaceNeeded));
829 *lpBufferSize = SpaceNeeded;
830 break;
831 }
832 else
833 {
834 SpaceAvailable -= SpaceNeeded;
835
836 pNetResource->dwScope = pNfsNetResource->dwScope;
837 pNetResource->dwType = pNfsNetResource->dwType;
838 pNetResource->dwDisplayType = pNfsNetResource->dwDisplayType;
839 pNetResource->dwUsage = pNfsNetResource->dwUsage;
840
841 // setup string area at opposite end of buffer
842 SpaceNeeded -= sizeof( NETRESOURCE );
843 StringZone = (PWCHAR)( (PBYTE) StringZone - SpaceNeeded );
844 // copy local name
845 StringCchCopy( StringZone,
846 pNfsNetResource->LocalNameLength,
847 pNfsNetResource->LocalName );
848 pNetResource->lpLocalName = StringZone;
849 StringZone += pNfsNetResource->LocalNameLength/sizeof(WCHAR);
850 // copy remote name
851 StringCchCopy( StringZone,
852 pNfsNetResource->RemoteNameLength,
853 pNfsNetResource->RemoteName );
854 pNetResource->lpRemoteName = StringZone;
855 StringZone += pNfsNetResource->RemoteNameLength/sizeof(WCHAR);
856 // copy comment
857 pNetResource->lpComment = StringZone;
858 *StringZone++ = L'A';
859 *StringZone++ = L'_';
860 *StringZone++ = L'O';
861 *StringZone++ = L'K';
862 *StringZone++ = L'\0';
863 // copy provider name
864 pNetResource->lpProvider = StringZone;
866 StringZone += sizeof(NFS41_PROVIDER_NAME_U)/sizeof(WCHAR);
867 EntriesCopied++;
868 // set new bottom of string zone
869 StringZone = (PWCHAR)( (PBYTE) StringZone - SpaceNeeded );
871 }
872 pNetResource++;
873 }
874 }
875 CloseSharedMemory( &hMutex, &hMemory, (PVOID*)&pSharedMemory);
876 }
877
878 *lpcCount = EntriesCopied;
879 *(PULONG) hEnum = Index;
880
881 DbgP((L"[aglo] NPEnumResource entries returned: %d\n", EntriesCopied));
882
883 return Status;
884}
_Out_ LPWSTR lpBuffer
Definition: netsh.h:68
#define NFS41_PROVIDER_NAME_U
Definition: nfs41_driver.h:30
BYTE * PBYTE
Definition: pedump.c:66
#define StringCchCopy
Definition: strsafe.h:139
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
LPSTR lpLocalName
Definition: winnetwk.h:171
DWORD dwDisplayType
Definition: winnetwk.h:169
LPSTR lpComment
Definition: winnetwk.h:173
DWORD dwScope
Definition: winnetwk.h:167
LPSTR lpProvider
Definition: winnetwk.h:174
LPSTR lpRemoteName
Definition: winnetwk.h:172
DWORD dwUsage
Definition: winnetwk.h:170
DWORD dwType
Definition: winnetwk.h:168
WCHAR RemoteName[MAX_PATH]
Definition: nfs41_np.h:39
USHORT RemoteNameLength
Definition: nfs41_np.h:32
uint32_t * PULONG
Definition: typedefs.h:59
NETRESOURCEA NETRESOURCE
Definition: winnetwk.h:593
#define WN_MORE_DATA
Definition: winnetwk.h:117
NETRESOURCEA * LPNETRESOURCE
Definition: winnetwk.h:593
#define WN_NO_MORE_ENTRIES
Definition: winnetwk.h:146

Referenced by _tryLoadProvider().

◆ NPGetCaps()

DWORD APIENTRY NPGetCaps ( DWORD  nIndex)

Definition at line 335 of file nfs41_np.c.

337{
338 DWORD rc = 0;
339
340#ifndef __REACTOS__
341 DbgP(( L"[aglo] GetNetCaps %d\n", nIndex ));
342#endif
343 switch ( nIndex )
344 {
347 break;
348
349 case WNNC_NET_TYPE:
351 break;
352
354 rc = WNNC_DRIVER(1, 0);
355 break;
356
357 case WNNC_CONNECTION:
362 break;
363
364 case WNNC_ENUMERATION:
365 rc = WNNC_ENUM_LOCAL;
366 break;
367
368 case WNNC_START:
369 rc = 1;
370 break;
371
372 case WNNC_USER:
373 case WNNC_DIALOG:
374 case WNNC_ADMIN:
375 default:
376 rc = 0;
377 break;
378 }
379
380 return rc;
381}
#define WNNC_DRIVER(major, minor)
Definition: nfs41_np.c:39
#define WNNC_NET_TYPE
Definition: npapi.h:24
#define WNNC_START
Definition: npapi.h:56
#define WNNC_CON_GETCONNECTIONS
Definition: npapi.h:35
#define WNNC_USER
Definition: npapi.h:29
#define WNNC_SPEC_VERSION51
Definition: npapi.h:23
#define WNNC_DIALOG
Definition: npapi.h:38
#define WNNC_CON_CANCELCONNECTION
Definition: npapi.h:34
#define WNNC_CONNECTION
Definition: npapi.h:32
#define WNNC_ADMIN
Definition: npapi.h:47
#define WNNC_CON_ADDCONNECTION
Definition: npapi.h:33
#define WNNC_CON_ADDCONNECTION3
Definition: npapi.h:36
#define WNNC_SPEC_VERSION
Definition: npapi.h:22
#define WNNC_ENUM_LOCAL
Definition: npapi.h:53
#define WNNC_DRIVER_VERSION
Definition: npapi.h:27
#define WNNC_ENUMERATION
Definition: npapi.h:51
#define WNNC_NET_RDR2SAMPLE
Definition: winnetwk.h:47

Referenced by _tryLoadProvider().

◆ NPGetConnection()

DWORD APIENTRY NPGetConnection ( __in LPWSTR  lpLocalName,
__out_bcount *lpBufferSize LPWSTR  lpRemoteName,
__inout LPDWORD  lpBufferSize 
)

Definition at line 680 of file nfs41_np.c.

684{
685 DWORD Status = 0;
686
688 PNFS41NP_SHARED_MEMORY pSharedMemory;
689
691 &hMemory,
692 (PVOID)&pSharedMemory);
693
694 if (Status == WN_SUCCESS)
695 {
696 INT Index;
697 PNFS41NP_NETRESOURCE pNetResource;
699
700 for (Index = 0; Index < pSharedMemory->NextAvailableIndex; Index++)
701 {
702 pNetResource = &pSharedMemory->NetResources[Index];
703
704 if (pNetResource->InUse)
705 {
706 if ( ( (wcslen(lpLocalName) + 1) * sizeof(WCHAR) ==
707 pNetResource->LocalNameLength)
708 && ( !wcscmp(lpLocalName, pNetResource->LocalName) ))
709 {
710 if (*lpBufferSize < pNetResource->RemoteNameLength)
711 {
712 *lpBufferSize = pNetResource->RemoteNameLength;
714 }
715 else
716 {
717 *lpBufferSize = pNetResource->RemoteNameLength;
718 CopyMemory( lpRemoteName,
719 pNetResource->RemoteName,
720 pNetResource->RemoteNameLength);
722 }
723 break;
724 }
725 }
726 }
727
728 CloseSharedMemory( &hMutex, &hMemory, (PVOID)&pSharedMemory);
729 }
730
731 return Status;
732}
#define CopyMemory
Definition: minwinbase.h:29

Referenced by _tryLoadProvider().

◆ NPGetResourceInformation()

DWORD APIENTRY NPGetResourceInformation ( __in LPNETRESOURCE  lpNetResource,
__out_bcount *lpBufferSize LPVOID  lpBuffer,
__inout LPDWORD  lpBufferSize,
__deref_out LPWSTR lplpSystem 
)

Definition at line 906 of file nfs41_np.c.

911{
912 DbgP(( L"[aglo] NPGetResourceInformation: WN_NOT_SUPPORTED\n" ));
913 return WN_NOT_SUPPORTED;
914}
#define WN_NOT_SUPPORTED
Definition: winnetwk.h:113

Referenced by _tryLoadProvider().

◆ NPGetResourceParent()

DWORD APIENTRY NPGetResourceParent ( LPNETRESOURCE  lpNetResource,
LPVOID  lpBuffer,
LPDWORD  lpBufferSize 
)

Definition at line 896 of file nfs41_np.c.

900{
901 DbgP(( L"[aglo] NPGetResourceParent: WN_NOT_SUPPORTED\n" ));
902 return WN_NOT_SUPPORTED;
903}

◆ NPGetUniversalName()

DWORD APIENTRY NPGetUniversalName ( LPCWSTR  lpLocalPath,
DWORD  dwInfoLevel,
LPVOID  lpBuffer,
LPDWORD  lpBufferSize 
)

Definition at line 917 of file nfs41_np.c.

922{
923 DbgP(( L"[aglo] NPGetUniversalName: WN_NOT_SUPPORTED\n" ));
924 return WN_NOT_SUPPORTED;
925}

◆ NPLogonNotify()

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 
)

Definition at line 384 of file nfs41_np.c.

393{
394 *lpLogonScript = NULL;
395 DbgP(( L"[aglo] NPLogonNotify: returning WN_SUCCESS\n" ));
396 return WN_SUCCESS;
397}

◆ NPOpenEnum()

DWORD APIENTRY NPOpenEnum ( DWORD  dwScope,
DWORD  dwType,
DWORD  dwUsage,
LPNETRESOURCE  lpNetResource,
LPHANDLE  lphEnum 
)

Definition at line 735 of file nfs41_np.c.

741{
743
744 DbgP((L"[aglo] NPOpenEnum\n"));
745
746 *lphEnum = NULL;
747
748 switch ( dwScope )
749 {
751 {
752 *lphEnum = HeapAlloc( GetProcessHeap( ), HEAP_ZERO_MEMORY, sizeof( ULONG ) );
753
754 if (*lphEnum )
755 {
757 }
758 else
759 {
761 }
762 break;
763 }
764 break;
765
766 case RESOURCE_CONTEXT:
767 default:
769 break;
770 }
771
772
773 DbgP((L"[aglo] NPOpenEnum returning Status %lx\n",Status));
774
775 return(Status);
776}
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define RESOURCE_CONNECTED
Definition: winnetwk.h:58
#define WN_OUT_OF_MEMORY
Definition: winnetwk.h:125
#define RESOURCE_CONTEXT
Definition: winnetwk.h:62

Referenced by _tryLoadProvider().

◆ NPPasswordChangeNotify()

DWORD APIENTRY NPPasswordChangeNotify ( __in LPCWSTR  lpAuthentInfoType,
__in LPVOID  lpAuthentInfo,
__in LPCWSTR  lpPreviousAuthentInfoType,
__in LPVOID  lpPreviousAuthentInfo,
__in LPWSTR  lpStationName,
LPVOID  StationHandle,
DWORD  dwChangeInfo 
)

Definition at line 400 of file nfs41_np.c.

408{
409 DbgP(( L"[aglo] NPPasswordChangeNotify: WN_NOT_SUPPORTED\n" ));
411 return WN_NOT_SUPPORTED;
412}
#define SetLastError(x)
Definition: compat.h:752

◆ OpenSharedMemory()

DWORD OpenSharedMemory ( PHANDLE  phMutex,
PHANDLE  phMemory,
PVOID pMemory 
)

Definition at line 74 of file nfs41_np.c.

97{
99
100 *phMutex = 0;
101 *phMemory = 0;
102 *pMemory = NULL;
103
105 if (*phMutex == NULL)
106 {
108 DbgP((TEXT("OpenSharedMemory: OpenMutex failed\n")));
109 goto OpenSharedMemoryAbort1;
110 }
111
112 WaitForSingleObject(*phMutex, INFINITE);
113
115 FALSE,
117 if (*phMemory == NULL)
118 {
120 DbgP((TEXT("OpenSharedMemory: OpenFileMapping failed\n")));
121 goto OpenSharedMemoryAbort2;
122 }
123
124 *pMemory = MapViewOfFile(*phMemory, FILE_MAP_WRITE, 0, 0, 0);
125 if (*pMemory == NULL)
126 {
128 DbgP((TEXT("OpenSharedMemory: MapViewOfFile failed\n")));
129 goto OpenSharedMemoryAbort3;
130 }
131
132 return ERROR_SUCCESS;
133
134OpenSharedMemoryAbort3:
135 CloseHandle(*phMemory);
136
137OpenSharedMemoryAbort2:
138 ReleaseMutex(*phMutex);
139 CloseHandle(*phMutex);
140 *phMutex = NULL;
141
142OpenSharedMemoryAbort1:
143 DbgP((TEXT("OpenSharedMemory: return dwStatus: %d\n"), dwStatus));
144
145 return dwStatus;
146}
#define ERROR_SUCCESS
Definition: deptool.c:10
#define MapViewOfFile
Definition: compat.h:745
#define INFINITE
Definition: serial.h:102
#define NFS41_USER_SHARED_MEMORY_NAME
Definition: nfs41_driver.h:37
#define NFS41NP_MUTEX_NAME
Definition: nfs41_np.h:25
DWORD dwStatus
Definition: mediaobj.idl:95
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define FILE_MAP_WRITE
Definition: winbase.h:156
#define CreateMutex
Definition: winbase.h:3505
#define OpenFileMapping
Definition: winbase.h:3636

Referenced by NPCancelConnection(), NPEnumResource(), NPGetConnection(), and StoreConnectionInfo().

◆ SendTo_NFS41Driver()

ULONG SendTo_NFS41Driver ( IN ULONG  IoctlCode,
IN PVOID  InputDataBuf,
IN ULONG  InputDataLen,
IN PVOID  OutputDataBuf,
IN PULONG  pOutputDataLen 
)

Definition at line 274 of file nfs41_np.c.

280{
281 HANDLE DeviceHandle; // The mini rdr device handle
282 BOOL rc = FALSE;
284
286 DbgP((L"[aglo] calling CreateFile\n"));
293 0,
294 (HANDLE) NULL );
295
296 DbgP((L"[aglo] after CreateFile Device Handle\n"));
298 {
299 _SEH2_TRY {
300 DbgP((L"[aglo] calling DeviceIoControl\n"));
301 rc = DeviceIoControl(
303 IoctlCode,
304 InputDataBuf,
305 InputDataLen,
306 OutputDataBuf,
307 *pOutputDataLen,
308 pOutputDataLen,
309 NULL );
311 DbgP((L"#### In except\n"));
312 } _SEH2_END;
313 DbgP((L"[aglo] returned from DeviceIoControl %08lx\n", rc));
314 if ( !rc )
315 {
316 DbgP((L"[aglo] SendTo_NFS41Driver: returning error from DeviceIoctl\n"));
317 Status = GetLastError( );
318 }
319 else
320 {
321 DbgP((L"[aglo] SendTo_NFS41Driver: The DeviceIoctl call succeded\n"));
322 }
324 }
325 else
326 {
327 Status = GetLastError( );
328 DbgP((L"[aglo] SendTo_NFS41Driver: error %08lx opening device \n", Status));
329 }
330 DbgP((L"[aglo] returned from SendTo_NFS41Driver %08lx\n", Status));
331 return Status;
332}
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: deviceio.c:136
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GENERIC_READ
Definition: compat.h:135
#define FILE_SHARE_READ
Definition: compat.h:136
unsigned int BOOL
Definition: ntddk_ex.h:94
_Inout_ PUSB_DEVICE_HANDLE DeviceHandle
Definition: hubbusif.h:121
#define NFS41_USER_DEVICE_NAME
Definition: nfs41_driver.h:27
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define GENERIC_WRITE
Definition: nt_native.h:90
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:181
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:82
#define _SEH2_END
Definition: pseh2_64.h:171
#define _SEH2_TRY
Definition: pseh2_64.h:71
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_ ULONG IoctlCode
Definition: wdfiotarget.h:1043
#define CreateFile
Definition: winbase.h:3498

Referenced by NPAddConnection3(), and NPCancelConnection().

◆ StoreConnectionInfo()

static DWORD StoreConnectionInfo ( IN LPCWSTR  LocalName,
IN LPCWSTR  ConnectionName,
IN USHORT  ConnectionNameLength,
IN LPNETRESOURCE  lpNetResource 
)
static

Definition at line 193 of file nfs41_np.c.

198{
201 PNFS41NP_SHARED_MEMORY pSharedMemory;
202 PNFS41NP_NETRESOURCE pNfs41NetResource;
203 INT Index;
204 BOOLEAN FreeEntryFound = FALSE;
205
206#ifdef __REACTOS__
207 status = OpenSharedMemory(&hMutex, &hMemory, (PVOID *)&pSharedMemory);
208#else
209 status = OpenSharedMemory(&hMutex, &hMemory, &(PVOID)pSharedMemory);
210#endif
211 if (status)
212 goto out;
213
214 DbgP((TEXT("StoreConnectionInfo: NextIndex %d, NumResources %d\n"),
215 pSharedMemory->NextAvailableIndex,
216 pSharedMemory->NumberOfResourcesInUse));
217
218 for (Index = 0; Index < pSharedMemory->NextAvailableIndex; Index++)
219 {
220 if (!pSharedMemory->NetResources[Index].InUse)
221 {
222 FreeEntryFound = TRUE;
223 DbgP((TEXT("Reusing existing index %d\n"), Index));
224 break;
225 }
226 }
227
228 if (!FreeEntryFound)
229 {
230 if (pSharedMemory->NextAvailableIndex >= NFS41NP_MAX_DEVICES) {
232 goto out_close;
233 }
234 Index = pSharedMemory->NextAvailableIndex++;
235 DbgP((TEXT("Using new index %d\n"), Index));
236 }
237
238 pSharedMemory->NumberOfResourcesInUse += 1;
239
240 pNfs41NetResource = &pSharedMemory->NetResources[Index];
241
242 pNfs41NetResource->InUse = TRUE;
243 pNfs41NetResource->dwScope = lpNetResource->dwScope;
244 pNfs41NetResource->dwType = lpNetResource->dwType;
245 pNfs41NetResource->dwDisplayType = lpNetResource->dwDisplayType;
246 pNfs41NetResource->dwUsage = RESOURCEUSAGE_CONNECTABLE;
247 pNfs41NetResource->LocalNameLength = (USHORT)(wcslen(LocalName) + 1) * sizeof(WCHAR);
248 pNfs41NetResource->RemoteNameLength = (USHORT)(wcslen(lpNetResource->lpRemoteName) + 1) * sizeof(WCHAR);
249 pNfs41NetResource->ConnectionNameLength = ConnectionNameLength;
250
251 StringCchCopy(pNfs41NetResource->LocalName,
252 pNfs41NetResource->LocalNameLength,
253 LocalName);
254 StringCchCopy(pNfs41NetResource->RemoteName,
255 pNfs41NetResource->RemoteNameLength,
256 lpNetResource->lpRemoteName);
257 StringCchCopy(pNfs41NetResource->ConnectionName,
258 pNfs41NetResource->ConnectionNameLength,
259 ConnectionName);
260
261 // TODO: copy mount options -cbodley
262
263out_close:
264#ifdef __REACTOS__
265 CloseSharedMemory(&hMutex, &hMemory, (PVOID *)&pSharedMemory);
266#else
267 CloseSharedMemory(&hMutex, &hMemory, &(PVOID)pSharedMemory);
268#endif
269out:
270 return status;
271}
unsigned char BOOLEAN
#define TRUE
Definition: types.h:120
#define NFS41NP_MAX_DEVICES
Definition: nfs41_np.h:27
unsigned short USHORT
Definition: pedump.c:61
Definition: ps.c:97
#define RESOURCEUSAGE_CONNECTABLE
Definition: winnetwk.h:68
#define WN_NO_MORE_DEVICES
Definition: winnetwk.h:131

Referenced by NPAddConnection3().