ReactOS  0.4.15-dev-4853-g3a72a52
srvsvc.c File Reference
#include "netapi32.h"
#include "srvsvc_c.h"
Include dependency graph for srvsvc.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (netapi32)
 
handle_t __RPC_USER SRVSVC_HANDLE_bind (SRVSVC_HANDLE pszSystemName)
 
void __RPC_USER SRVSVC_HANDLE_unbind (SRVSVC_HANDLE pszSystemName, handle_t hBinding)
 
NET_API_STATUS WINAPI NetConnectionEnum (_In_ LMSTR servername, _In_ LMSTR qualifier, _In_ DWORD level, _Out_ LPBYTE *bufptr, _In_ DWORD prefmaxlen, _Out_ LPDWORD entriesread, _Out_ LPDWORD totalentries, _Inout_ LPDWORD resume_handle)
 
NET_API_STATUS WINAPI NetFileClose (_In_ LMSTR servername, _In_ DWORD fileid)
 
NET_API_STATUS WINAPI NetFileEnum (_In_ LMSTR servername, _In_ LMSTR basepath, _In_ LMSTR username, _In_ DWORD level, _Out_ LPBYTE *bufptr, _In_ DWORD prefmaxlen, _Out_ LPDWORD entriesread, _Out_ LPDWORD totalentries, _Inout_ PDWORD_PTR resume_handle)
 
NET_API_STATUS WINAPI NetFileGetInfo (_In_ LMSTR servername, _In_ DWORD fileid, _In_ DWORD level, _Out_ LPBYTE *bufptr)
 
NET_API_STATUS WINAPI NetRemoteTOD (_In_ LPCWSTR UncServerName, _Out_ LPBYTE *BufferPtr)
 
NET_API_STATUS WINAPI NetServerDiskEnum (_In_ LMSTR servername, _In_ DWORD level, _Out_ LPBYTE *bufptr, _In_ DWORD prefmaxlen, _Out_ LPDWORD entriesread, _Out_ LPDWORD totalentries, _Inout_ LPDWORD resume_handle)
 
NET_API_STATUS WINAPI NetServerGetInfo (LMSTR servername, DWORD level, LPBYTE *bufptr)
 
NET_API_STATUS WINAPI NetServerSetInfo (_In_ LPWSTR servername, _In_ DWORD level, _In_ LPBYTE buf, _Out_ LPDWORD parm_err)
 
NET_API_STATUS WINAPI I_NetServerSetServiceBits (_In_ LPWSTR servername, _In_ LPWSTR transport, _In_ DWORD servicebits, _In_ DWORD updateimmediately)
 
NET_API_STATUS WINAPI NetServerTransportAdd (_In_ LPWSTR servername, _In_ DWORD level, _In_ LPBYTE bufptr)
 
NET_API_STATUS WINAPI NetServerTransportAddEx (_In_ LPWSTR servername, _In_ DWORD level, _In_ LPBYTE bufptr)
 
NET_API_STATUS WINAPI NetServerTransportDel (_In_ LPWSTR servername, _In_ DWORD level, _In_ LPBYTE bufptr)
 
NET_API_STATUS WINAPI NetServerTransportEnum (_In_ LPWSTR servername, _In_ DWORD level, _Out_ LPBYTE *bufptr, _In_ DWORD prefmaxlen, _Out_ LPDWORD entriesread, _Out_ LPDWORD totalentries, _Inout_ LPDWORD resume_handle)
 
NET_API_STATUS WINAPI NetSessionDel (_In_opt_ LMSTR servername, _In_opt_ LMSTR UncClientName, _In_opt_ LMSTR username)
 
NET_API_STATUS WINAPI NetSessionEnum (_In_opt_ LMSTR servername, _In_opt_ LMSTR UncClientName, _In_opt_ LMSTR username, _In_ DWORD level, _Out_ LPBYTE *bufptr, _In_ DWORD prefmaxlen, _Out_ LPDWORD entriesread, _Out_ LPDWORD totalentries, _Inout_ LPDWORD resume_handle)
 
NET_API_STATUS WINAPI NetSessionGetInfo (_In_opt_ LMSTR servername, _In_ LMSTR UncClientName, _In_ LMSTR username, _In_ DWORD level, _Out_ LPBYTE *bufptr)
 
NET_API_STATUS WINAPI NetShareAdd (_In_ LMSTR servername, _In_ DWORD level, _In_ LPBYTE buf, _Out_ LPDWORD parm_err)
 
NET_API_STATUS WINAPI NetShareCheck (_In_ LMSTR servername, _In_ LMSTR device, _Out_ LPDWORD type)
 
NET_API_STATUS WINAPI NetShareDel (_In_ LMSTR servername, _In_ LMSTR netname, _In_ DWORD reserved)
 
NET_API_STATUS WINAPI NetShareDelSticky (_In_ LMSTR servername, _In_ LMSTR netname, _In_ DWORD reserved)
 
NET_API_STATUS WINAPI NetShareEnum (_In_ LMSTR servername, _In_ DWORD level, _Out_ LPBYTE *bufptr, _In_ DWORD prefmaxlen, _Out_ LPDWORD entriesread, _Out_ LPDWORD totalentries, _Inout_ LPDWORD resume_handle)
 
NET_API_STATUS WINAPI NetShareEnumSticky (_In_ LMSTR servername, _In_ DWORD level, _Out_ LPBYTE *bufptr, _In_ DWORD prefmaxlen, _Out_ LPDWORD entriesread, _Out_ LPDWORD totalentries, _Inout_ LPDWORD resume_handle)
 
NET_API_STATUS WINAPI NetShareGetInfo (_In_ LMSTR servername, _In_ LMSTR netname, _In_ DWORD level, _Out_ LPBYTE *bufptr)
 
NET_API_STATUS WINAPI NetShareSetInfo (_In_ LPWSTR servername, _In_ LPWSTR netname, _In_ DWORD level, _In_ LPBYTE buf, _Out_ LPDWORD parm_err)
 

Function Documentation

◆ I_NetServerSetServiceBits()

NET_API_STATUS WINAPI I_NetServerSetServiceBits ( _In_ LPWSTR  servername,
_In_ LPWSTR  transport,
_In_ DWORD  servicebits,
_In_ DWORD  updateimmediately 
)

Definition at line 429 of file srvsvc.c.

434 {
436 
437  TRACE("I_NetServerSetServiceBits(%s %s 0x%lx %lu)\n",
438  debugstr_w(servername), debugstr_w(transport), servicebits, updateimmediately);
439 
441  {
442  status = NetrServerSetServiceBits(servername,
443  transport,
444  servicebits,
445  updateimmediately);
446  }
448  {
450  }
451  RpcEndExcept;
452 
453  return status;
454 }
#define RpcEndExcept
Definition: rpc.h:128
NET_API_STATUS __stdcall NetrServerSetServiceBits(SRVSVC_HANDLE ServerName, WCHAR *Transport, DWORD ServiceBits, DWORD UpdateImmediately)
Definition: rpcserver.c:616
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

◆ NetConnectionEnum()

NET_API_STATUS WINAPI NetConnectionEnum ( _In_ LMSTR  servername,
_In_ LMSTR  qualifier,
_In_ DWORD  level,
_Out_ LPBYTE bufptr,
_In_ DWORD  prefmaxlen,
_Out_ LPDWORD  entriesread,
_Out_ LPDWORD  totalentries,
_Inout_ LPDWORD  resume_handle 
)

Definition at line 75 of file srvsvc.c.

84 {
85  CONNECT_ENUM_STRUCT EnumStruct;
86  CONNECT_INFO_0_CONTAINER Level0Container = {0, NULL};
87  CONNECT_INFO_1_CONTAINER Level1Container = {0, NULL};
89 
90  TRACE("NetConnectionEnum(%s %s %s %lu %p %lu %p %p %p)\n",
91  debugstr_w(servername), debugstr_w(qualifier), level, bufptr,
92  prefmaxlen, entriesread, totalentries, resume_handle);
93 
94  if (level > 1)
95  return ERROR_INVALID_LEVEL;
96 
97  EnumStruct.Level = level;
98  switch (level)
99  {
100  case 0:
101  EnumStruct.ConnectInfo.Level0 = &Level0Container;
102  break;
103 
104  case 1:
105  EnumStruct.ConnectInfo.Level1 = &Level1Container;
106  break;
107  }
108 
110  {
111  status = NetrConnectionEnum(servername,
112  qualifier,
113  &EnumStruct,
114  prefmaxlen,
115  totalentries,
116  resume_handle);
117 
118  switch (level)
119  {
120  case 0:
121  if (EnumStruct.ConnectInfo.Level0->Buffer != NULL)
122  {
123  *bufptr = (LPBYTE)EnumStruct.ConnectInfo.Level0->Buffer;
124  *entriesread = EnumStruct.ConnectInfo.Level0->EntriesRead;
125  }
126  break;
127 
128  case 1:
129  if (EnumStruct.ConnectInfo.Level1->Buffer != NULL)
130  {
131  *bufptr = (LPBYTE)EnumStruct.ConnectInfo.Level1->Buffer;
132  *entriesread = EnumStruct.ConnectInfo.Level1->EntriesRead;
133  }
134  break;
135  }
136  }
138  {
140  }
141  RpcEndExcept;
142 
143  return status;
144 }
GLint level
Definition: gl.h:1546
#define RpcEndExcept
Definition: rpc.h:128
static unsigned int bufptr
Definition: tncon.cpp:77
LPCONNECTION_INFO_1 Buffer
Definition: srvsvc.idl:34
CONNECT_ENUM_UNION ConnectInfo
Definition: srvsvc.idl:46
CONNECT_INFO_0_CONTAINER * Level0
Definition: srvsvc.idl:39
unsigned char * LPBYTE
Definition: typedefs.h:53
LPCONNECTION_INFO_0 Buffer
Definition: srvsvc.idl:17
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
static APTTYPEQUALIFIER * qualifier
Definition: compobj.c:79
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define NULL
Definition: types.h:112
CONNECT_INFO_1_CONTAINER * Level1
Definition: srvsvc.idl:40
#define ERROR_INVALID_LEVEL
Definition: winerror.h:196
static SERVICE_STATUS status
Definition: service.c:31
NET_API_STATUS __stdcall NetrConnectionEnum(SRVSVC_HANDLE ServerName, WCHAR *Qualifier, LPCONNECT_ENUM_STRUCT InfoStruct, DWORD PreferedMaximumLength, DWORD *TotalEntries, DWORD *ResumeHandle)
Definition: rpcserver.c:162
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

◆ NetFileClose()

NET_API_STATUS WINAPI NetFileClose ( _In_ LMSTR  servername,
_In_ DWORD  fileid 
)

Definition at line 149 of file srvsvc.c.

152 {
154 
155  TRACE("NetFileClose(%s %lu)\n",
156  debugstr_w(servername), fileid);
157 
159  {
160  status = NetrFileClose(servername,
161  fileid);
162  }
164  {
166  }
167  RpcEndExcept;
168 
169  return status;
170 }
#define RpcEndExcept
Definition: rpc.h:128
NET_API_STATUS __stdcall NetrFileClose(SRVSVC_HANDLE ServerName, DWORD FileId)
Definition: rpcserver.c:209
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

◆ NetFileEnum()

NET_API_STATUS WINAPI NetFileEnum ( _In_ LMSTR  servername,
_In_ LMSTR  basepath,
_In_ LMSTR  username,
_In_ DWORD  level,
_Out_ LPBYTE bufptr,
_In_ DWORD  prefmaxlen,
_Out_ LPDWORD  entriesread,
_Out_ LPDWORD  totalentries,
_Inout_ PDWORD_PTR  resume_handle 
)

Definition at line 175 of file srvsvc.c.

185 {
186  FILE_ENUM_STRUCT EnumStruct;
187  FILE_INFO_2_CONTAINER Level2Container = {0, NULL};
188  FILE_INFO_3_CONTAINER Level3Container = {0, NULL};
190 
191  TRACE("NetFileEnum(%s %s %s %lu %p %lu %p %p %p)\n",
192  debugstr_w(servername), debugstr_w(basepath), debugstr_w(username),
193  level, bufptr, prefmaxlen, entriesread, totalentries, resume_handle);
194 
195  if (level != 2 && level != 3)
196  return ERROR_INVALID_LEVEL;
197 
198  EnumStruct.Level = level;
199  switch (level)
200  {
201  case 2:
202  EnumStruct.FileInfo.Level2 = &Level2Container;
203  break;
204 
205  case 3:
206  EnumStruct.FileInfo.Level3 = &Level3Container;
207  break;
208  }
209 
211  {
212  status = NetrFileEnum(servername,
213  basepath,
214  username,
215  &EnumStruct,
216  prefmaxlen,
217  totalentries,
218  (PDWORD)resume_handle);
219 
220  switch (level)
221  {
222  case 2:
223  if (EnumStruct.FileInfo.Level2->Buffer != NULL)
224  {
225  *bufptr = (LPBYTE)EnumStruct.FileInfo.Level2->Buffer;
226  *entriesread = EnumStruct.FileInfo.Level2->EntriesRead;
227  }
228  break;
229 
230  case 3:
231  if (EnumStruct.FileInfo.Level3->Buffer != NULL)
232  {
233  *bufptr = (LPBYTE)EnumStruct.FileInfo.Level3->Buffer;
234  *entriesread = EnumStruct.FileInfo.Level3->EntriesRead;
235  }
236  break;
237  }
238  }
240  {
242  }
243  RpcEndExcept;
244 
245  return status;
246 }
GLint level
Definition: gl.h:1546
#define RpcEndExcept
Definition: rpc.h:128
static unsigned int bufptr
Definition: tncon.cpp:77
LPFILE_INFO_2 Buffer
Definition: srvsvc.idl:57
NET_API_STATUS __stdcall NetrFileEnum(SRVSVC_HANDLE ServerName, WCHAR *BasePath, WCHAR *UserName, PFILE_ENUM_STRUCT InfoStruct, DWORD PreferedMaximumLength, DWORD *TotalEntries, DWORD *ResumeHandle)
Definition: rpcserver.c:178
FILE_ENUM_UNION FileInfo
Definition: srvsvc.idl:84
unsigned char * LPBYTE
Definition: typedefs.h:53
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
static WCHAR username[]
Definition: url.c:32
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
FILE_INFO_3_CONTAINER * Level3
Definition: srvsvc.idl:78
FILE_INFO_2_CONTAINER * Level2
Definition: srvsvc.idl:77
#define NULL
Definition: types.h:112
DWORD * PDWORD
Definition: pedump.c:68
LPFILE_INFO_3 Buffer
Definition: srvsvc.idl:72
#define ERROR_INVALID_LEVEL
Definition: winerror.h:196
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

◆ NetFileGetInfo()

NET_API_STATUS WINAPI NetFileGetInfo ( _In_ LMSTR  servername,
_In_ DWORD  fileid,
_In_ DWORD  level,
_Out_ LPBYTE bufptr 
)

Definition at line 251 of file srvsvc.c.

256 {
258 
259  TRACE("NetFileGetInfo(%s %lu %lu %p)\n",
260  debugstr_w(servername), fileid, level, bufptr);
261 
262  *bufptr = NULL;
263 
265  {
266  status = NetrFileGetInfo(servername,
267  fileid,
268  level,
270  }
272  {
274  }
275  RpcEndExcept;
276 
277  return status;
278 }
GLint level
Definition: gl.h:1546
#define RpcEndExcept
Definition: rpc.h:128
static unsigned int bufptr
Definition: tncon.cpp:77
NET_API_STATUS __stdcall NetrFileGetInfo(SRVSVC_HANDLE ServerName, DWORD FileId, DWORD Level, LPFILE_INFO InfoStruct)
Definition: rpcserver.c:195
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define NULL
Definition: types.h:112
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

◆ NetRemoteTOD()

NET_API_STATUS WINAPI NetRemoteTOD ( _In_ LPCWSTR  UncServerName,
_Out_ LPBYTE BufferPtr 
)

Definition at line 283 of file srvsvc.c.

286 {
288 
289  TRACE("NetRemoteTOD(%s %p)\n",
290  debugstr_w(UncServerName), BufferPtr);
291 
292  *BufferPtr = NULL;
293 
295  {
296  status = NetrRemoteTOD((SRVSVC_HANDLE)UncServerName,
297  (LPTIME_OF_DAY_INFO *)BufferPtr);
298  }
300  {
302  }
303  RpcEndExcept;
304 
305  return status;
306 }
#define RpcEndExcept
Definition: rpc.h:128
NET_API_STATUS __stdcall NetrRemoteTOD(SRVSVC_HANDLE ServerName, LPTIME_OF_DAY_INFO *BufferPtr)
Definition: rpcserver.c:548
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define NULL
Definition: types.h:112
wchar_t * SRVSVC_HANDLE
Definition: srvsvc.idl:7
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

◆ NetServerDiskEnum()

NET_API_STATUS WINAPI NetServerDiskEnum ( _In_ LMSTR  servername,
_In_ DWORD  level,
_Out_ LPBYTE bufptr,
_In_ DWORD  prefmaxlen,
_Out_ LPDWORD  entriesread,
_Out_ LPDWORD  totalentries,
_Inout_ LPDWORD  resume_handle 
)

Definition at line 311 of file srvsvc.c.

319 {
320  DISK_ENUM_CONTAINER EnumContainer;
322 
323  TRACE("NetServerDiskEnum(%s %lu %p %lu %p %p %p)\n",
324  debugstr_w(servername), level, bufptr, prefmaxlen,
325  entriesread, totalentries, resume_handle);
326 
327  EnumContainer.EntriesRead = 0;
328  EnumContainer.Buffer = NULL;
329 
331  {
332  status = NetrServerDiskEnum(servername,
333  level,
334  &EnumContainer,
335  prefmaxlen,
336  totalentries,
337  resume_handle);
338 
339  if (EnumContainer.Buffer != NULL)
340  {
341  *bufptr = (LPBYTE)EnumContainer.Buffer;
342  }
343  else
344  {
345  *bufptr = NULL;
346  }
347 
348  if (EnumContainer.EntriesRead > 0)
349  {
350  *entriesread = EnumContainer.EntriesRead - 1;
351  }
352  else
353  {
354  *entriesread = 0;
355  }
356  }
358  {
360  }
361  RpcEndExcept;
362 
363  return status;
364 }
GLint level
Definition: gl.h:1546
#define RpcEndExcept
Definition: rpc.h:128
static unsigned int bufptr
Definition: tncon.cpp:77
NET_API_STATUS __stdcall NetrServerDiskEnum(SRVSVC_HANDLE ServerName, DWORD Level, DISK_ENUM_CONTAINER *DiskInfoStruct, DWORD PreferedMaximumLength, DWORD *TotalEntries, DWORD *ResumeHandle)
Definition: rpcserver.c:456
unsigned char * LPBYTE
Definition: typedefs.h:53
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
LPDISK_INFO Buffer
Definition: srvsvc.idl:856
#define NULL
Definition: types.h:112
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

◆ NetServerGetInfo()

NET_API_STATUS WINAPI NetServerGetInfo ( LMSTR  servername,
DWORD  level,
LPBYTE bufptr 
)

Definition at line 369 of file srvsvc.c.

373 {
375 
376  TRACE("NetServerGetInfo(%s %lu %p)\n",
377  debugstr_w(servername), level, bufptr);
378 
379  *bufptr = NULL;
380 
382  {
383  status = NetrServerGetInfo(servername,
384  level,
385  (LPSERVER_INFO *)bufptr);
386  }
388  {
390  }
391  RpcEndExcept;
392 
393  return status;
394 }
GLint level
Definition: gl.h:1546
#define RpcEndExcept
Definition: rpc.h:128
static unsigned int bufptr
Definition: tncon.cpp:77
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
NET_API_STATUS __stdcall NetrServerGetInfo(SRVSVC_HANDLE ServerName, DWORD Level, LPSERVER_INFO *InfoStruct)
Definition: rpcserver.c:348
#define NULL
Definition: types.h:112
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

Referenced by _tmain(), cmdConfig(), DisplayLocalGroup(), DisplayServerStatistics(), EnumerateGroups(), EnumerateLocalGroups(), and EnumerateUsers().

◆ NetServerSetInfo()

NET_API_STATUS WINAPI NetServerSetInfo ( _In_ LPWSTR  servername,
_In_ DWORD  level,
_In_ LPBYTE  buf,
_Out_ LPDWORD  parm_err 
)

Definition at line 399 of file srvsvc.c.

404 {
406 
407  TRACE("NetServerSetInfo(%s %lu %p %p)\n",
408  debugstr_w(servername), level, buf, parm_err);
409 
411  {
412  status = NetrServerSetInfo(servername,
413  level,
414  (LPSERVER_INFO)&buf,
415  parm_err);
416  }
418  {
420  }
421  RpcEndExcept;
422 
423  return status;
424 }
GLint level
Definition: gl.h:1546
#define RpcEndExcept
Definition: rpc.h:128
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
NET_API_STATUS __stdcall NetrServerSetInfo(SRVSVC_HANDLE ServerName, DWORD Level, LPSERVER_INFO ServerInfo, DWORD *ParmErr)
Definition: rpcserver.c:442
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

Referenced by cmdConfig().

◆ NetServerTransportAdd()

NET_API_STATUS WINAPI NetServerTransportAdd ( _In_ LPWSTR  servername,
_In_ DWORD  level,
_In_ LPBYTE  bufptr 
)

Definition at line 459 of file srvsvc.c.

463 {
465 
466  TRACE("NetServerTransportAdd(%s %lu %p)\n",
467  debugstr_w(servername), level, bufptr);
468 
470  {
471  status = NetrServerTransportAdd(servername,
472  level,
474  }
476  {
478  }
479  RpcEndExcept;
480 
481  return status;
482 }
NET_API_STATUS __stdcall NetrServerTransportAdd(SRVSVC_HANDLE ServerName, DWORD Level, LPSERVER_TRANSPORT_INFO_0 Buffer)
Definition: rpcserver.c:507
GLint level
Definition: gl.h:1546
#define RpcEndExcept
Definition: rpc.h:128
static unsigned int bufptr
Definition: tncon.cpp:77
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

◆ NetServerTransportAddEx()

NET_API_STATUS WINAPI NetServerTransportAddEx ( _In_ LPWSTR  servername,
_In_ DWORD  level,
_In_ LPBYTE  bufptr 
)

Definition at line 487 of file srvsvc.c.

491 {
493 
494  TRACE("NetServerTransportAddEx(%s %lu %p)\n",
495  debugstr_w(servername), level, bufptr);
496 
498  {
499  status = NetrServerTransportAddEx(servername,
500  level,
502  }
504  {
506  }
507  RpcEndExcept;
508 
509  return status;
510 }
GLint level
Definition: gl.h:1546
#define RpcEndExcept
Definition: rpc.h:128
static unsigned int bufptr
Definition: tncon.cpp:77
NET_API_STATUS __stdcall NetrServerTransportAddEx(SRVSVC_HANDLE ServerName, DWORD Level, LPTRANSPORT_INFO Buffer)
Definition: rpcserver.c:798
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

◆ NetServerTransportDel()

NET_API_STATUS WINAPI NetServerTransportDel ( _In_ LPWSTR  servername,
_In_ DWORD  level,
_In_ LPBYTE  bufptr 
)

Definition at line 515 of file srvsvc.c.

519 {
521 
522  TRACE("NetServerTransportDel(%s %lu %p)\n",
523  debugstr_w(servername), level, bufptr);
524 
526  {
527  status = NetrServerTransportDel(servername,
528  level,
530  }
532  {
534  }
535  RpcEndExcept;
536 
537  return status;
538 }
GLint level
Definition: gl.h:1546
#define RpcEndExcept
Definition: rpc.h:128
static unsigned int bufptr
Definition: tncon.cpp:77
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
NET_API_STATUS __stdcall NetrServerTransportDel(SRVSVC_HANDLE ServerName, DWORD Level, LPSERVER_TRANSPORT_INFO_0 Buffer)
Definition: rpcserver.c:535
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

◆ NetServerTransportEnum()

NET_API_STATUS WINAPI NetServerTransportEnum ( _In_ LPWSTR  servername,
_In_ DWORD  level,
_Out_ LPBYTE bufptr,
_In_ DWORD  prefmaxlen,
_Out_ LPDWORD  entriesread,
_Out_ LPDWORD  totalentries,
_Inout_ LPDWORD  resume_handle 
)

Definition at line 543 of file srvsvc.c.

551 {
552  SERVER_XPORT_ENUM_STRUCT EnumStruct;
553  SERVER_XPORT_INFO_0_CONTAINER Level0Container = {0, NULL};
554  SERVER_XPORT_INFO_1_CONTAINER Level1Container = {0, NULL};
556 
557  TRACE("NetServerTransportEnum(%s %lu %p %lu %p %p %p)\n",
558  debugstr_w(servername), level, bufptr, prefmaxlen,
559  entriesread, totalentries, resume_handle);
560 
561  EnumStruct.Level = level;
562  switch (level)
563  {
564  case 0:
565  EnumStruct.XportInfo.Level0 = &Level0Container;
566  break;
567 
568  case 1:
569  EnumStruct.XportInfo.Level1 = &Level1Container;
570  break;
571  }
572 
574  {
575  status = NetrServerTransportEnum(servername,
576  &EnumStruct,
577  prefmaxlen,
578  totalentries,
579  resume_handle);
580 
581  switch (level)
582  {
583  case 0:
584  if (EnumStruct.XportInfo.Level0->Buffer != NULL)
585  {
586  *bufptr = (LPBYTE)EnumStruct.XportInfo.Level0->Buffer;
587  *entriesread = EnumStruct.XportInfo.Level0->EntriesRead;
588  }
589  break;
590 
591  case 1:
592  if (EnumStruct.XportInfo.Level1->Buffer != NULL)
593  {
594  *bufptr = (LPBYTE)EnumStruct.XportInfo.Level1->Buffer;
595  *entriesread = EnumStruct.XportInfo.Level1->EntriesRead;
596  }
597  break;
598  }
599  }
601  {
603  }
604  RpcEndExcept;
605 
606  return status;
607 }
GLint level
Definition: gl.h:1546
#define RpcEndExcept
Definition: rpc.h:128
PSERVER_XPORT_INFO_1_CONTAINER Level1
Definition: srvsvc.idl:945
NET_API_STATUS __stdcall NetrServerTransportEnum(SRVSVC_HANDLE ServerName, LPSERVER_XPORT_ENUM_STRUCT InfoStruct, DWORD PreferedMaximumLength, DWORD *TotalEntries, DWORD *ResumeHandle)
Definition: rpcserver.c:520
static unsigned int bufptr
Definition: tncon.cpp:77
LPSERVER_TRANSPORT_INFO_0 Buffer
Definition: srvsvc.idl:873
PSERVER_XPORT_INFO_0_CONTAINER Level0
Definition: srvsvc.idl:944
unsigned char * LPBYTE
Definition: typedefs.h:53
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
SERVER_XPORT_ENUM_UNION XportInfo
Definition: srvsvc.idl:953
LPSERVER_TRANSPORT_INFO_1 Buffer
Definition: srvsvc.idl:891
#define NULL
Definition: types.h:112
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

Referenced by DisplayServerConfig().

◆ NetSessionDel()

NET_API_STATUS WINAPI NetSessionDel ( _In_opt_ LMSTR  servername,
_In_opt_ LMSTR  UncClientName,
_In_opt_ LMSTR  username 
)

Definition at line 612 of file srvsvc.c.

616 {
618 
619  TRACE("NetSessionDel(%s %s %s)\n",
620  debugstr_w(servername), debugstr_w(UncClientName), debugstr_w(username));
621 
623  {
624  status = NetrSessionDel(servername,
625  UncClientName,
626  username);
627  }
629  {
631  }
632  RpcEndExcept;
633 
634  return status;
635 }
#define RpcEndExcept
Definition: rpc.h:128
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
static WCHAR username[]
Definition: url.c:32
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
NET_API_STATUS __stdcall NetrSessionDel(SRVSVC_HANDLE ServerName, WCHAR *ClientName, WCHAR *UserName)
Definition: rpcserver.c:238
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

◆ NetSessionEnum()

NET_API_STATUS WINAPI NetSessionEnum ( _In_opt_ LMSTR  servername,
_In_opt_ LMSTR  UncClientName,
_In_opt_ LMSTR  username,
_In_ DWORD  level,
_Out_ LPBYTE bufptr,
_In_ DWORD  prefmaxlen,
_Out_ LPDWORD  entriesread,
_Out_ LPDWORD  totalentries,
_Inout_ LPDWORD  resume_handle 
)

Definition at line 640 of file srvsvc.c.

650 {
651  SESSION_ENUM_STRUCT EnumStruct;
652  SESSION_INFO_0_CONTAINER Level0Container = {0, NULL};
653  SESSION_INFO_1_CONTAINER Level1Container = {0, NULL};
654  SESSION_INFO_2_CONTAINER Level2Container = {0, NULL};
655  SESSION_INFO_10_CONTAINER Level10Container = {0, NULL};
656  SESSION_INFO_502_CONTAINER Level502Container = {0, NULL};
658 
659  TRACE("NetSessionEnum(%s %s %s %lu %p %lu %p %p %p)\n",
660  debugstr_w(servername), debugstr_w(UncClientName), debugstr_w(username),
661  level, bufptr, prefmaxlen, entriesread, totalentries, resume_handle);
662 
663  if (level > 2 && level != 10 && level != 502)
664  return ERROR_INVALID_LEVEL;
665 
666  *bufptr = NULL;
667  *entriesread = 0;
668 
669  EnumStruct.Level = level;
670  switch (level)
671  {
672  case 0:
673  EnumStruct.SessionInfo.Level0 = &Level0Container;
674  break;
675 
676  case 1:
677  EnumStruct.SessionInfo.Level1 = &Level1Container;
678  break;
679 
680  case 2:
681  EnumStruct.SessionInfo.Level2 = &Level2Container;
682  break;
683 
684  case 10:
685  EnumStruct.SessionInfo.Level10 = &Level10Container;
686  break;
687 
688  case 502:
689  EnumStruct.SessionInfo.Level502 = &Level502Container;
690  break;
691  }
692 
694  {
695  status = NetrSessionEnum(servername,
696  UncClientName,
697  username,
698  &EnumStruct,
699  prefmaxlen,
700  totalentries,
701  resume_handle);
702 
703  switch (level)
704  {
705  case 0:
706  if (EnumStruct.SessionInfo.Level0->Buffer != NULL)
707  {
708  *bufptr = (LPBYTE)EnumStruct.SessionInfo.Level0->Buffer;
709  *entriesread = EnumStruct.SessionInfo.Level0->EntriesRead;
710  }
711  break;
712 
713  case 1:
714  if (EnumStruct.SessionInfo.Level1->Buffer != NULL)
715  {
716  *bufptr = (LPBYTE)EnumStruct.SessionInfo.Level1->Buffer;
717  *entriesread = EnumStruct.SessionInfo.Level1->EntriesRead;
718  }
719  break;
720 
721  case 2:
722  if (EnumStruct.SessionInfo.Level2->Buffer != NULL)
723  {
724  *bufptr = (LPBYTE)EnumStruct.SessionInfo.Level2->Buffer;
725  *entriesread = EnumStruct.SessionInfo.Level2->EntriesRead;
726  }
727  break;
728 
729  case 10:
730  if (EnumStruct.SessionInfo.Level10->Buffer != NULL)
731  {
732  *bufptr = (LPBYTE)EnumStruct.SessionInfo.Level10->Buffer;
733  *entriesread = EnumStruct.SessionInfo.Level10->EntriesRead;
734  }
735  break;
736 
737  case 502:
738  if (EnumStruct.SessionInfo.Level502->Buffer != NULL)
739  {
740  *bufptr = (LPBYTE)EnumStruct.SessionInfo.Level502->Buffer;
741  *entriesread = EnumStruct.SessionInfo.Level502->EntriesRead;
742  }
743  break;
744  }
745  }
747  {
749  }
750  RpcEndExcept;
751 
752  return status;
753 }
LPSESSION_INFO_1 Buffer
Definition: srvsvc.idl:117
GLint level
Definition: gl.h:1546
#define RpcEndExcept
Definition: rpc.h:128
NET_API_STATUS __stdcall NetrSessionEnum(SRVSVC_HANDLE ServerName, WCHAR *ClientName, WCHAR *UserName, PSESSION_ENUM_STRUCT InfoStruct, DWORD PreferedMaximumLength, DWORD *TotalEntries, DWORD *ResumeHandle)
Definition: rpcserver.c:221
static unsigned int bufptr
Definition: tncon.cpp:77
SESSION_INFO_10_CONTAINER * Level10
Definition: srvsvc.idl:174
SESSION_ENUM_UNION SessionInfo
Definition: srvsvc.idl:180
LPSESSION_INFO_0 Buffer
Definition: srvsvc.idl:101
unsigned char * LPBYTE
Definition: typedefs.h:53
#define debugstr_w
Definition: kernel32.h:32
SESSION_INFO_1_CONTAINER * Level1
Definition: srvsvc.idl:172
#define RpcTryExcept
Definition: rpc.h:126
LPSESSION_INFO_10 Buffer
Definition: srvsvc.idl:148
SESSION_INFO_502_CONTAINER * Level502
Definition: srvsvc.idl:175
static WCHAR username[]
Definition: url.c:32
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
SESSION_INFO_2_CONTAINER * Level2
Definition: srvsvc.idl:173
#define NULL
Definition: types.h:112
LPSESSION_INFO_502 Buffer
Definition: srvsvc.idl:166
SESSION_INFO_0_CONTAINER * Level0
Definition: srvsvc.idl:171
#define ERROR_INVALID_LEVEL
Definition: winerror.h:196
static SERVICE_STATUS status
Definition: service.c:31
LPSESSION_INFO_2 Buffer
Definition: srvsvc.idl:134
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

◆ NetSessionGetInfo()

NET_API_STATUS WINAPI NetSessionGetInfo ( _In_opt_ LMSTR  servername,
_In_ LMSTR  UncClientName,
_In_ LMSTR  username,
_In_ DWORD  level,
_Out_ LPBYTE bufptr 
)

Definition at line 758 of file srvsvc.c.

764 {
765  SESSION_ENUM_STRUCT EnumStruct;
766  SESSION_INFO_0_CONTAINER Level0Container = {0, NULL};
767  SESSION_INFO_1_CONTAINER Level1Container = {0, NULL};
768  SESSION_INFO_2_CONTAINER Level2Container = {0, NULL};
769  SESSION_INFO_10_CONTAINER Level10Container = {0, NULL};
770  DWORD dwTotalEntries;
772 
773  TRACE("NetSessionGetInfo(%s %s %s %lu %p)\n",
774  debugstr_w(servername), debugstr_w(UncClientName),
776 
777  if (level > 2 && level != 10)
778  return ERROR_INVALID_LEVEL;
779 
780  if (UncClientName == NULL || username == NULL)
782 
783  *bufptr = NULL;
784 
785  EnumStruct.Level = level;
786  switch (level)
787  {
788  case 0:
789  EnumStruct.SessionInfo.Level0 = &Level0Container;
790  break;
791 
792  case 1:
793  EnumStruct.SessionInfo.Level1 = &Level1Container;
794  break;
795 
796  case 2:
797  EnumStruct.SessionInfo.Level2 = &Level2Container;
798  break;
799 
800  case 10:
801  EnumStruct.SessionInfo.Level10 = &Level10Container;
802  break;
803  }
804 
806  {
807  status = NetrSessionEnum(servername,
808  UncClientName,
809  username,
810  &EnumStruct,
811  MAX_PREFERRED_LENGTH, //(DWORD)-1,
812  &dwTotalEntries,
813  NULL);
814 
815  switch (level)
816  {
817  case 0:
818  if (EnumStruct.SessionInfo.Level0->Buffer != NULL)
819  *bufptr = (LPBYTE)EnumStruct.SessionInfo.Level0->Buffer;
820  break;
821 
822  case 1:
823  if (EnumStruct.SessionInfo.Level1->Buffer != NULL)
824  *bufptr = (LPBYTE)EnumStruct.SessionInfo.Level1->Buffer;
825  break;
826 
827  case 2:
828  if (EnumStruct.SessionInfo.Level2->Buffer != NULL)
829  *bufptr = (LPBYTE)EnumStruct.SessionInfo.Level2->Buffer;
830  break;
831 
832  case 10:
833  if (EnumStruct.SessionInfo.Level10->Buffer != NULL)
834  *bufptr = (LPBYTE)EnumStruct.SessionInfo.Level10->Buffer;
835  break;
836  }
837  }
839  {
841  }
842  RpcEndExcept;
843 
844  return status;
845 }
LPSESSION_INFO_1 Buffer
Definition: srvsvc.idl:117
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define MAX_PREFERRED_LENGTH
Definition: lmcons.h:48
GLint level
Definition: gl.h:1546
#define RpcEndExcept
Definition: rpc.h:128
NET_API_STATUS __stdcall NetrSessionEnum(SRVSVC_HANDLE ServerName, WCHAR *ClientName, WCHAR *UserName, PSESSION_ENUM_STRUCT InfoStruct, DWORD PreferedMaximumLength, DWORD *TotalEntries, DWORD *ResumeHandle)
Definition: rpcserver.c:221
static unsigned int bufptr
Definition: tncon.cpp:77
SESSION_INFO_10_CONTAINER * Level10
Definition: srvsvc.idl:174
SESSION_ENUM_UNION SessionInfo
Definition: srvsvc.idl:180
if(dx==0 &&dy==0)
Definition: linetemp.h:174
LPSESSION_INFO_0 Buffer
Definition: srvsvc.idl:101
unsigned char * LPBYTE
Definition: typedefs.h:53
#define debugstr_w
Definition: kernel32.h:32
SESSION_INFO_1_CONTAINER * Level1
Definition: srvsvc.idl:172
#define RpcTryExcept
Definition: rpc.h:126
LPSESSION_INFO_10 Buffer
Definition: srvsvc.idl:148
static WCHAR username[]
Definition: url.c:32
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
unsigned long DWORD
Definition: ntddk_ex.h:95
SESSION_INFO_2_CONTAINER * Level2
Definition: srvsvc.idl:173
#define NULL
Definition: types.h:112
SESSION_INFO_0_CONTAINER * Level0
Definition: srvsvc.idl:171
#define ERROR_INVALID_LEVEL
Definition: winerror.h:196
static SERVICE_STATUS status
Definition: service.c:31
LPSESSION_INFO_2 Buffer
Definition: srvsvc.idl:134
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

◆ NetShareAdd()

NET_API_STATUS WINAPI NetShareAdd ( _In_ LMSTR  servername,
_In_ DWORD  level,
_In_ LPBYTE  buf,
_Out_ LPDWORD  parm_err 
)

Definition at line 850 of file srvsvc.c.

855 {
857 
858  TRACE("NetShareAdd(%s %lu %p %p)\n",
859  debugstr_w(servername), level, buf, parm_err);
860 
861  if (level != 2 && level != 502 && level != 503)
862  return ERROR_INVALID_LEVEL;
863 
865  {
866  status = NetrShareAdd(servername,
867  level,
868  (LPSHARE_INFO)&buf,
869  parm_err);
870  }
872  {
874  }
875  RpcEndExcept;
876 
877  return status;
878 }
GLint level
Definition: gl.h:1546
#define RpcEndExcept
Definition: rpc.h:128
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
NET_API_STATUS __stdcall NetrShareAdd(SRVSVC_HANDLE ServerName, DWORD Level, LPSHARE_INFO InfoStruct, DWORD *ParmErr)
Definition: rpcserver.c:251
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define ERROR_INVALID_LEVEL
Definition: winerror.h:196
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

Referenced by cmdShare().

◆ NetShareCheck()

NET_API_STATUS WINAPI NetShareCheck ( _In_ LMSTR  servername,
_In_ LMSTR  device,
_Out_ LPDWORD  type 
)

Definition at line 883 of file srvsvc.c.

887 {
889 
890  TRACE("NetShareCheck(%s %s %p)\n",
891  debugstr_w(servername), debugstr_w(device), type);
892 
894  {
895  status = NetrShareCheck(servername,
896  device,
897  type);
898  }
900  {
902  }
903  RpcEndExcept;
904 
905  return status;
906 }
#define RpcEndExcept
Definition: rpc.h:128
NET_API_STATUS __stdcall NetrShareCheck(SRVSVC_HANDLE ServerName, WCHAR *Device, DWORD *Type)
Definition: rpcserver.c:335
Definition: devices.h:37
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

◆ NetShareDel()

NET_API_STATUS WINAPI NetShareDel ( _In_ LMSTR  servername,
_In_ LMSTR  netname,
_In_ DWORD  reserved 
)

Definition at line 911 of file srvsvc.c.

915 {
917 
918  TRACE("NetShareDel(%s %s %lu)\n",
919  debugstr_w(servername), debugstr_w(netname), reserved);
920 
921  if (netname == NULL || (*netname == 0) || reserved != 0)
923 
925  {
926  status = NetrShareDel(servername,
927  netname,
928  reserved);
929  }
931  {
933  }
934  RpcEndExcept;
935 
936  return status;
937 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define RpcEndExcept
Definition: rpc.h:128
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
r reserved
Definition: btrfs.c:2975
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define NULL
Definition: types.h:112
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
NET_API_STATUS __stdcall NetrShareDel(SRVSVC_HANDLE ServerName, WCHAR *NetName, DWORD Reserved)
Definition: rpcserver.c:309
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

Referenced by cmdShare().

◆ NetShareDelSticky()

NET_API_STATUS WINAPI NetShareDelSticky ( _In_ LMSTR  servername,
_In_ LMSTR  netname,
_In_ DWORD  reserved 
)

Definition at line 942 of file srvsvc.c.

946 {
948 
949  TRACE("NetShareDelSticky(%s %s %lu)\n",
950  debugstr_w(servername), debugstr_w(netname), reserved);
951 
952  if (netname == NULL || (*netname == 0) || reserved != 0)
954 
956  {
957  status = NetrShareDelSticky(servername,
958  netname,
959  reserved);
960  }
962  {
964  }
965  RpcEndExcept;
966 
967  return status;
968 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define RpcEndExcept
Definition: rpc.h:128
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
r reserved
Definition: btrfs.c:2975
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
NET_API_STATUS __stdcall NetrShareDelSticky(SRVSVC_HANDLE ServerName, WCHAR *NetName, DWORD Reserved)
Definition: rpcserver.c:322
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define NULL
Definition: types.h:112
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

◆ NetShareEnum()

NET_API_STATUS WINAPI NetShareEnum ( _In_ LMSTR  servername,
_In_ DWORD  level,
_Out_ LPBYTE bufptr,
_In_ DWORD  prefmaxlen,
_Out_ LPDWORD  entriesread,
_Out_ LPDWORD  totalentries,
_Inout_ LPDWORD  resume_handle 
)

Definition at line 973 of file srvsvc.c.

981 {
982  SHARE_ENUM_STRUCT EnumStruct;
983  SHARE_INFO_0_CONTAINER Level0Container = {0, NULL};
984  SHARE_INFO_1_CONTAINER Level1Container = {0, NULL};
985  SHARE_INFO_2_CONTAINER Level2Container = {0, NULL};
986  SHARE_INFO_502_CONTAINER Level502Container = {0, NULL};
988 
989  TRACE("NetShareEnum(%s %lu %p %lu %p %p %p)\n",
990  debugstr_w(servername), level, bufptr, prefmaxlen,
991  entriesread, totalentries, resume_handle);
992 
993  if (level > 2 && level != 502)
994  return ERROR_INVALID_LEVEL;
995 
996  *bufptr = NULL;
997  *entriesread = 0;
998  *totalentries = 0;
999 
1000  EnumStruct.Level = level;
1001  switch (level)
1002  {
1003  case 0:
1004  EnumStruct.ShareInfo.Level0 = &Level0Container;
1005  break;
1006 
1007  case 1:
1008  EnumStruct.ShareInfo.Level1 = &Level1Container;
1009  break;
1010 
1011  case 2:
1012  EnumStruct.ShareInfo.Level2 = &Level2Container;
1013  break;
1014 
1015  case 502:
1016  EnumStruct.ShareInfo.Level502 = &Level502Container;
1017  break;
1018  }
1019 
1020  RpcTryExcept
1021  {
1022  status = NetrShareEnum(servername,
1023  &EnumStruct,
1024  prefmaxlen,
1025  totalentries,
1026  resume_handle);
1027 
1028  switch (level)
1029  {
1030  case 0:
1031  if (EnumStruct.ShareInfo.Level0->Buffer != NULL)
1032  {
1033  *bufptr = (LPBYTE)EnumStruct.ShareInfo.Level0->Buffer;
1034  *entriesread = EnumStruct.ShareInfo.Level0->EntriesRead;
1035  }
1036  break;
1037 
1038  case 1:
1039  if (EnumStruct.ShareInfo.Level1->Buffer != NULL)
1040  {
1041  *bufptr = (LPBYTE)EnumStruct.ShareInfo.Level1->Buffer;
1042  *entriesread = EnumStruct.ShareInfo.Level1->EntriesRead;
1043  }
1044  break;
1045 
1046  case 2:
1047  if (EnumStruct.ShareInfo.Level2->Buffer != NULL)
1048  {
1049  *bufptr = (LPBYTE)EnumStruct.ShareInfo.Level2->Buffer;
1050  *entriesread = EnumStruct.ShareInfo.Level2->EntriesRead;
1051  }
1052  break;
1053 
1054  case 502:
1055  if (EnumStruct.ShareInfo.Level502->Buffer != NULL)
1056  {
1057  *bufptr = (LPBYTE)EnumStruct.ShareInfo.Level502->Buffer;
1058  *entriesread = EnumStruct.ShareInfo.Level502->EntriesRead;
1059  }
1060  break;
1061  }
1062  }
1064  {
1066  }
1067  RpcEndExcept;
1068 
1069  return status;
1070 }
GLint level
Definition: gl.h:1546
#define RpcEndExcept
Definition: rpc.h:128
NET_API_STATUS __stdcall NetrShareEnum(SRVSVC_HANDLE ServerName, LPSHARE_ENUM_STRUCT InfoStruct, DWORD PreferedMaximumLength, DWORD *TotalEntries, DWORD *ResumeHandle)
Definition: rpcserver.c:265
static unsigned int bufptr
Definition: tncon.cpp:77
SHARE_INFO_502_CONTAINER * Level502
Definition: srvsvc.idl:291
SHARE_INFO_1_CONTAINER * Level1
Definition: srvsvc.idl:288
SHARE_INFO_0_CONTAINER * Level0
Definition: srvsvc.idl:287
unsigned char * LPBYTE
Definition: typedefs.h:53
SHARE_ENUM_UNION ShareInfo
Definition: srvsvc.idl:298
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
LPSHARE_INFO_2 Buffer
Definition: srvsvc.idl:262
LPSHARE_INFO_1 Buffer
Definition: srvsvc.idl:244
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
LPSHARE_INFO_502_I Buffer
Definition: srvsvc.idl:282
SHARE_INFO_2_CONTAINER * Level2
Definition: srvsvc.idl:289
LPSHARE_INFO_0 Buffer
Definition: srvsvc.idl:231
#define NULL
Definition: types.h:112
#define ERROR_INVALID_LEVEL
Definition: winerror.h:196
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

Referenced by EnumerateShares().

◆ NetShareEnumSticky()

NET_API_STATUS WINAPI NetShareEnumSticky ( _In_ LMSTR  servername,
_In_ DWORD  level,
_Out_ LPBYTE bufptr,
_In_ DWORD  prefmaxlen,
_Out_ LPDWORD  entriesread,
_Out_ LPDWORD  totalentries,
_Inout_ LPDWORD  resume_handle 
)

Definition at line 1075 of file srvsvc.c.

1083 {
1084  SHARE_ENUM_STRUCT EnumStruct;
1085  SHARE_INFO_0_CONTAINER Level0Container = {0, NULL};
1086  SHARE_INFO_1_CONTAINER Level1Container = {0, NULL};
1087  SHARE_INFO_2_CONTAINER Level2Container = {0, NULL};
1088  SHARE_INFO_502_CONTAINER Level502Container = {0, NULL};
1090 
1091  TRACE("NetShareEnumSticky(%s %lu %p %lu %p %p %p)\n",
1092  debugstr_w(servername), level, bufptr, prefmaxlen,
1093  entriesread, totalentries, resume_handle);
1094 
1095  if (level > 2 && level != 502)
1096  return ERROR_INVALID_LEVEL;
1097 
1098  *bufptr = NULL;
1099  *entriesread = 0;
1100  *totalentries = 0;
1101 
1102  EnumStruct.Level = level;
1103  switch (level)
1104  {
1105  case 0:
1106  EnumStruct.ShareInfo.Level0 = &Level0Container;
1107  break;
1108 
1109  case 1:
1110  EnumStruct.ShareInfo.Level1 = &Level1Container;
1111  break;
1112 
1113  case 2:
1114  EnumStruct.ShareInfo.Level2 = &Level2Container;
1115  break;
1116 
1117  case 502:
1118  EnumStruct.ShareInfo.Level502 = &Level502Container;
1119  break;
1120  }
1121 
1122  RpcTryExcept
1123  {
1124  status = NetrShareEnum(servername,
1125  (LPSHARE_ENUM_STRUCT)&EnumStruct,
1126  prefmaxlen,
1127  totalentries,
1128  resume_handle);
1129 
1130  switch (level)
1131  {
1132  case 0:
1133  if (EnumStruct.ShareInfo.Level0->Buffer != NULL)
1134  {
1135  *bufptr = (LPBYTE)EnumStruct.ShareInfo.Level0->Buffer;
1136  *entriesread = EnumStruct.ShareInfo.Level0->EntriesRead;
1137  }
1138  break;
1139 
1140  case 1:
1141  if (EnumStruct.ShareInfo.Level1->Buffer != NULL)
1142  {
1143  *bufptr = (LPBYTE)EnumStruct.ShareInfo.Level1->Buffer;
1144  *entriesread = EnumStruct.ShareInfo.Level1->EntriesRead;
1145  }
1146  break;
1147 
1148  case 2:
1149  if (EnumStruct.ShareInfo.Level2->Buffer != NULL)
1150  {
1151  *bufptr = (LPBYTE)EnumStruct.ShareInfo.Level2->Buffer;
1152  *entriesread = EnumStruct.ShareInfo.Level2->EntriesRead;
1153  }
1154  break;
1155 
1156  case 502:
1157  if (EnumStruct.ShareInfo.Level502->Buffer != NULL)
1158  {
1159  *bufptr = (LPBYTE)EnumStruct.ShareInfo.Level502->Buffer;
1160  *entriesread = EnumStruct.ShareInfo.Level502->EntriesRead;
1161  }
1162  break;
1163  }
1164  }
1166  {
1168  }
1169  RpcEndExcept;
1170 
1171  return status;
1172 }
GLint level
Definition: gl.h:1546
#define RpcEndExcept
Definition: rpc.h:128
NET_API_STATUS __stdcall NetrShareEnum(SRVSVC_HANDLE ServerName, LPSHARE_ENUM_STRUCT InfoStruct, DWORD PreferedMaximumLength, DWORD *TotalEntries, DWORD *ResumeHandle)
Definition: rpcserver.c:265
static unsigned int bufptr
Definition: tncon.cpp:77
SHARE_INFO_502_CONTAINER * Level502
Definition: srvsvc.idl:291
SHARE_INFO_1_CONTAINER * Level1
Definition: srvsvc.idl:288
SHARE_INFO_0_CONTAINER * Level0
Definition: srvsvc.idl:287
unsigned char * LPBYTE
Definition: typedefs.h:53
SHARE_ENUM_UNION ShareInfo
Definition: srvsvc.idl:298
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
LPSHARE_INFO_2 Buffer
Definition: srvsvc.idl:262
LPSHARE_INFO_1 Buffer
Definition: srvsvc.idl:244
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
LPSHARE_INFO_502_I Buffer
Definition: srvsvc.idl:282
SHARE_INFO_2_CONTAINER * Level2
Definition: srvsvc.idl:289
LPSHARE_INFO_0 Buffer
Definition: srvsvc.idl:231
#define NULL
Definition: types.h:112
#define ERROR_INVALID_LEVEL
Definition: winerror.h:196
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

◆ NetShareGetInfo()

NET_API_STATUS WINAPI NetShareGetInfo ( _In_ LMSTR  servername,
_In_ LMSTR  netname,
_In_ DWORD  level,
_Out_ LPBYTE bufptr 
)

Definition at line 1177 of file srvsvc.c.

1182 {
1184 
1185  TRACE("NetShareGetInfo(%s %s %lu %p)\n",
1186  debugstr_w(servername), debugstr_w(netname), level, bufptr);
1187 
1188  if (level > 2 && level != 502 && level != 1005)
1189  return ERROR_INVALID_LEVEL;
1190 
1191  if (netname == NULL || *netname == 0)
1192  return ERROR_INVALID_PARAMETER;
1193 
1194  *bufptr = NULL;
1195 
1196  RpcTryExcept
1197  {
1198  status = NetrShareGetInfo(servername,
1199  netname,
1200  level,
1201  (LPSHARE_INFO)bufptr);
1202  }
1204  {
1206  }
1207  RpcEndExcept;
1208 
1209  return status;
1210 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
GLint level
Definition: gl.h:1546
#define RpcEndExcept
Definition: rpc.h:128
static unsigned int bufptr
Definition: tncon.cpp:77
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define NULL
Definition: types.h:112
NET_API_STATUS __stdcall NetrShareGetInfo(SRVSVC_HANDLE ServerName, WCHAR *NetName, DWORD Level, LPSHARE_INFO InfoStruct)
Definition: rpcserver.c:280
#define ERROR_INVALID_LEVEL
Definition: winerror.h:196
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

Referenced by DisplayShare().

◆ NetShareSetInfo()

NET_API_STATUS WINAPI NetShareSetInfo ( _In_ LPWSTR  servername,
_In_ LPWSTR  netname,
_In_ DWORD  level,
_In_ LPBYTE  buf,
_Out_ LPDWORD  parm_err 
)

Definition at line 1215 of file srvsvc.c.

1221 {
1223 
1224  TRACE("NetShareSetInfo(%s %s %lu %p %p)\n",
1225  debugstr_w(servername), debugstr_w(netname), level, buf, parm_err);
1226 
1227  if (level != 2 && level != 502 && level != 503 && level != 1004 &&
1228  level != 1005 && level != 1006 && level != 1501)
1229  return ERROR_INVALID_LEVEL;
1230 
1231  RpcTryExcept
1232  {
1233  status = NetrShareSetInfo(servername,
1234  netname,
1235  level,
1236  (LPSHARE_INFO)&buf,
1237  parm_err);
1238  }
1240  {
1242  }
1243  RpcEndExcept;
1244 
1245  return status;
1246 }
GLint level
Definition: gl.h:1546
#define RpcEndExcept
Definition: rpc.h:128
NET_API_STATUS __stdcall NetrShareSetInfo(SRVSVC_HANDLE ServerName, WCHAR *NetName, DWORD Level, LPSHARE_INFO ShareInfo, DWORD *ParmErr)
Definition: rpcserver.c:294
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define ERROR_INVALID_LEVEL
Definition: winerror.h:196
static SERVICE_STATUS status
Definition: service.c:31
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738
Definition: ps.c:97

◆ SRVSVC_HANDLE_bind()

handle_t __RPC_USER SRVSVC_HANDLE_bind ( SRVSVC_HANDLE  pszSystemName)

Definition at line 19 of file srvsvc.c.

20 {
22  LPWSTR pszStringBinding;
24 
25  TRACE("SRVSVC_HANDLE_bind() called\n");
26 
28  L"ncacn_np",
29  (RPC_WSTR)pszSystemName,
30  L"\\pipe\\srvsvc",
31  NULL,
32  &pszStringBinding);
33  if (status)
34  {
35  TRACE("RpcStringBindingCompose returned 0x%x\n", status);
36  return NULL;
37  }
38 
39  /* Set the binding handle that will be used to bind to the server. */
40  status = RpcBindingFromStringBindingW(pszStringBinding,
41  &hBinding);
42  if (status)
43  {
44  TRACE("RpcBindingFromStringBinding returned 0x%x\n", status);
45  }
46 
47  status = RpcStringFreeW(&pszStringBinding);
48  if (status)
49  {
50 // TRACE("RpcStringFree returned 0x%x\n", status);
51  }
52 
53  return hBinding;
54 }
RPC_STATUS WINAPI RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:876
handle_t hBinding
Definition: ctx_c.c:54
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:174
unsigned short * RPC_WSTR
Definition: rpcdce.h:46
RPC_STATUS WINAPI RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq, RPC_WSTR NetworkAddr, RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR *StringBinding)
Definition: rpc_binding.c:510
long RPC_STATUS
Definition: rpc.h:52
#define L(x)
Definition: ntvdm.h:50
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ SRVSVC_HANDLE_unbind()

void __RPC_USER SRVSVC_HANDLE_unbind ( SRVSVC_HANDLE  pszSystemName,
handle_t  hBinding 
)

Definition at line 58 of file srvsvc.c.

60 {
62 
63  TRACE("SRVSVC_HANDLE_unbind() called\n");
64 
66  if (status)
67  {
68  TRACE("RpcBindingFree returned 0x%x\n", status);
69  }
70 }
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:783
handle_t hBinding
Definition: ctx_c.c:54
long RPC_STATUS
Definition: rpc.h:52
#define TRACE(s)
Definition: solgame.cpp:4
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( netapi32  )