ReactOS 0.4.16-dev-297-gc569aee
rpcserver.c File Reference
#include "precomp.h"
#include "lmerr.h"
Include dependency graph for rpcserver.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wkssvc)
 
DWORD WINAPI RpcThreadRoutine (LPVOID lpParameter)
 
void __RPC_FAR *__RPC_USER midl_user_allocate (SIZE_T len)
 
void __RPC_USER midl_user_free (void __RPC_FAR *ptr)
 
unsigned long __stdcall NetrWkstaGetInfo (WKSSVC_IDENTIFY_HANDLE ServerName, unsigned long Level, LPWKSTA_INFO *WkstaInfo)
 
unsigned long __stdcall NetrWkstaSetInfo (WKSSVC_IDENTIFY_HANDLE ServerName, unsigned long Level, LPWKSTA_INFO WkstaInfo, unsigned long *ErrorParameter)
 
unsigned long __stdcall NetrWkstaUserEnum (WKSSVC_IDENTIFY_HANDLE ServerName, LPWKSTA_USER_ENUM_STRUCT UserInfo, unsigned long PreferredMaximumLength, unsigned long *TotalEntries, unsigned long *ResumeHandle)
 
unsigned long __stdcall NetrWkstaUserGetInfo (WKSSVC_IDENTIFY_HANDLE Unused, unsigned long Level, LPWKSTA_USER_INFO UserInfo)
 
unsigned long __stdcall NetrWkstaUserSetInfo (WKSSVC_IDENTIFY_HANDLE Unused, unsigned long Level, LPWKSTA_USER_INFO UserInfo, unsigned long *ErrorParameter)
 
unsigned long __stdcall NetrWkstaTransportEnum (WKSSVC_IDENTIFY_HANDLE ServerName, LPWKSTA_TRANSPORT_ENUM_STRUCT TransportInfo, unsigned long PreferredMaximumLength, unsigned long *TotalEntries, unsigned long *ResumeHandle)
 
unsigned long __stdcall NetrWkstaTransportAdd (WKSSVC_IDENTIFY_HANDLE ServerName, unsigned long Level, LPWKSTA_TRANSPORT_INFO_0 TransportInfo, unsigned long *ErrorParameter)
 
unsigned long __stdcall NetrWkstaTransportDel (WKSSVC_IDENTIFY_HANDLE ServerName, wchar_t *TransportName, unsigned long ForceLevel)
 
unsigned long __stdcall NetrUseAdd (WKSSVC_IMPERSONATE_HANDLE ServerName, unsigned long Level, LPUSE_INFO InfoStruct, unsigned long *ErrorParameter)
 
unsigned long __stdcall NetrUseGetInfo (WKSSVC_IMPERSONATE_HANDLE ServerName, wchar_t *UseName, unsigned long Level, LPUSE_INFO InfoStruct)
 
unsigned long __stdcall NetrUseDel (WKSSVC_IMPERSONATE_HANDLE ServerName, wchar_t *UseName, unsigned long ForceLevel)
 
unsigned long __stdcall NetrUseEnum (WKSSVC_IDENTIFY_HANDLE ServerName, LPUSE_ENUM_STRUCT InfoStruct, unsigned long PreferredMaximumLength, unsigned long *TotalEntries, unsigned long *ResumeHandle)
 
unsigned long __stdcall NetrMessageBufferSend (void)
 
unsigned long __stdcall NetrWorkstationStatisticsGet (WKSSVC_IDENTIFY_HANDLE ServerName, wchar_t *ServiceName, unsigned long Level, unsigned long Options, LPSTAT_WORKSTATION_0 *Buffer)
 
unsigned long __stdcall NetrLogonDomainNameAdd (WKSSVC_IDENTIFY_HANDLE DomainName)
 
unsigned long __stdcall NetrLogonDomainNameDel (WKSSVC_IDENTIFY_HANDLE DomainName)
 
unsigned long __stdcall NetrJoinDomain (void)
 
unsigned long __stdcall NetrUnjoinDomain (void)
 
unsigned long __stdcall NetrValidateName (void)
 
unsigned long __stdcall NetrRenameMachineInDomain (void)
 
unsigned long __stdcall NetrGetJoinInformation (WKSSVC_IMPERSONATE_HANDLE ServerName, wchar_t **NameBuffer, PNETSETUP_JOIN_STATUS BufferType)
 
unsigned long __stdcall NetrGetJoinableOUs (void)
 
unsigned long __stdcall NetrJoinDomain2 (handle_t RpcBindingHandle, wchar_t *ServerName, wchar_t *DomainNameParam, wchar_t *MachineAccountOU, wchar_t *AccountName, PJOINPR_ENCRYPTED_USER_PASSWORD Password, unsigned long Options)
 
unsigned long __stdcall NetrUnjoinDomain2 (handle_t RpcBindingHandle, wchar_t *ServerName, wchar_t *AccountName, PJOINPR_ENCRYPTED_USER_PASSWORD Password, unsigned long Options)
 
unsigned long __stdcall NetrRenameMachineInDomain2 (handle_t RpcBindingHandle, wchar_t *ServerName, wchar_t *MachineName, wchar_t *AccountName, PJOINPR_ENCRYPTED_USER_PASSWORD Password, unsigned long Options)
 
unsigned long __stdcall NetrValidateName2 (handle_t RpcBindingHandle, wchar_t *ServerName, wchar_t *NameToValidate, wchar_t *AccountName, PJOINPR_ENCRYPTED_USER_PASSWORD Password, NETSETUP_NAME_TYPE NameType)
 
unsigned long __stdcall NetrGetJoinableOUs2 (handle_t RpcBindingHandle, wchar_t *ServerName, wchar_t *DomainNameParam, wchar_t *AccountName, PJOINPR_ENCRYPTED_USER_PASSWORD Password, unsigned long *OUCount, wchar_t ***OUs)
 
unsigned long __stdcall NetrAddAlternateComputerName (handle_t RpcBindingHandle, wchar_t *ServerName, wchar_t *AlternateName, wchar_t *DomainAccount, PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword, unsigned long Reserved)
 
unsigned long __stdcall NetrRemoveAlternateComputerName (handle_t RpcBindingHandle, wchar_t *ServerName, wchar_t *AlternateName, wchar_t *DomainAccount, PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword, unsigned long Reserved)
 
unsigned long __stdcall NetrSetPrimaryComputerName (handle_t RpcBindingHandle, wchar_t *ServerName, wchar_t *PrimaryName, wchar_t *DomainAccount, PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword, unsigned long Reserved)
 
unsigned long __stdcall NetrEnumerateComputerNames (WKSSVC_IMPERSONATE_HANDLE ServerName, NET_COMPUTER_NAME_TYPE NameType, unsigned long Reserved, PNET_COMPUTER_NAME_ARRAY *ComputerNames)
 

Function Documentation

◆ midl_user_allocate()

void __RPC_FAR *__RPC_USER midl_user_allocate ( SIZE_T  len)

Definition at line 68 of file rpcserver.c.

69{
71}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
GLenum GLsizei len
Definition: glext.h:6722

◆ midl_user_free()

void __RPC_USER midl_user_free ( void __RPC_FAR ptr)

Definition at line 74 of file rpcserver.c.

75{
77}
#define HeapFree(x, y, z)
Definition: compat.h:735
static PVOID ptr
Definition: dispmode.c:27

◆ NetrAddAlternateComputerName()

unsigned long __stdcall NetrAddAlternateComputerName ( handle_t  RpcBindingHandle,
wchar_t ServerName,
wchar_t AlternateName,
wchar_t DomainAccount,
PJOINPR_ENCRYPTED_USER_PASSWORD  EncryptedPassword,
unsigned long  Reserved 
)

Definition at line 740 of file rpcserver.c.

747{
749 return 0;
750}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15

Referenced by implicit_handle(), and NetAddAlternateComputerName().

◆ NetrEnumerateComputerNames()

unsigned long __stdcall NetrEnumerateComputerNames ( WKSSVC_IMPERSONATE_HANDLE  ServerName,
NET_COMPUTER_NAME_TYPE  NameType,
unsigned long  Reserved,
PNET_COMPUTER_NAME_ARRAY ComputerNames 
)

Definition at line 788 of file rpcserver.c.

793{
795 return 0;
796}

Referenced by implicit_handle(), and NetEnumerateComputerNames().

◆ NetrGetJoinableOUs()

unsigned long __stdcall NetrGetJoinableOUs ( void  )

Definition at line 631 of file rpcserver.c.

632{
633 TRACE("NetrGetJoinableOUs()\n");
634 return ERROR_NOT_SUPPORTED;
635}
#define ERROR_NOT_SUPPORTED
Definition: compat.h:100
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by implicit_handle().

◆ NetrGetJoinableOUs2()

unsigned long __stdcall NetrGetJoinableOUs2 ( handle_t  RpcBindingHandle,
wchar_t ServerName,
wchar_t DomainNameParam,
wchar_t AccountName,
PJOINPR_ENCRYPTED_USER_PASSWORD  Password,
unsigned long OUCount,
wchar_t ***  OUs 
)

Definition at line 723 of file rpcserver.c.

731{
733 return 0;
734}

Referenced by implicit_handle(), and NetGetJoinableOUs().

◆ NetrGetJoinInformation()

unsigned long __stdcall NetrGetJoinInformation ( WKSSVC_IMPERSONATE_HANDLE  ServerName,
wchar_t **  NameBuffer,
PNETSETUP_JOIN_STATUS  BufferType 
)

Definition at line 612 of file rpcserver.c.

616{
617 TRACE("NetrGetJoinInformation(%p %p %p)\n",
618 ServerName, NameBuffer, BufferType);
619
620 if (NameBuffer == NULL)
622
623 return NetpGetJoinInformation(NameBuffer,
624 BufferType);
625}
NET_API_STATUS NetpGetJoinInformation(LPWSTR *NameBuffer, PNETSETUP_JOIN_STATUS BufferType)
Definition: domain.c:71
#define NULL
Definition: types.h:112
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101

Referenced by implicit_handle(), and NetGetJoinInformation().

◆ NetrJoinDomain()

unsigned long __stdcall NetrJoinDomain ( void  )

Definition at line 572 of file rpcserver.c.

573{
574 TRACE("NetrJoinDomain()\n");
575 return ERROR_NOT_SUPPORTED;
576}

Referenced by implicit_handle().

◆ NetrJoinDomain2()

unsigned long __stdcall NetrJoinDomain2 ( handle_t  RpcBindingHandle,
wchar_t ServerName,
wchar_t DomainNameParam,
wchar_t MachineAccountOU,
wchar_t AccountName,
PJOINPR_ENCRYPTED_USER_PASSWORD  Password,
unsigned long  Options 
)

Definition at line 641 of file rpcserver.c.

649{
651
652 FIXME("NetrJoinDomain2(%p %S %S %S %S %p 0x%lx)\n",
653 RpcBindingHandle, ServerName, DomainNameParam, MachineAccountOU,
654 AccountName, Password, Options);
655
656 if (DomainNameParam == NULL)
658
660 {
661 FIXME("NetrJoinDomain2: NETSETUP_JOIN_DOMAIN is not supported yet!\n");
663 }
664 else
665 {
666 status = NetpJoinWorkgroup(DomainNameParam);
667 }
668
669 return status;
670}
NET_API_STATUS NetpJoinWorkgroup(_In_ LPCWSTR lpWorkgroupName)
Definition: domain.c:52
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define NETSETUP_JOIN_DOMAIN
Definition: lmjoin.h:16
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
Definition: ps.c:97
@ Password
Definition: telnetd.h:65
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
Definition: wdfdevice.h:3534

Referenced by implicit_handle(), and NetJoinDomain().

◆ NetrLogonDomainNameAdd()

unsigned long __stdcall NetrLogonDomainNameAdd ( WKSSVC_IDENTIFY_HANDLE  DomainName)

Definition at line 548 of file rpcserver.c.

550{
551 TRACE("NetrLogonDomainNameAdd(%s)\n",
552 debugstr_w(DomainName));
553 return ERROR_NOT_SUPPORTED;
554}
#define debugstr_w
Definition: kernel32.h:32

Referenced by implicit_handle().

◆ NetrLogonDomainNameDel()

unsigned long __stdcall NetrLogonDomainNameDel ( WKSSVC_IDENTIFY_HANDLE  DomainName)

Definition at line 560 of file rpcserver.c.

562{
563 TRACE("NetrLogonDomainNameDel(%s)\n",
564 debugstr_w(DomainName));
565 return ERROR_NOT_SUPPORTED;
566}

Referenced by implicit_handle().

◆ NetrMessageBufferSend()

unsigned long __stdcall NetrMessageBufferSend ( void  )

Definition at line 503 of file rpcserver.c.

504{
505 TRACE("NetrMessageBufferSend()\n");
506 return ERROR_NOT_SUPPORTED;
507}

Referenced by implicit_handle().

◆ NetrRemoveAlternateComputerName()

unsigned long __stdcall NetrRemoveAlternateComputerName ( handle_t  RpcBindingHandle,
wchar_t ServerName,
wchar_t AlternateName,
wchar_t DomainAccount,
PJOINPR_ENCRYPTED_USER_PASSWORD  EncryptedPassword,
unsigned long  Reserved 
)

Definition at line 756 of file rpcserver.c.

763{
765 return 0;
766}

Referenced by implicit_handle(), and NetRemoveAlternateComputerName().

◆ NetrRenameMachineInDomain()

unsigned long __stdcall NetrRenameMachineInDomain ( void  )

Definition at line 602 of file rpcserver.c.

603{
604 TRACE("NetrRenameMachineInDomain()\n");
605 return ERROR_NOT_SUPPORTED;
606}

Referenced by implicit_handle().

◆ NetrRenameMachineInDomain2()

unsigned long __stdcall NetrRenameMachineInDomain2 ( handle_t  RpcBindingHandle,
wchar_t ServerName,
wchar_t MachineName,
wchar_t AccountName,
PJOINPR_ENCRYPTED_USER_PASSWORD  Password,
unsigned long  Options 
)

Definition at line 691 of file rpcserver.c.

698{
700 return 0;
701}

Referenced by implicit_handle(), and NetRenameMachineInDomain().

◆ NetrSetPrimaryComputerName()

unsigned long __stdcall NetrSetPrimaryComputerName ( handle_t  RpcBindingHandle,
wchar_t ServerName,
wchar_t PrimaryName,
wchar_t DomainAccount,
PJOINPR_ENCRYPTED_USER_PASSWORD  EncryptedPassword,
unsigned long  Reserved 
)

Definition at line 772 of file rpcserver.c.

779{
781 return 0;
782}

Referenced by implicit_handle(), and NetSetPrimaryComputerName().

◆ NetrUnjoinDomain()

unsigned long __stdcall NetrUnjoinDomain ( void  )

Definition at line 582 of file rpcserver.c.

583{
584 TRACE("NetrUnjoinDomain()\n");
585 return ERROR_NOT_SUPPORTED;
586}

Referenced by implicit_handle().

◆ NetrUnjoinDomain2()

unsigned long __stdcall NetrUnjoinDomain2 ( handle_t  RpcBindingHandle,
wchar_t ServerName,
wchar_t AccountName,
PJOINPR_ENCRYPTED_USER_PASSWORD  Password,
unsigned long  Options 
)

Definition at line 676 of file rpcserver.c.

682{
684 return 0;
685}

Referenced by implicit_handle(), and NetUnjoinDomain().

◆ NetrUseAdd()

unsigned long __stdcall NetrUseAdd ( WKSSVC_IMPERSONATE_HANDLE  ServerName,
unsigned long  Level,
LPUSE_INFO  InfoStruct,
unsigned long ErrorParameter 
)

Definition at line 447 of file rpcserver.c.

452{
454 return 0;
455}

Referenced by implicit_handle(), and NetUseAdd().

◆ NetrUseDel()

unsigned long __stdcall NetrUseDel ( WKSSVC_IMPERSONATE_HANDLE  ServerName,
wchar_t UseName,
unsigned long  ForceLevel 
)

Definition at line 475 of file rpcserver.c.

479{
481 return 0;
482}

Referenced by implicit_handle(), and NetUseDel().

◆ NetrUseEnum()

unsigned long __stdcall NetrUseEnum ( WKSSVC_IDENTIFY_HANDLE  ServerName,
LPUSE_ENUM_STRUCT  InfoStruct,
unsigned long  PreferredMaximumLength,
unsigned long TotalEntries,
unsigned long ResumeHandle 
)

Definition at line 488 of file rpcserver.c.

494{
496 return 0;
497}

Referenced by implicit_handle(), and NetUseEnum().

◆ NetrUseGetInfo()

unsigned long __stdcall NetrUseGetInfo ( WKSSVC_IMPERSONATE_HANDLE  ServerName,
wchar_t UseName,
unsigned long  Level,
LPUSE_INFO  InfoStruct 
)

Definition at line 461 of file rpcserver.c.

466{
468 return 0;
469}

Referenced by implicit_handle(), and NetUseGetInfo().

◆ NetrValidateName()

unsigned long __stdcall NetrValidateName ( void  )

Definition at line 592 of file rpcserver.c.

593{
594 TRACE("NetrValidateName()\n");
595 return ERROR_NOT_SUPPORTED;
596}

Referenced by implicit_handle().

◆ NetrValidateName2()

unsigned long __stdcall NetrValidateName2 ( handle_t  RpcBindingHandle,
wchar_t ServerName,
wchar_t NameToValidate,
wchar_t AccountName,
PJOINPR_ENCRYPTED_USER_PASSWORD  Password,
NETSETUP_NAME_TYPE  NameType 
)

Definition at line 707 of file rpcserver.c.

714{
716 return 0;
717}

Referenced by implicit_handle(), and NetValidateName().

◆ NetrWkstaGetInfo()

unsigned long __stdcall NetrWkstaGetInfo ( WKSSVC_IDENTIFY_HANDLE  ServerName,
unsigned long  Level,
LPWKSTA_INFO WkstaInfo 
)

Definition at line 83 of file rpcserver.c.

87{
88 WCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
89 DWORD dwComputerNameLength;
90 LPCWSTR pszLanRoot = L"";
91 PWKSTA_INFO pWkstaInfo = NULL;
93 LSA_HANDLE PolicyHandle;
95 NTSTATUS NtStatus;
96 DWORD dwResult = NERR_Success;
97
98 TRACE("NetrWkstaGetInfo level %lu\n", Level);
99
100 dwComputerNameLength = MAX_COMPUTERNAME_LENGTH + 1;
101 GetComputerNameW(szComputerName, &dwComputerNameLength);
102 dwComputerNameLength++; /* include NULL terminator */
103
105 NtStatus = LsaOpenPolicy(NULL,
108 &PolicyHandle);
109 if (NtStatus != STATUS_SUCCESS)
110 {
111 WARN("LsaOpenPolicy() failed (Status 0x%08lx)\n", NtStatus);
112 return LsaNtStatusToWinError(NtStatus);
113 }
114
115 NtStatus = LsaQueryInformationPolicy(PolicyHandle,
117 (PVOID*)&DomainInfo);
118
119 LsaClose(PolicyHandle);
120
121 if (NtStatus != STATUS_SUCCESS)
122 {
123 WARN("LsaQueryInformationPolicy() failed (Status 0x%08lx)\n", NtStatus);
124 return LsaNtStatusToWinError(NtStatus);
125 }
126
127 switch (Level)
128 {
129 case 100:
130 pWkstaInfo = midl_user_allocate(sizeof(WKSTA_INFO_100));
131 if (pWkstaInfo == NULL)
132 {
133 dwResult = ERROR_NOT_ENOUGH_MEMORY;
134 break;
135 }
136
138
139 pWkstaInfo->WkstaInfo100.wki100_computername = midl_user_allocate(dwComputerNameLength * sizeof(WCHAR));
140 if (pWkstaInfo->WkstaInfo100.wki100_computername != NULL)
141 wcscpy(pWkstaInfo->WkstaInfo100.wki100_computername, szComputerName);
142
143 pWkstaInfo->WkstaInfo100.wki100_langroup = midl_user_allocate((wcslen(DomainInfo->Name.Buffer) + 1) * sizeof(WCHAR));
144 if (pWkstaInfo->WkstaInfo100.wki100_langroup != NULL)
145 wcscpy(pWkstaInfo->WkstaInfo100.wki100_langroup, DomainInfo->Name.Buffer);
146
149
150 *WkstaInfo = pWkstaInfo;
151 break;
152
153 case 101:
154 pWkstaInfo = midl_user_allocate(sizeof(WKSTA_INFO_101));
155 if (pWkstaInfo == NULL)
156 {
157 dwResult = ERROR_NOT_ENOUGH_MEMORY;
158 break;
159 }
160
162
163 pWkstaInfo->WkstaInfo101.wki101_computername = midl_user_allocate(dwComputerNameLength * sizeof(WCHAR));
164 if (pWkstaInfo->WkstaInfo101.wki101_computername != NULL)
165 wcscpy(pWkstaInfo->WkstaInfo101.wki101_computername, szComputerName);
166
167 pWkstaInfo->WkstaInfo101.wki101_langroup = midl_user_allocate((wcslen(DomainInfo->Name.Buffer) + 1) * sizeof(WCHAR));
168 if (pWkstaInfo->WkstaInfo101.wki101_langroup != NULL)
169 wcscpy(pWkstaInfo->WkstaInfo101.wki101_langroup, DomainInfo->Name.Buffer);
170
173
174 pWkstaInfo->WkstaInfo101.wki101_lanroot = midl_user_allocate((wcslen(pszLanRoot) + 1) * sizeof(WCHAR));
175 if (pWkstaInfo->WkstaInfo101.wki101_lanroot != NULL)
176 wcscpy(pWkstaInfo->WkstaInfo101.wki101_lanroot, pszLanRoot);
177
178 *WkstaInfo = pWkstaInfo;
179 break;
180
181 case 102:
182 pWkstaInfo = midl_user_allocate(sizeof(WKSTA_INFO_102));
183 if (pWkstaInfo == NULL)
184 {
185 dwResult = ERROR_NOT_ENOUGH_MEMORY;
186 break;
187 }
188
190
191 pWkstaInfo->WkstaInfo102.wki102_computername = midl_user_allocate(dwComputerNameLength * sizeof(WCHAR));
192 if (pWkstaInfo->WkstaInfo102.wki102_computername != NULL)
193 wcscpy(pWkstaInfo->WkstaInfo102.wki102_computername, szComputerName);
194
195 pWkstaInfo->WkstaInfo102.wki102_langroup = midl_user_allocate((wcslen(DomainInfo->Name.Buffer) + 1) * sizeof(WCHAR));
196 if (pWkstaInfo->WkstaInfo102.wki102_langroup != NULL)
197 wcscpy(pWkstaInfo->WkstaInfo102.wki102_langroup, DomainInfo->Name.Buffer);
198
201
202 pWkstaInfo->WkstaInfo102.wki102_lanroot = midl_user_allocate((wcslen(pszLanRoot) + 1) * sizeof(WCHAR));
203 if (pWkstaInfo->WkstaInfo102.wki102_lanroot != NULL)
204 wcscpy(pWkstaInfo->WkstaInfo102.wki102_lanroot, pszLanRoot);
205
206 pWkstaInfo->WkstaInfo102.wki102_logged_on_users = 1; /* FIXME */
207
208 *WkstaInfo = pWkstaInfo;
209 break;
210
211 case 502:
212 pWkstaInfo = midl_user_allocate(sizeof(WKSTA_INFO_502));
213 if (pWkstaInfo == NULL)
214 {
215 dwResult = ERROR_NOT_ENOUGH_MEMORY;
216 break;
217 }
218
219 CopyMemory(&pWkstaInfo->WkstaInfo502, &WkstaInfo502, sizeof(WKSTA_INFO_502));
220
221 *WkstaInfo = pWkstaInfo;
222 break;
223
224 default:
225 FIXME("Level %lu unimplemented\n", Level);
226 dwResult = ERROR_INVALID_LEVEL;
227 break;
228 }
229
230 if (DomainInfo != NULL)
231 LsaFreeMemory(DomainInfo);
232
233 return dwResult;
234}
LONG NTSTATUS
Definition: precomp.h:26
WKSTA_INFO_502 WkstaInfo502
Definition: info.c:17
OSVERSIONINFOW VersionInfo
Definition: wkssvc.c:40
#define WARN(fmt,...)
Definition: precomp.h:61
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
Definition: compname.c:446
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
NTSTATUS WINAPI LsaOpenPolicy(IN PLSA_UNICODE_STRING SystemName OPTIONAL, IN PLSA_OBJECT_ATTRIBUTES ObjectAttributes, IN ACCESS_MASK DesiredAccess, OUT PLSA_HANDLE PolicyHandle)
Definition: lsa.c:1183
ULONG WINAPI LsaNtStatusToWinError(IN NTSTATUS Status)
Definition: lsa.c:1131
NTSTATUS WINAPI LsaQueryInformationPolicy(IN LSA_HANDLE PolicyHandle, IN POLICY_INFORMATION_CLASS InformationClass, OUT PVOID *Buffer)
Definition: lsa.c:1473
NTSTATUS WINAPI LsaFreeMemory(IN PVOID Buffer)
Definition: lsa.c:701
NTSTATUS WINAPI LsaClose(IN LSA_HANDLE ObjectHandle)
Definition: lsa.c:194
unsigned long DWORD
Definition: ntddk_ex.h:95
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define PLATFORM_ID_NT
Definition: lmcons.h:60
#define NERR_Success
Definition: lmerr.h:5
@ PolicyPrimaryDomainInformation
Definition: ntsecapi.h:245
#define POLICY_VIEW_LOCAL_INFORMATION
Definition: ntsecapi.h:61
#define L(x)
Definition: ntvdm.h:50
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define midl_user_allocate
Definition: rpc.h:44
#define STATUS_SUCCESS
Definition: shellext.h:65
ULONG dwMinorVersion
Definition: rtltypes.h:248
ULONG dwMajorVersion
Definition: rtltypes.h:247
LSA_UNICODE_STRING Name
Definition: ntsecapi.h:570
DWORD wki100_ver_major
Definition: lmwksta.h:68
LPWSTR wki100_langroup
Definition: lmwksta.h:67
DWORD wki100_ver_minor
Definition: lmwksta.h:69
LPWSTR wki100_computername
Definition: lmwksta.h:66
DWORD wki100_platform_id
Definition: lmwksta.h:65
DWORD wki101_ver_minor
Definition: lmwksta.h:76
DWORD wki101_platform_id
Definition: lmwksta.h:72
LPWSTR wki101_lanroot
Definition: lmwksta.h:77
LPWSTR wki101_computername
Definition: lmwksta.h:73
LPWSTR wki101_langroup
Definition: lmwksta.h:74
DWORD wki101_ver_major
Definition: lmwksta.h:75
LPWSTR wki102_lanroot
Definition: lmwksta.h:85
DWORD wki102_ver_minor
Definition: lmwksta.h:84
DWORD wki102_logged_on_users
Definition: lmwksta.h:86
LPWSTR wki102_langroup
Definition: lmwksta.h:82
DWORD wki102_platform_id
Definition: lmwksta.h:80
DWORD wki102_ver_major
Definition: lmwksta.h:83
LPWSTR wki102_computername
Definition: lmwksta.h:81
WKSTA_INFO_102 WkstaInfo102
Definition: wkssvc.idl:218
WKSTA_INFO_101 WkstaInfo101
Definition: wkssvc.idl:217
WKSTA_INFO_100 WkstaInfo100
Definition: wkssvc.idl:216
WKSTA_INFO_502 WkstaInfo502
Definition: wkssvc.idl:219
#define ZeroMemory
Definition: winbase.h:1737
#define CopyMemory
Definition: winbase.h:1735
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:269
#define ERROR_INVALID_LEVEL
Definition: winerror.h:196
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:56
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by implicit_handle(), and NetWkstaGetInfo().

◆ NetrWkstaSetInfo()

unsigned long __stdcall NetrWkstaSetInfo ( WKSSVC_IDENTIFY_HANDLE  ServerName,
unsigned long  Level,
LPWKSTA_INFO  WkstaInfo,
unsigned long ErrorParameter 
)

Definition at line 240 of file rpcserver.c.

245{
246 DWORD dwResult = NERR_Success;
247
248 TRACE("NetrWkstaSetInfo(%lu %p %p)\n",
249 Level, WkstaInfo, ErrorParameter);
250
251 switch (Level)
252 {
253 case 502:
254 if (WkstaInfo->WkstaInfo502.wki502_keep_conn >= 1 && WkstaInfo->WkstaInfo502.wki502_keep_conn <= 65535)
255 {
257
258 if (WkstaInfo->WkstaInfo502.wki502_max_cmds >= 50 && WkstaInfo->WkstaInfo502.wki502_max_cmds <= 65535)
259 {
261
262 if (WkstaInfo->WkstaInfo502.wki502_sess_timeout >= 60 && WkstaInfo->WkstaInfo502.wki502_sess_timeout <= 65535)
263 {
265
266 if (WkstaInfo->WkstaInfo502.wki502_dormant_file_limit != 0)
267 {
269 }
270 else
271 {
272 if (ErrorParameter)
273 *ErrorParameter = WKSTA_DORMANTFILELIMIT_PARMNUM;
274 dwResult = ERROR_INVALID_PARAMETER;
275 }
276 }
277 else
278 {
279 if (ErrorParameter)
280 *ErrorParameter = WKSTA_SESSTIMEOUT_PARMNUM;
281 dwResult = ERROR_INVALID_PARAMETER;
282 }
283 }
284 else
285 {
286 if (ErrorParameter)
287 *ErrorParameter = WKSTA_MAXCMDS_PARMNUM;
288 dwResult = ERROR_INVALID_PARAMETER;
289 }
290 }
291 else
292 {
293 if (ErrorParameter)
294 *ErrorParameter = WKSTA_KEEPCONN_PARMNUM;
295 dwResult = ERROR_INVALID_PARAMETER;
296 }
297 break;
298
299 case 1013:
300 if (WkstaInfo->WkstaInfo1013.wki1013_keep_conn >= 1 && WkstaInfo->WkstaInfo1013.wki1013_keep_conn <= 65535)
301 {
303 }
304 else
305 {
306 if (ErrorParameter)
307 *ErrorParameter = WKSTA_KEEPCONN_PARMNUM;
308 dwResult = ERROR_INVALID_PARAMETER;
309 }
310 break;
311
312 case 1018:
313 if (WkstaInfo->WkstaInfo1018.wki1018_sess_timeout >= 60 && WkstaInfo->WkstaInfo1018.wki1018_sess_timeout <= 65535)
314 {
316 }
317 else
318 {
319 if (ErrorParameter)
320 *ErrorParameter = WKSTA_SESSTIMEOUT_PARMNUM;
321 dwResult = ERROR_INVALID_PARAMETER;
322 }
323 break;
324
325 case 1046:
326 if (WkstaInfo->WkstaInfo1046.wki1046_dormant_file_limit != 0)
327 {
329 }
330 else
331 {
332 if (ErrorParameter)
333 *ErrorParameter = WKSTA_DORMANTFILELIMIT_PARMNUM;
334 dwResult = ERROR_INVALID_PARAMETER;
335 }
336 break;
337
338 default:
339 FIXME("Level %lu unimplemented\n", Level);
340 dwResult = ERROR_INVALID_LEVEL;
341 break;
342 }
343
344 /* Save the workstation in the registry */
345 if (dwResult == NERR_Success)
347
348 /* FIXME: Notify the redirector */
349
350 return dwResult;
351}
VOID SaveWorkstationInfo(_In_ DWORD Level)
Definition: info.c:466
#define WKSTA_KEEPCONN_PARMNUM
Definition: precomp.h:25
#define WKSTA_MAXCMDS_PARMNUM
Definition: precomp.h:26
#define WKSTA_DORMANTFILELIMIT_PARMNUM
Definition: precomp.h:28
#define WKSTA_SESSTIMEOUT_PARMNUM
Definition: precomp.h:27
DWORD wki1013_keep_conn
Definition: lmwksta.h:176
DWORD wki1018_sess_timeout
Definition: lmwksta.h:177
DWORD wki1046_dormant_file_limit
Definition: lmwksta.h:185
DWORD wki502_dormant_file_limit
Definition: lmwksta.h:148
DWORD wki502_keep_conn
Definition: lmwksta.h:137
DWORD wki502_sess_timeout
Definition: lmwksta.h:139
DWORD wki502_max_cmds
Definition: lmwksta.h:138
WKSTA_INFO_1046 WkstaInfo1046
Definition: wkssvc.idl:222
WKSTA_INFO_1013 WkstaInfo1013
Definition: wkssvc.idl:220
WKSTA_INFO_1018 WkstaInfo1018
Definition: wkssvc.idl:221

Referenced by implicit_handle(), and NetWkstaSetInfo().

◆ NetrWkstaTransportAdd()

unsigned long __stdcall NetrWkstaTransportAdd ( WKSSVC_IDENTIFY_HANDLE  ServerName,
unsigned long  Level,
LPWKSTA_TRANSPORT_INFO_0  TransportInfo,
unsigned long ErrorParameter 
)

Definition at line 420 of file rpcserver.c.

425{
427 return 0;
428}

Referenced by implicit_handle(), and NetWkstaTransportAdd().

◆ NetrWkstaTransportDel()

unsigned long __stdcall NetrWkstaTransportDel ( WKSSVC_IDENTIFY_HANDLE  ServerName,
wchar_t TransportName,
unsigned long  ForceLevel 
)

Definition at line 434 of file rpcserver.c.

438{
440 return 0;
441}

Referenced by implicit_handle(), and NetWkstaTransportDel().

◆ NetrWkstaTransportEnum()

unsigned long __stdcall NetrWkstaTransportEnum ( WKSSVC_IDENTIFY_HANDLE  ServerName,
LPWKSTA_TRANSPORT_ENUM_STRUCT  TransportInfo,
unsigned long  PreferredMaximumLength,
unsigned long TotalEntries,
unsigned long ResumeHandle 
)

Definition at line 405 of file rpcserver.c.

411{
413 return 0;
414}

Referenced by implicit_handle().

◆ NetrWkstaUserEnum()

unsigned long __stdcall NetrWkstaUserEnum ( WKSSVC_IDENTIFY_HANDLE  ServerName,
LPWKSTA_USER_ENUM_STRUCT  UserInfo,
unsigned long  PreferredMaximumLength,
unsigned long TotalEntries,
unsigned long ResumeHandle 
)

Definition at line 357 of file rpcserver.c.

363{
364 ERR("NetrWkstaUserEnum(%p %p 0x%lx %p %p)\n",
365 ServerName, UserInfo, PreferredMaximumLength, TotalEntries, ResumeHandle);
366
367
369 return 0;
370}
#define ERR(fmt,...)
Definition: precomp.h:57

Referenced by implicit_handle(), and NetWkstaUserEnum().

◆ NetrWkstaUserGetInfo()

unsigned long __stdcall NetrWkstaUserGetInfo ( WKSSVC_IDENTIFY_HANDLE  Unused,
unsigned long  Level,
LPWKSTA_USER_INFO  UserInfo 
)

Definition at line 376 of file rpcserver.c.

380{
381 FIXME("(%s, %d, %p)\n", debugstr_w(Unused), Level, UserInfo);
382
384 return 0;
385}
#define Unused(x)
Definition: atlwin.h:28

Referenced by implicit_handle().

◆ NetrWkstaUserSetInfo()

unsigned long __stdcall NetrWkstaUserSetInfo ( WKSSVC_IDENTIFY_HANDLE  Unused,
unsigned long  Level,
LPWKSTA_USER_INFO  UserInfo,
unsigned long ErrorParameter 
)

Definition at line 391 of file rpcserver.c.

396{
398 return 0;
399}

Referenced by implicit_handle(), and NetWkstaUserSetInfo().

◆ NetrWorkstationStatisticsGet()

unsigned long __stdcall NetrWorkstationStatisticsGet ( WKSSVC_IDENTIFY_HANDLE  ServerName,
wchar_t ServiceName,
unsigned long  Level,
unsigned long  Options,
LPSTAT_WORKSTATION_0 Buffer 
)

Definition at line 513 of file rpcserver.c.

519{
520 PSTAT_WORKSTATION_0 pStatBuffer;
521
522 TRACE("NetrWorkstationStatisticsGet(%p %p %lu 0x%lx %p)\n",
523 ServerName, ServiceName, Level, Options, Buffer);
524
525 if (Level != 0)
526 return ERROR_INVALID_LEVEL;
527
528 if (Options != 0)
530
531 pStatBuffer = midl_user_allocate(sizeof(STAT_WORKSTATION_0));
532 if (pStatBuffer == NULL)
534
535 ZeroMemory(pStatBuffer, sizeof(STAT_WORKSTATION_0));
536
537 // FIXME: Return the actual statistcs data!
538
539 *Buffer = pStatBuffer;
540
541 return NERR_Success;
542}
static WCHAR ServiceName[]
Definition: browser.c:19
Definition: bufpool.h:45

Referenced by implicit_handle(), and NetStatisticsGet().

◆ RpcThreadRoutine()

DWORD WINAPI RpcThreadRoutine ( LPVOID  lpParameter)

Definition at line 39 of file rpcserver.c.

41{
43
44 Status = RpcServerUseProtseqEpW(L"ncacn_np", 20, L"\\pipe\\wkssvc", NULL);
45 if (Status != RPC_S_OK)
46 {
47 ERR("RpcServerUseProtseqEpW() failed (Status %lx)\n", Status);
48 return 0;
49 }
50
51 Status = RpcServerRegisterIf(wkssvc_v1_0_s_ifspec, NULL, NULL);
52 if (Status != RPC_S_OK)
53 {
54 ERR("RpcServerRegisterIf() failed (Status %lx)\n", Status);
55 return 0;
56 }
57
59 if (Status != RPC_S_OK)
60 {
61 ERR("RpcServerListen() failed (Status %lx)\n", Status);
62 }
63
64 return 0;
65}
#define FALSE
Definition: types.h:117
Status
Definition: gdiplustypes.h:25
RPC_STATUS WINAPI RpcServerListen(UINT MinimumCallThreads, UINT MaxCalls, UINT DontWait)
Definition: rpc_server.c:1520
RPC_STATUS WINAPI RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv)
Definition: rpc_server.c:1116
RPC_STATUS WINAPI RpcServerUseProtseqEpW(RPC_WSTR Protseq, UINT MaxCalls, RPC_WSTR Endpoint, LPVOID SecurityDescriptor)
Definition: rpc_server.c:927
#define RPC_C_LISTEN_MAX_CALLS_DEFAULT
Definition: rpcdce.h:122
#define RPC_S_OK
Definition: rpcnterr.h:22
long RPC_STATUS
Definition: rpc.h:52

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wkssvc  )