34#define WINE_MOUNTMGR_EXTENSIONS
41#include <wine/unicode.h>
80#define WNET_ENUMERATOR_TYPE_GLOBAL 0
81#define WNET_ENUMERATOR_TYPE_PROVIDER 1
82#define WNET_ENUMERATOR_TYPE_CONTEXT 2
83#define WNET_ENUMERATOR_TYPE_CONNECTED 3
84#define WNET_ENUMERATOR_TYPE_REMEMBERED 4
122#define BAD_PROVIDER_INDEX (DWORD)0xffffffff
137 static const WCHAR servicePrefix[] = {
'S',
'y',
's',
't',
'e',
'm',
'\\',
138 'C',
'u',
'r',
'r',
'e',
'n',
't',
'C',
'o',
'n',
't',
'r',
'o',
'l',
'S',
'e',
't',
'\\',
139 'S',
'e',
'r',
'v',
'i',
'c',
'e',
's',
'\\',0 };
140 static const WCHAR serviceFmt[] = {
'%',
's',
'%',
's',
'\\',
141 'N',
'e',
't',
'w',
'o',
'r',
'k',
'P',
'r',
'o',
'v',
'i',
'd',
'e',
'r',0 };
151 static const WCHAR szProviderPath[] = {
'P',
'r',
'o',
'v',
'i',
'd',
'e',
'r',
159 static const WCHAR szProviderName[] = {
'N',
'a',
'm',
'e',0 };
186#define MPR_GETPROC(proc) ((PF_##proc)GetProcAddress(hLib, #proc))
190 TRACE(
"loaded lib %p\n", hLib);
197 provider->
hLib = hLib;
207 TRACE(
"supports enumeration\n");
224 WARN(
"Couldn't load enumeration functions\n");
245 WARN(
"Provider %s didn't export NPGetCaps\n",
255 WARN(
"Couldn't load library %s for provider %s\n",
262 WARN(
"Couldn't get provider name for provider %s\n",
271 WARN(
"Couldn't open service key for provider %s\n",
276static void _restoreSavedConnection(
HKEY connection,
WCHAR *
local)
328 if (!
net.lpRemoteName)
336 if (!
net.lpLocalName)
343 TRACE(
"Attempting connection\n");
356 static const WCHAR providerOrderKey[] = {
'S',
'y',
's',
't',
'e',
'm',
'\\',
357 'C',
'u',
'r',
'r',
'e',
'n',
't',
'C',
'o',
'n',
't',
'r',
'o',
'l',
'S',
'e',
't',
'\\',
358 'C',
'o',
'n',
't',
'r',
'o',
'l',
'\\',
359 'N',
'e',
't',
'w',
'o',
'r',
'k',
'P',
'r',
'o',
'v',
'i',
'd',
'e',
'r',
'\\',
360 'O',
'r',
'd',
'e',
'r',0 };
361 static const WCHAR providerOrder[] = {
'P',
'r',
'o',
'v',
'i',
'd',
'e',
'r',
362 'O',
'r',
'd',
'e',
'r',0 };
403 int entireNetworkLen;
441 WCHAR subkey[8] = {
'N',
'e',
't',
'w',
'o',
'r',
'k', 0};
447 TRACE(
"Enumerating remembered connections\n");
449 if (
RegQueryInfoKey(
network,
NULL,
NULL,
NULL, &
max, &
size,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL) ==
ERROR_SUCCESS)
453 TRACE(
"There are %lu connections\n",
max);
475 _restoreSavedConnection(connection,
local);
546 if (
ret->lpRemoteName)
574 ret->dwScope = dwScope;
575 ret->dwType = dwType;
576 ret->dwUsage = dwUsage;
596 ret->dwScope = dwScope;
597 ret->dwType = dwType;
598 ret->dwUsage = dwUsage;
614 ret->dwScope = dwScope;
615 ret->dwType = dwType;
616 ret->dwUsage = dwUsage;
628 ret->dwScope = dwScope;
629 ret->dwType = dwType;
630 ret->dwUsage = dwUsage;
632 if (!
ret->specific.handles)
648 ret->dwScope = dwScope;
649 ret->dwType = dwType;
650 ret->specific.remembered.registry = remembered;
679 for (
i = 0, numToThunk = 0, totalBytes = 0;
i < *lpcCount;
i++)
696 if (totalBytes < *lpBufferSize)
700 for (
i = 0;
i < numToThunk;
i++)
735 TRACE(
"numToThunk is %d, *lpcCount is %d, returning %d\n", numToThunk,
764 for (
i = 0, numToThunk = 0, totalBytes = 0;
i < *lpcCount;
i++)
781 if (totalBytes < *lpBufferSize)
785 for (
i = 0;
i < numToThunk;
i++)
820 TRACE(
"numToThunk is %d, *lpcCount is %d, returning %d\n", numToThunk,
835 TRACE(
"(%08X, %08X, %08X, %p, %p)\n",
836 dwScope, dwType, dwUsage, lpNet, lphEnum );
927 TRACE(
"(%08X, %08X, %08X, %p, %p)\n",
928 dwScope, dwType, dwUsage, lpNet, lphEnum );
961 dwScope, dwType, dwUsage, lpNet, &
handle);
981 dwType, dwUsage, lpNet);
993 dwType, dwUsage, lpNet);
999 dwType, dwUsage,
NULL);
1021 HKEY remembered, user_profile;
1026 WCHAR subkey[8] = {
'N',
'e',
't',
'w',
'o',
'r',
'k', 0};
1039 WARN(
"unknown scope 0x%08x\n", dwScope);
1057 TRACE(
"(%p, %p, %p, %p)\n", hEnum, lpcCount,
lpBuffer, lpBufferSize );
1065 else if (!lpBufferSize)
1074 DWORD localCount = *lpcCount, localSize = *lpBufferSize;
1091 *lpcCount = localCount;
1145 countLimit = *lpcCount == -1 ?
1147 while (
count < countLimit &&
bytes < *lpBufferSize)
1152 if (
bytes + bytesNext < *lpBufferSize)
1311 WARN(
"unexpected scope 0x%08x\n", enumerator->
dwScope);
1347 size_t cchEntireNetworkLen, bytesNeeded;
1364 if (*lpBufferSize < bytesNeeded)
1366 *lpBufferSize = bytesNeeded;
1384 (cchEntireNetworkLen *
sizeof(
WCHAR)));
1413 *lpBufferSize = bytesNeeded;
1439 void* user_buffer,
DWORD* user_size)
1450 if (!user_count || !user_buffer || !user_size)
1463 end = (
char *)user_buffer +
size;
1464 count = *user_count;
1485 total_count +=
count;
1523 if (*user_count != -1)
1524 count = *user_count - total_count;
1526 count = *user_count;
1530 if (total_count == 0)
1533 *user_count = total_count;
1543static const WCHAR connectionType[] = {
'C',
'o',
'n',
'n',
'e',
'c',
't',
'i',
'o',
'n',
'T',
'y',
'p',
'e',0 };
1544static const WCHAR providerName[] = {
'P',
'r',
'o',
'v',
'i',
'd',
'e',
'r',
'N',
'a',
'm',
'e',0 };
1545static const WCHAR remotePath[] = {
'R',
'e',
'm',
'o',
't',
'e',
'P',
'a',
't',
'h',0 };
1562 void* user_buffer,
DWORD* user_size)
1575 size_left = *user_size;
1584 if (*user_count != -1 && total_count == *user_count)
1625 full_size += 3 *
sizeof(
WCHAR);
1626 size_left -= 3 *
sizeof(
WCHAR);
1638 if (registry_string)
1640 full_size += registry_size;
1641 size_left -= registry_size;
1645 str -= (registry_size /
sizeof(
WCHAR));
1657 if (registry_string)
1659 full_size += registry_size;
1660 size_left -= registry_size;
1664 str -= (registry_size /
sizeof(
WCHAR));
1685 if (total_count == 0)
1688 *user_count = total_count;
1694 *user_size = *user_size + full_size;
1707 TRACE(
"(%p, %p, %p, %p)\n", hEnum, lpcCount,
lpBuffer, lpBufferSize );
1715 else if (!lpBufferSize)
1749 WARN(
"bogus enumerator type!\n");
1767 TRACE(
"(%p)\n", hEnum );
1780 closeEnum(enumerator->
handle);
1786 closeEnum(enumerator->
handle);
1804 WARN(
"bogus enumerator type!\n");
1828 TRACE(
"(%p, %p, %p, %p)\n",
1829 lpNetResource,
lpBuffer, cbBuffer, lplpSystem );
1833 else if (lpNetResource)
1860 lpBufferW, &
size, &lpSystemW);
1867 lpBufferW, &
size, &lpSystemW);
1876 lpNetResourceW = lpBufferW;
1944 TRACE(
"(%p, %p, %p, %p)\n",
1945 lpNetResource,
lpBuffer, cbBuffer, lplpSystem);
1961 lpNetResource,
lpBuffer, cbBuffer, lplpSystem);
1980 FIXME(
"(%p, %p, %p): stub\n",
1981 lpNetResource,
lpBuffer, lpBufferSize );
1993 FIXME(
"(%p, %p, %p): stub\n",
1994 lpNetResource,
lpBuffer, lpBufferSize );
2014 memset(&resourcesA, 0,
sizeof(resourcesA));
2028 memset(&resourcesW, 0,
sizeof(resourcesW));
2155static const WCHAR providerType[] = {
'P',
'r',
'o',
'v',
'i',
'd',
'e',
'r',
'T',
'y',
'p',
'e',0 };
2163 WCHAR letter[3] = {
'Z',
':', 0};
2180 FIXME(
"Local device selection is not implemented for printers.\n");
2220 FIXME(
"Persistent connection are not supported for printers\n");
2227 WCHAR subkey[10] = {
'N',
'e',
't',
'w',
'o',
'r',
'k',
'\\', netres.
lpLocalName[0], 0};
2261 TRACE(
"(%p, %p, %p, %s, 0x%08X, %p, %p, %p)\n",
2359 TRACE(
"(%p, %p, %p, %s, 0x%08X, %p, %p, %p)\n",
hwndOwner,
resource,
password,
debugstr_a(
userid),
flags,
2450 WCHAR subkey[10] = {
'N',
'e',
't',
'w',
'o',
'r',
'k',
'\\',
lpName[0], 0};
2501 else if (!lpBufferSize)
2503 else if (!lpRemoteName && *lpBufferSize)
2528 if (
len <= *lpBufferSize)
2531 lpRemoteName, *lpBufferSize,
NULL,
NULL);
2536 *lpBufferSize =
len;
2543 wideRemoteSize *
sizeof(
WCHAR));
2551 if (
len <= *lpBufferSize)
2554 -1, lpRemoteName, *lpBufferSize,
NULL,
NULL);
2559 *lpBufferSize =
len;
2587 struct mountmgr_unix_drive *
data = (
struct mountmgr_unix_drive *)
buffer;
2590 DWORD bytes_returned;
2600 data->letter = letter;
2604 char *
p, *mount_point =
buffer +
data->mount_point_offset;
2607 if (
data->mount_point_offset && !
strncmp( mount_point,
"unc/", 4 ))
2610 mount_point[0] =
'\\';
2611 for (
p = mount_point; *
p;
p++)
if (*
p ==
'/') *
p =
'\\';
2671 else if (!lpBufferSize)
2673 else if (!lpRemoteName && *lpBufferSize)
2675 else if (!lpLocalName[0])
2679 if (lpLocalName[1] ==
':')
2689 TRACE(
"file is local\n");
2737 FIXME(
"(%s, 0x%08X, %p, %p): stub\n",
2753 if (*lpBufferSize <
size)
2784 FIXME(
"(%s, 0x%08X, %p, %p): stub\n",
2800 if (*lpBufferSize <
size)
2802 *lpBufferSize =
size;
2934 FIXME(
"(%p): stub\n", lpConnDlgStruct );
2945 FIXME(
"(%p): stub\n", lpConnDlgStruct );
2962 dwRet = pSHDisconnectNetDrives(
NULL);
2967 FIXME(
"(%p, %08X): stub\n",
hwnd, dwType );
2979 FIXME(
"(%p): stub\n", lpConnDlgStruct );
2990 FIXME(
"(%p): stub\n", lpConnDlgStruct );
3003 FIXME(
"(%p, %p, %d, %p, %d): stub\n",
3004 lpError, lpErrorBuf, nErrorBufSize, lpNameBuf, nNameBufSize );
3017 FIXME(
"(%p, %p, %d, %p, %d): stub\n",
3018 lpError, lpErrorBuf, nErrorBufSize, lpNameBuf, nNameBufSize );
3076 else if (!lpNetInfoStruct)
3125 else if (!lpBufferSize)
3138 if (i < providerTable->numProviders)
3143 if (*lpBufferSize < sizeNeeded)
3145 *lpBufferSize = sizeNeeded;
3151 -1, lpProvider, *lpBufferSize,
NULL,
NULL);
3180 else if (!lpBufferSize)
3193 if (i < providerTable->numProviders)
3197 if (*lpBufferSize < sizeNeeded)
3199 *lpBufferSize = sizeNeeded;
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
char * strcpy(char *DstString, const char *SrcString)
static unsigned char bytes[4]
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define RegCloseKey(hKey)
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
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)
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
LONG WINAPI RegOpenCurrentUser(IN REGSAM samDesired, OUT PHKEY phkResult)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
BOOL WINAPI GetUserNameW(LPWSTR lpszName, LPDWORD lpSize)
BOOL WINAPI GetUserNameA(LPSTR lpszName, LPDWORD lpSize)
static struct list providers
static const WCHAR empty[]
#define ERROR_INVALID_PARAMETER
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define ERROR_NO_MORE_ITEMS
#define HeapFree(x, y, z)
#define WideCharToMultiByte
#define MultiByteToWideChar
static void cleanup(void)
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
UINT WINAPI GetDriveTypeA(IN LPCSTR lpRootPathName)
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
static BSTR local_name(call_frame_t *frame, int ref)
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
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
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
#define memcpy(s1, s2, n)
#define MOUNTMGR_DOS_DEVICE_NAME
#define IDS_ENTIRENETWORK
DWORD APIENTRY NPEnumResource(HANDLE hEnum, LPDWORD lpcCount, LPVOID lpBuffer, LPDWORD lpBufferSize)
DWORD APIENTRY NPGetCaps(DWORD nIndex)
DWORD APIENTRY NPCloseEnum(HANDLE hEnum)
DWORD APIENTRY NPGetResourceInformation(__in LPNETRESOURCE lpNetResource, __out_bcount(*lpBufferSize) LPVOID lpBuffer, __inout LPDWORD lpBufferSize, __deref_out LPWSTR *lplpSystem)
DWORD APIENTRY NPAddConnection(__in LPNETRESOURCE lpNetResource, __in_opt LPWSTR lpPassword, __in_opt LPWSTR lpUserName)
DWORD APIENTRY NPOpenEnum(DWORD dwScope, DWORD dwType, DWORD dwUsage, LPNETRESOURCE lpNetResource, LPHANDLE lphEnum)
DWORD APIENTRY NPGetConnection(__in LPWSTR lpLocalName, __out_bcount(*lpBufferSize) LPWSTR lpRemoteName, __inout LPDWORD lpBufferSize)
DWORD APIENTRY NPCancelConnection(__in LPWSTR lpName, __in BOOL fForce)
DWORD APIENTRY NPAddConnection3(__in HWND hwndOwner, __in LPNETRESOURCE lpNetResource, __in_opt LPWSTR lpPassword, __in_opt LPWSTR lpUserName, __in DWORD dwFlags)
#define WNNC_CON_GETCONNECTIONS
DWORD(APIENTRY * PF_NPEnumResource)(HANDLE hEnum, LPDWORD lpcCount, LPVOID lpBuffer, LPDWORD lpBufferSize)
#define WNNC_DLG_GETRESOURCEINFORMATION
DWORD(APIENTRY * PF_NPGetConnection)(LPWSTR lpLocalName, LPWSTR lpRemoteName, LPDWORD lpnBufferLen)
DWORD(APIENTRY * PF_NPAddConnection)(LPNETRESOURCEW lpNetResource, LPWSTR lpPassword, LPWSTR lpUserName)
DWORD(APIENTRY * PF_NPOpenEnum)(DWORD dwScope, DWORD dwType, DWORD dwUsage, LPNETRESOURCEW lpNetResource, LPHANDLE lphEnum)
DWORD(APIENTRY * PF_NPGetCaps)(DWORD ndex)
#define WNNC_CON_CANCELCONNECTION
#define WNNC_ENUM_CONTEXT
#define WNNC_CON_ADDCONNECTION
#define WNNC_CON_ADDCONNECTION3
#define WNNC_SPEC_VERSION
DWORD(APIENTRY * PF_NPGetResourceInformation)(LPNETRESOURCEW lpNetResource, LPVOID lpBuffer, LPDWORD lpcbBuffer, LPWSTR *lplpSystem)
DWORD(APIENTRY * PF_NPAddConnection3)(HWND hwndOwner, LPNETRESOURCEW lpNetResource, LPWSTR lpPassword, LPWSTR lpUserName, DWORD dwFlags)
DWORD(APIENTRY * PF_NPCancelConnection)(LPWSTR lpName, BOOL fForce)
DWORD(APIENTRY * PF_NPCloseEnum)(HANDLE hEnum)
#define REG_OPTION_NON_VOLATILE
struct _WNetEnumerator::@475::@476 remembered
union _WNetEnumerator::@475 specific
PF_NPAddConnection3 addConnection3
PF_NPCancelConnection cancelConnection
PF_NPGetResourceInformation getResourceInformation
PF_NPEnumResource enumResource
PF_NPAddConnection addConnection
void(* set_accessname)(struct use_connection_context *, WCHAR *)
DWORD(* pre_set_accessname)(struct use_connection_context *, WCHAR *)
static void buffer_size(GLcontext *ctx, GLuint *width, GLuint *height)
static EFI_HANDLE * handles
DWORD WINAPI GetLastError(void)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define ERROR_BAD_DEV_TYPE
#define ERROR_BAD_PROVIDER
#define ERROR_NOT_CONNECTED
#define ERROR_BAD_NET_NAME
#define RESOURCE_CONNECTED
#define CONNECT_INTERACTIVE
struct _NETRESOURCEA * LPNETRESOURCEA
#define RESOURCEUSAGE_CONNECTABLE
#define RESOURCEDISPLAYTYPE_ROOT
#define WN_ALREADY_CONNECTED
#define RESOURCEDISPLAYTYPE_GENERIC
#define CONNECT_UPDATE_PROFILE
#define REMOTE_NAME_INFO_LEVEL
struct _NETRESOURCEA NETRESOURCEA
#define RESOURCETYPE_DISK
struct _NETRESOURCEW NETRESOURCEW
#define UNIVERSAL_NAME_INFO_LEVEL
#define CONNECT_LOCALDRIVE
#define RESOURCE_REMEMBERED
#define RESOURCETYPE_PRINT
struct _NETINFOSTRUCT NETINFOSTRUCT
#define RESOURCEDISPLAYTYPE_NETWORK
#define RESOURCEUSAGE_CONTAINER
#define WN_NO_MORE_ENTRIES
#define RESOURCEUSAGE_RESERVED
struct _NETRESOURCEW * LPNETRESOURCEW
#define RESOURCE_GLOBALNET
#define HKEY_LOCAL_MACHINE
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
static PWNetEnumerator _createConnectedEnumerator(DWORD dwScope, DWORD dwType, DWORD dwUsage)
DWORD WINAPI WNetRestoreConnectionW(HWND hwndOwner, LPCWSTR lpszDevice)
DWORD WINAPI WNetRestoreConnectionA(HWND hwndOwner, LPCSTR lpszDevice)
DWORD WINAPI WNetGetResourceParentA(LPNETRESOURCEA lpNetResource, LPVOID lpBuffer, LPDWORD lpBufferSize)
DWORD WINAPI WNetAddConnectionA(LPCSTR lpRemoteName, LPCSTR lpPassword, LPCSTR lpLocalName)
static LPNETRESOURCEW _copyNetResourceForEnumW(LPNETRESOURCEW lpNet)
DWORD WINAPI WNetCancelConnection2A(LPCSTR lpName, DWORD dwFlags, BOOL fForce)
static const WCHAR remotePath[]
DWORD WINAPI WNetDisconnectDialog1A(LPDISCDLGSTRUCTA lpConnDlgStruct)
DWORD WINAPI WNetClearConnections(HWND owner)
DWORD WINAPI WNetUseConnectionA(HWND hwndOwner, NETRESOURCEA *resource, LPCSTR password, LPCSTR userid, DWORD flags, LPSTR accessname, DWORD *buffer_size, DWORD *result)
#define WNET_ENUMERATOR_TYPE_CONNECTED
static WCHAR * get_reg_str(HKEY hkey, const WCHAR *value, DWORD *len)
static DWORD _thunkNetResourceArrayWToA(const NETRESOURCEW *lpNetArrayIn, const DWORD *lpcCount, LPVOID lpBuffer, const DWORD *lpBufferSize)
static void free_netresourceW(NETRESOURCEW *resource)
static void _tryLoadProvider(PCWSTR provider)
static DWORD wnet_use_provider(struct use_connection_context *ctxt, NETRESOURCEW *netres, WNetProvider *provider, BOOLEAN redirect)
DWORD WINAPI WNetConnectionDialog(HWND hwnd, DWORD dwType)
static PWNetProviderTable providerTable
static PWNetEnumerator _createRememberedEnumerator(DWORD dwScope, DWORD dwType, HKEY remembered)
static DWORD _enumerateConnectedW(PWNetEnumerator enumerator, DWORD *user_count, void *user_buffer, DWORD *user_size)
DWORD WINAPI WNetSetConnectionA(LPCSTR lpName, DWORD dwProperty, LPVOID pvValue)
DWORD WINAPI WNetConnectionDialog1A(LPCONNECTDLGSTRUCTA lpConnDlgStruct)
DWORD WINAPI WNetUseConnectionW(HWND hwndOwner, NETRESOURCEW *resource, LPCWSTR password, LPCWSTR userid, DWORD flags, LPWSTR accessname, DWORD *buffer_size, DWORD *result)
DWORD WINAPI WNetGetConnectionA(LPCSTR lpLocalName, LPSTR lpRemoteName, LPDWORD lpBufferSize)
static PWNetEnumerator _createProviderEnumerator(DWORD dwScope, DWORD dwType, DWORD dwUsage, DWORD index, HANDLE handle)
DWORD WINAPI WNetAddConnection2W(LPNETRESOURCEW lpNetResource, LPCWSTR lpPassword, LPCWSTR lpUserID, DWORD dwFlags)
DWORD WINAPI WNetAddConnection2A(LPNETRESOURCEA lpNetResource, LPCSTR lpPassword, LPCSTR lpUserID, DWORD dwFlags)
#define MPR_GETPROC(proc)
#define WNET_ENUMERATOR_TYPE_PROVIDER
static DWORD _enumerateGlobalW(PWNetEnumerator enumerator, LPDWORD lpcCount, LPVOID lpBuffer, LPDWORD lpBufferSize)
DWORD WINAPI WNetGetProviderNameA(DWORD dwNetType, LPSTR lpProvider, LPDWORD lpBufferSize)
static void netresource_a_to_w(NETRESOURCEA *resourceA, NETRESOURCEW *resourceW)
DWORD WINAPI WNetConnectionDialog1W(LPCONNECTDLGSTRUCTW lpConnDlgStruct)
DWORD WINAPI WNetGetResourceParentW(LPNETRESOURCEW lpNetResource, LPVOID lpBuffer, LPDWORD lpBufferSize)
DWORD WINAPI WNetCancelConnectionW(LPCWSTR lpName, BOOL fForce)
DWORD WINAPI WNetGetResourceInformationA(LPNETRESOURCEA lpNetResource, LPVOID lpBuffer, LPDWORD cbBuffer, LPSTR *lplpSystem)
#define WNET_ENUMERATOR_TYPE_GLOBAL
static void _freeEnumNetResource(LPNETRESOURCEW lpNet)
DWORD WINAPI WNetOpenEnumA(DWORD dwScope, DWORD dwType, DWORD dwUsage, LPNETRESOURCEA lpNet, LPHANDLE lphEnum)
static DWORD _enumeratorRememberedW(PWNetEnumerator enumerator, DWORD *user_count, void *user_buffer, DWORD *user_size)
static DWORD use_connection_pre_set_accessnameA(struct use_connection_context *ctxt, WCHAR *local_name)
struct _WNetEnumerator WNetEnumerator
struct _WNetProviderTable * PWNetProviderTable
static PWNetEnumerator _createGlobalEnumeratorW(DWORD dwScope, DWORD dwType, DWORD dwUsage, LPNETRESOURCEW lpNet)
DWORD WINAPI WNetEnumResourceA(HANDLE hEnum, LPDWORD lpcCount, LPVOID lpBuffer, LPDWORD lpBufferSize)
static DWORD _globalEnumeratorAdvance(PWNetEnumerator enumerator)
DWORD WINAPI WNetGetLastErrorW(LPDWORD lpError, LPWSTR lpErrorBuf, DWORD nErrorBufSize, LPWSTR lpNameBuf, DWORD nNameBufSize)
static PWNetEnumerator _createContextEnumerator(DWORD dwScope, DWORD dwType, DWORD dwUsage)
static LPWSTR strdupAtoW(LPCSTR str)
static DWORD _thunkNetResourceArrayAToW(const NETRESOURCEA *lpNetArrayIn, const DWORD *lpcCount, LPVOID lpBuffer, const DWORD *lpBufferSize)
DWORD WINAPI WNetGetConnectionW(LPCWSTR lpLocalName, LPWSTR lpRemoteName, LPDWORD lpBufferSize)
static DWORD _enumerateProvidersW(PWNetEnumerator enumerator, LPDWORD lpcCount, LPVOID lpBuffer, const DWORD *lpBufferSize)
static const WCHAR providerName[]
struct _WNetProviderTable WNetProviderTable
DWORD WINAPI WNetGetNetworkInformationW(LPCWSTR lpProvider, LPNETINFOSTRUCT lpNetInfoStruct)
DWORD WINAPI WNetGetNetworkInformationA(LPCSTR lpProvider, LPNETINFOSTRUCT lpNetInfoStruct)
struct _WNetProvider WNetProvider
DWORD WINAPI WNetGetResourceInformationW(LPNETRESOURCEW lpNetResource, LPVOID lpBuffer, LPDWORD cbBuffer, LPWSTR *lplpSystem)
DWORD WINAPI WNetAddConnection3W(HWND hwndOwner, LPNETRESOURCEW lpNetResource, LPCWSTR lpPassword, LPCWSTR lpUserID, DWORD dwFlags)
static void use_connection_set_accessnameA(struct use_connection_context *ctxt, WCHAR *local_name)
DWORD WINAPI WNetDisconnectDialog(HWND hwnd, DWORD dwType)
#define WNET_ENUMERATOR_TYPE_REMEMBERED
DWORD WINAPI WNetCancelConnectionA(LPCSTR lpName, BOOL fForce)
DWORD WINAPI WNetAddConnectionW(LPCWSTR lpRemoteName, LPCWSTR lpPassword, LPCWSTR lpLocalName)
DWORD WINAPI WNetAddConnection3A(HWND hwndOwner, LPNETRESOURCEA lpNetResource, LPCSTR lpPassword, LPCSTR lpUserID, DWORD dwFlags)
DWORD WINAPI WNetEnumResourceW(HANDLE hEnum, LPDWORD lpcCount, LPVOID lpBuffer, LPDWORD lpBufferSize)
DWORD WINAPI WNetGetProviderNameW(DWORD dwNetType, LPWSTR lpProvider, LPDWORD lpBufferSize)
static DWORD use_connection_pre_set_accessnameW(struct use_connection_context *ctxt, WCHAR *local_name)
DWORD WINAPI WNetCloseEnum(HANDLE hEnum)
DWORD WINAPI WNetGetUserW(LPCWSTR lpName, LPWSTR lpUserID, LPDWORD lpBufferSize)
struct _WNetEnumerator * PWNetEnumerator
DWORD WINAPI WNetCancelConnection2W(LPCWSTR lpName, DWORD dwFlags, BOOL fForce)
static const WCHAR userName[]
static void use_connection_set_accessnameW(struct use_connection_context *ctxt, WCHAR *local_name)
#define WNET_ENUMERATOR_TYPE_CONTEXT
DWORD WINAPI WNetDisconnectDialog1W(LPDISCDLGSTRUCTW lpConnDlgStruct)
static const WCHAR providerType[]
DWORD WINAPI WNetOpenEnumW(DWORD dwScope, DWORD dwType, DWORD dwUsage, LPNETRESOURCEW lpNet, LPHANDLE lphEnum)
static DWORD _enumerateProviderW(PWNetEnumerator enumerator, LPDWORD lpcCount, LPVOID lpBuffer, LPDWORD lpBufferSize)
static const WCHAR connectionType[]
static DWORD _countProviderBytesW(PWNetProvider provider)
static DWORD _findProviderIndexW(LPCWSTR lpProvider)
void wnetInit(HINSTANCE hInstDll)
struct _WNetProvider * PWNetProvider
DWORD WINAPI WNetGetUserA(LPCSTR lpName, LPSTR lpUserID, LPDWORD lpBufferSize)
static DWORD get_drive_connection(WCHAR letter, LPWSTR remote, LPDWORD size)
#define BAD_PROVIDER_INDEX
static DWORD _copyStringToEnumW(const WCHAR *source, DWORD *left, void **end)
DWORD WINAPI WNetGetUniversalNameW(LPCWSTR lpLocalPath, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpBufferSize)
DWORD WINAPI WNetSetConnectionW(LPCWSTR lpName, DWORD dwProperty, LPVOID pvValue)
DWORD WINAPI WNetGetLastErrorA(LPDWORD lpError, LPSTR lpErrorBuf, DWORD nErrorBufSize, LPSTR lpNameBuf, DWORD nNameBufSize)
DWORD WINAPI WNetGetUniversalNameA(LPCSTR lpLocalPath, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpBufferSize)
static DWORD wnet_use_connection(struct use_connection_context *ctxt)
static DWORD _enumerateContextW(PWNetEnumerator enumerator, LPDWORD lpcCount, LPVOID lpBuffer, LPDWORD lpBufferSize)
static DWORD _enumerateGlobalPassthroughW(PWNetEnumerator enumerator, LPDWORD lpcCount, LPVOID lpBuffer, LPDWORD lpBufferSize)