ReactOS  0.4.13-dev-39-g8b6696f
misc.c File Reference
#include "netapi32.h"
#include <rpc.h>
#include "srvsvc_c.h"
#include "wkssvc_c.h"
Include dependency graph for misc.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (netapi32)
 
NET_API_STATUS WINAPI NetRegisterDomainNameChangeNotification (_Out_ PHANDLE NotificationEventHandle)
 
NET_API_STATUS WINAPI NetStatisticsGet (_In_ LPWSTR server, _In_ LPWSTR service, _In_ DWORD level, _In_ DWORD options, _Out_ LPBYTE *bufptr)
 
NET_API_STATUS WINAPI NetUnregisterDomainNameChangeNotification (_In_ HANDLE NotificationEventHandle)
 
NET_API_STATUS WINAPI NetpNtStatusToApiStatus (_In_ NTSTATUS Status)
 

Function Documentation

◆ NetpNtStatusToApiStatus()

NET_API_STATUS WINAPI NetpNtStatusToApiStatus ( _In_ NTSTATUS  Status)

Definition at line 140 of file misc.c.

142 {
143  NET_API_STATUS ApiStatus;
144 
145  switch (Status)
146  {
147  case STATUS_SUCCESS:
148  ApiStatus = NERR_Success;
149  break;
150 
152  ApiStatus = NERR_BadUsername;
153  break;
154 
156  ApiStatus = NERR_PasswordTooShort;
157  break;
158 
159  default:
160  ApiStatus = RtlNtStatusToDosError(Status);
161  break;
162  }
163 
164  return ApiStatus;
165 }
#define NERR_Success
Definition: lmerr.h:5
#define STATUS_PASSWORD_RESTRICTION
Definition: ntstatus.h:330
#define NERR_PasswordTooShort
Definition: lmerr.h:112
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define STATUS_INVALID_ACCOUNT_NAME
Definition: ntstatus.h:320
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
return STATUS_SUCCESS
Definition: btrfs.c:2725
#define NERR_BadUsername
Definition: lmerr.h:72

Referenced by BuildSidListFromDomainAndName(), BuildUserInfoBuffer(), GetUserDacl(), GetUserPrivileges(), NetGetDisplayInformationIndex(), NetGroupAdd(), NetGroupAddUser(), NetGroupDel(), NetGroupDelUser(), NetGroupEnum(), NetGroupGetInfo(), NetGroupGetUsers(), NetGroupSetInfo(), NetGroupSetUsers(), NetLocalGroupAdd(), NetLocalGroupAddMembers(), NetLocalGroupDel(), NetLocalGroupDelMembers(), NetLocalGroupEnum(), NetLocalGroupGetInfo(), NetLocalGroupGetMembers(), NetLocalGroupSetInfo(), NetQueryDisplayInformation(), NetRegisterDomainNameChangeNotification(), NetUnregisterDomainNameChangeNotification(), NetUserAdd(), NetUserChangePassword(), NetUserDel(), NetUserEnum(), NetUserGetGroups(), NetUserGetInfo(), NetUserGetLocalGroups(), NetUserModalsGet(), NetUserSetInfo(), OpenAliasByName(), OpenGroupByName(), OpenUserByName(), and SetUserInfo().

◆ NetRegisterDomainNameChangeNotification()

NET_API_STATUS WINAPI NetRegisterDomainNameChangeNotification ( _Out_ PHANDLE  NotificationEventHandle)

Definition at line 23 of file misc.c.

25 {
28 
29  TRACE("NetRegisterDomainNameChangeNotification(%p)\n",
30  NotificationEventHandle);
31 
32  if (NotificationEventHandle == NULL)
34 
36  if (EventHandle == NULL)
37  return GetLastError();
38 
40  NotificationEventHandle);
41  if (!NT_SUCCESS(Status))
42  {
45  }
46 
47  *NotificationEventHandle = EventHandle;
48 
49  return NERR_Success;
50 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define CloseHandle
Definition: compat.h:398
LONG NTSTATUS
Definition: precomp.h:26
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:597
#define NERR_Success
Definition: lmerr.h:5
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NET_API_STATUS WINAPI NetpNtStatusToApiStatus(_In_ NTSTATUS Status)
Definition: misc.c:140
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI LsaRegisterPolicyChangeNotification(POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass, HANDLE NotificationEventHandle)
Definition: lsalpc.c:329
_Out_ PHANDLE EventHandle
Definition: iofuncs.h:855

◆ NetStatisticsGet()

NET_API_STATUS WINAPI NetStatisticsGet ( _In_ LPWSTR  server,
_In_ LPWSTR  service,
_In_ DWORD  level,
_In_ DWORD  options,
_Out_ LPBYTE bufptr 
)

Definition at line 55 of file misc.c.

61 {
63 
64  TRACE("NetStatisticsGet(%s %s %lu %lu %p)\n",
66 
67  *bufptr = NULL;
68 
69  if (_wcsicmp(service, L"LanmanWorkstation") == 0)
70  {
71  if (level != 0)
72  return ERROR_INVALID_LEVEL;
73 
74  if (options != 0)
76 
78  {
80  L"LanmanWorkstation",
81  level,
82  options,
84  }
86  {
88  }
90  }
91  else if (_wcsicmp(service, L"LanmanServer") == 0)
92  {
93  if (level != 0)
94  return ERROR_INVALID_LEVEL;
95 
96  if (options != 0)
98 
100  {
102  L"LanmanServer",
103  level,
104  options,
106  }
108  {
110  }
111  RpcEndExcept;
112  }
113 
114  return status;
115 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
GLint level
Definition: gl.h:1546
#define RpcEndExcept
Definition: rpc.h:128
static rfbScreenInfoPtr server
Definition: vnc.c:74
unsigned long __stdcall NetrWorkstationStatisticsGet(WKSSVC_IDENTIFY_HANDLE ServerName, wchar_t *ServiceName, unsigned long Level, unsigned long Options, LPSTAT_WORKSTATION_0 *Buffer)
Definition: rpcserver.c:263
static unsigned int bufptr
Definition: tncon.cpp:77
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
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 NetrServerStatisticsGet(SRVSVC_HANDLE ServerName, WCHAR *Service, DWORD Level, DWORD Options, LPSTAT_SERVER_0 *InfoStruct)
Definition: rpcserver.c:472
static const WCHAR L[]
Definition: oid.c:1250
#define ERROR_NOT_SUPPORTED
Definition: compat.h:90
#define ERROR_INVALID_LEVEL
Definition: winerror.h:196
static SERVICE_STATUS status
Definition: service.c:31
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741
Definition: ps.c:97

Referenced by DisplayServerStatistics(), and DisplayWorkstationStatistics().

◆ NetUnregisterDomainNameChangeNotification()

NET_API_STATUS WINAPI NetUnregisterDomainNameChangeNotification ( _In_ HANDLE  NotificationEventHandle)

Definition at line 120 of file misc.c.

122 {
124 
125  TRACE("NetUnregisterDomainNameChangeNotification(%p)\n",
126  NotificationEventHandle);
127 
128  if (NotificationEventHandle == NULL)
130 
132  NotificationEventHandle);
133 
135 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
LONG NTSTATUS
Definition: precomp.h:26
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
NET_API_STATUS WINAPI NetpNtStatusToApiStatus(_In_ NTSTATUS Status)
Definition: misc.c:140
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI LsaUnregisterPolicyChangeNotification(POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass, HANDLE NotificationEventHandle)
Definition: lsalpc.c:376

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( netapi32  )