ReactOS  0.4.14-dev-57-g333b8f1
np_enum.c
Go to the documentation of this file.
1 #include <windows.h>
2 #include <stdio.h>
3 
5 
6 #define INC_SHIFT ++debug_shift;
7 #define DEC_SHIFT --debug_shift;
8 #define PRT_SHIFT do { DWORD cur = 0; for (; cur < debug_shift; ++cur) printf("\t"); } while (0);
9 
11 {
12  DWORD ret;
13  HANDLE handle;
14  DWORD size = 0x1000;
15  NETRESOURCEW * out;
16  BOOL check = FALSE;
17 
18  if (resource && resource->lpRemoteName)
19  check = TRUE;
20 
22  if (ret != WN_SUCCESS)
23  return;
24 
26  if (!out)
27  {
29  return;
30  }
31 
32  INC_SHIFT
33 
34  if (check)
35  {
36  printf("Called with lpRemoteName not null, current value: %S\n", resource->lpRemoteName);
37  }
38 
39  do
40  {
41  DWORD count = -1;
42 
44  if (ret == WN_SUCCESS || ret == WN_MORE_DATA)
45  {
47 
48  current = out;
49  for (; count; count--)
50  {
51  PRT_SHIFT;
52  printf("lpRemoteName: %S\n", current->lpRemoteName);
53 
55  {
56  PRT_SHIFT;
57  printf("Found provider: %S\n", current->lpProvider);
59  }
60 
61  current++;
62  }
63  }
64  } while (ret != WN_NO_MORE_ENTRIES);
65  DEC_SHIFT;
66 
69 }
70 
71 int wmain(int argc, const WCHAR *argv[])
72 {
73  np_enum(NULL);
74 
75  return 0;
76 }
static int argc
Definition: ServiceArgs.c:12
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define TRUE
Definition: types.h:120
void np_enum(NETRESOURCEW *resource)
Definition: np_enum.c:10
#define WN_SUCCESS
Definition: winnetwk.h:111
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define argv
Definition: mplay32.c:18
#define RESOURCEUSAGE_CONTAINER
Definition: winnetwk.h:69
#define RESOURCE_GLOBALNET
Definition: winnetwk.h:59
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define PRT_SHIFT
Definition: np_enum.c:8
#define WNetOpenEnum
Definition: winnetwk.h:598
#define INC_SHIFT
Definition: np_enum.c:6
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
static FILE * out
Definition: regtests2xml.c:44
unsigned long DWORD
Definition: ntddk_ex.h:95
void check(CONTEXT *pContext)
Definition: NtContinue.c:61
int ret
int wmain(int argc, const WCHAR *argv[])
Definition: np_enum.c:71
DWORD WINAPI WNetCloseEnum(HANDLE hEnum)
Definition: wnet.c:1621
#define WNetEnumResource
Definition: winnetwk.h:599
#define RESOURCETYPE_DISK
Definition: winnetwk.h:64
#define DEC_SHIFT
Definition: np_enum.c:7
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define WN_NO_MORE_ENTRIES
Definition: winnetwk.h:146
#define WN_MORE_DATA
Definition: winnetwk.h:117
DWORD debug_shift
Definition: np_enum.c:4
#define HeapFree(x, y, z)
Definition: compat.h:394
struct task_struct * current
Definition: linux.c:32
#define printf
Definition: config.h:203