ReactOS 0.4.15-dev-8434-g155a7c7
wnetpriv.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void wnetInit (HINSTANCE hInstDll) DECLSPEC_HIDDEN
 
void wnetFree (void) DECLSPEC_HIDDEN
 

Function Documentation

◆ wnetFree()

void wnetFree ( void  )

Definition at line 492 of file wnet.c.

493{
494 if (providerTable)
495 {
496 DWORD i;
497
498 for (i = 0; i < providerTable->numProviders; i++)
499 {
502 }
506 }
507}
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
unsigned long DWORD
Definition: ntddk_ex.h:95
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
LPWSTR entireNetwork
Definition: wnet.c:74
DWORD numProviders
Definition: wnet.c:76
WNetProvider table[1]
Definition: wnet.c:77
PWSTR name
Definition: wnet.c:55
HMODULE hLib
Definition: wnet.c:54
#define FreeModule(m)
Definition: winbase.h:2033
static PWNetProviderTable providerTable
Definition: wnet.c:129

Referenced by DllMain().

◆ wnetInit()

void wnetInit ( HINSTANCE  hInstDll)

Definition at line 354 of file wnet.c.

355{
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 };
363 HKEY hKey;
364
365 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, providerOrderKey, 0, KEY_READ, &hKey)
366 == ERROR_SUCCESS)
367 {
368 DWORD size = 0;
369
370 RegQueryValueExW(hKey, providerOrder, NULL, NULL, NULL, &size);
371 if (size)
372 {
374
375 if (providers)
376 {
377 DWORD type;
378
379 if (RegQueryValueExW(hKey, providerOrder, NULL, &type,
381 {
382 PWSTR ptr;
383 DWORD numToAllocate;
384
385 TRACE("provider order is %s\n", debugstr_w(providers));
386 /* first count commas as a heuristic for how many to
387 * allocate space for */
388 for (ptr = providers, numToAllocate = 1; ptr; )
389 {
390 ptr = wcschr(ptr, ',');
391 if (ptr) {
392 numToAllocate++;
393 ptr++;
394 }
395 }
398 sizeof(WNetProviderTable)
399 + (numToAllocate - 1) * sizeof(WNetProvider));
400 if (providerTable)
401 {
402 PWSTR ptrPrev;
403 int entireNetworkLen;
404 LPCWSTR stringresource;
405
406 entireNetworkLen = LoadStringW(hInstDll,
407 IDS_ENTIRENETWORK, (LPWSTR)&stringresource, 0);
409 GetProcessHeap(), 0, (entireNetworkLen + 1) *
410 sizeof(WCHAR));
412 {
413 memcpy(providerTable->entireNetwork, stringresource, entireNetworkLen*sizeof(WCHAR));
414 providerTable->entireNetwork[entireNetworkLen] = 0;
415 }
416 providerTable->numAllocated = numToAllocate;
417 for (ptr = providers; ptr; )
418 {
419 ptrPrev = ptr;
420 ptr = wcschr(ptr, ',');
421 if (ptr)
422 *ptr++ = '\0';
423 _tryLoadProvider(ptrPrev);
424 }
425 }
426 }
428 }
429 }
431 }
432
433#ifdef __REACTOS__
434 if (providerTable)
435 {
436 HKEY user_profile;
437
438 if (RegOpenCurrentUser(KEY_ALL_ACCESS, &user_profile) == ERROR_SUCCESS)
439 {
441 WCHAR subkey[8] = {'N', 'e', 't', 'w', 'o', 'r', 'k', 0};
442
443 if (RegOpenKeyExW(user_profile, subkey, 0, KEY_READ, &network) == ERROR_SUCCESS)
444 {
445 DWORD size, max;
446
447 TRACE("Enumerating remembered connections\n");
448
450 {
451 WCHAR *local;
452
453 TRACE("There are %lu connections\n", max);
454
455 local = HeapAlloc(GetProcessHeap(), 0, (size + 1) * sizeof(WCHAR));
456 if (local)
457 {
458 DWORD index;
459
460 for (index = 0; index < max; ++index)
461 {
462 DWORD len = size + 1;
463 HKEY connection;
464
465 TRACE("Trying connection %lu\n", index);
466
468 continue;
469
470 TRACE("It is %S\n", local);
471
472 if (RegOpenKeyExW(network, local, 0, KEY_READ, &connection) != ERROR_SUCCESS)
473 continue;
474
475 _restoreSavedConnection(connection, local);
476 RegCloseKey(connection);
477 }
478
480 }
481 }
482
484 }
485
486 RegCloseKey(user_profile);
487 }
488 }
489#endif
490}
#define index(s, c)
Definition: various.h:29
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
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)
Definition: reg.c:2504
LONG WINAPI RegOpenCurrentUser(IN REGSAM samDesired, OUT PHKEY phkResult)
Definition: reg.c:3209
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
static struct list providers
Definition: sip.c:564
#define wcschr
Definition: compat.h:17
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define local
Definition: zutil.h:30
FxAutoRegKey hKey
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLuint index
Definition: glext.h:6031
GLenum GLsizei len
Definition: glext.h:6722
#define debugstr_w
Definition: kernel32.h:32
#define REG_SZ
Definition: layer.c:22
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static PVOID ptr
Definition: dispmode.c:27
#define IDS_ENTIRENETWORK
Definition: mprres.h:24
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define KEY_READ
Definition: nt_native.h:1023
#define TRACE(s)
Definition: solgame.cpp:4
DWORD numAllocated
Definition: wnet.c:75
#define max(a, b)
Definition: svc.c:63
data1 network
Definition: tftpd.cpp:49
uint16_t * PWSTR
Definition: typedefs.h:56
unsigned char * LPBYTE
Definition: typedefs.h:53
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define RegQueryInfoKey
Definition: winreg.h:521
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
static void _tryLoadProvider(PCWSTR provider)
Definition: wnet.c:135
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by DllMain().