ReactOS  0.4.15-dev-3203-gacde1e0
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:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLenum GLsizei len
Definition: glext.h:6722
#define HEAP_ZERO_MEMORY
Definition: compat.h:134

◆ midl_user_free()

void __RPC_USER midl_user_free ( void __RPC_FAR ptr)

Definition at line 74 of file rpcserver.c.

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

◆ 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 624 of file rpcserver.c.

631 {
633  return 0;
634 }
#define UNIMPLEMENTED
Definition: debug.h:115

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 672 of file rpcserver.c.

677 {
679  return 0;
680 }
#define UNIMPLEMENTED
Definition: debug.h:115

Referenced by implicit_handle(), and NetEnumerateComputerNames().

◆ NetrGetJoinableOUs()

unsigned long __stdcall NetrGetJoinableOUs ( void  )

Definition at line 515 of file rpcserver.c.

516 {
517  TRACE("NetrGetJoinableOUs()\n");
518  return ERROR_NOT_SUPPORTED;
519 }
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_NOT_SUPPORTED
Definition: compat.h:100

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 607 of file rpcserver.c.

615 {
617  return 0;
618 }
#define UNIMPLEMENTED
Definition: debug.h:115

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 496 of file rpcserver.c.

500 {
501  TRACE("NetrGetJoinInformation(%p %p %p)\n",
502  ServerName, NameBuffer, BufferType);
503 
504  if (NameBuffer == NULL)
506 
507  return NetpGetJoinInformation(NameBuffer,
508  BufferType);
509 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define TRACE(s)
Definition: solgame.cpp:4
NET_API_STATUS NetpGetJoinInformation(LPWSTR *NameBuffer, PNETSETUP_JOIN_STATUS BufferType)
Definition: domain.c:71
#define NULL
Definition: types.h:112

Referenced by implicit_handle(), and NetGetJoinInformation().

◆ NetrJoinDomain()

unsigned long __stdcall NetrJoinDomain ( void  )

Definition at line 456 of file rpcserver.c.

457 {
458  TRACE("NetrJoinDomain()\n");
459  return ERROR_NOT_SUPPORTED;
460 }
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_NOT_SUPPORTED
Definition: compat.h:100

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 525 of file rpcserver.c.

533 {
535 
536  FIXME("NetrJoinDomain2(%p %S %S %S %S %p 0x%lx)\n",
537  RpcBindingHandle, ServerName, DomainNameParam, MachineAccountOU,
538  AccountName, Password, Options);
539 
540  if (DomainNameParam == NULL)
542 
544  {
545  FIXME("NetrJoinDomain2: NETSETUP_JOIN_DOMAIN is not supported yet!\n");
547  }
548  else
549  {
550  status = NetpJoinWorkgroup(DomainNameParam);
551  }
552 
553  return status;
554 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define FIXME(fmt,...)
Definition: debug.h:111
NET_API_STATUS NetpJoinWorkgroup(_In_ LPCWSTR lpWorkgroupName)
Definition: domain.c:52
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
Definition: wdfdevice.h:3531
#define NULL
Definition: types.h:112
#define NETSETUP_JOIN_DOMAIN
Definition: lmjoin.h:16
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by implicit_handle(), and NetJoinDomain().

◆ NetrLogonDomainNameAdd()

unsigned long __stdcall NetrLogonDomainNameAdd ( WKSSVC_IDENTIFY_HANDLE  DomainName)

Definition at line 432 of file rpcserver.c.

434 {
435  TRACE("NetrLogonDomainNameAdd(%s)\n",
436  debugstr_w(DomainName));
437  return ERROR_NOT_SUPPORTED;
438 }
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_NOT_SUPPORTED
Definition: compat.h:100

Referenced by implicit_handle().

◆ NetrLogonDomainNameDel()

unsigned long __stdcall NetrLogonDomainNameDel ( WKSSVC_IDENTIFY_HANDLE  DomainName)

Definition at line 444 of file rpcserver.c.

446 {
447  TRACE("NetrLogonDomainNameDel(%s)\n",
448  debugstr_w(DomainName));
449  return ERROR_NOT_SUPPORTED;
450 }
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_NOT_SUPPORTED
Definition: compat.h:100

Referenced by implicit_handle().

◆ NetrMessageBufferSend()

unsigned long __stdcall NetrMessageBufferSend ( void  )

Definition at line 387 of file rpcserver.c.

388 {
389  TRACE("NetrMessageBufferSend()\n");
390  return ERROR_NOT_SUPPORTED;
391 }
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_NOT_SUPPORTED
Definition: compat.h:100

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 640 of file rpcserver.c.

647 {
649  return 0;
650 }
#define UNIMPLEMENTED
Definition: debug.h:115

Referenced by implicit_handle(), and NetRemoveAlternateComputerName().

◆ NetrRenameMachineInDomain()

unsigned long __stdcall NetrRenameMachineInDomain ( void  )

Definition at line 486 of file rpcserver.c.

487 {
488  TRACE("NetrRenameMachineInDomain()\n");
489  return ERROR_NOT_SUPPORTED;
490 }
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_NOT_SUPPORTED
Definition: compat.h:100

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 575 of file rpcserver.c.

582 {
584  return 0;
585 }
#define UNIMPLEMENTED
Definition: debug.h:115

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 656 of file rpcserver.c.

663 {
665  return 0;
666 }
#define UNIMPLEMENTED
Definition: debug.h:115

Referenced by implicit_handle(), and NetSetPrimaryComputerName().

◆ NetrUnjoinDomain()

unsigned long __stdcall NetrUnjoinDomain ( void  )

Definition at line 466 of file rpcserver.c.

467 {
468  TRACE("NetrUnjoinDomain()\n");
469  return ERROR_NOT_SUPPORTED;
470 }
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_NOT_SUPPORTED
Definition: compat.h:100

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 560 of file rpcserver.c.

566 {
568  return 0;
569 }
#define UNIMPLEMENTED
Definition: debug.h:115

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 331 of file rpcserver.c.

336 {
338  return 0;
339 }
#define UNIMPLEMENTED
Definition: debug.h:115

Referenced by implicit_handle(), and NetUseAdd().

◆ NetrUseDel()

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

Definition at line 359 of file rpcserver.c.

363 {
365  return 0;
366 }
#define UNIMPLEMENTED
Definition: debug.h:115

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 372 of file rpcserver.c.

378 {
380  return 0;
381 }
#define UNIMPLEMENTED
Definition: debug.h:115

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 345 of file rpcserver.c.

350 {
352  return 0;
353 }
#define UNIMPLEMENTED
Definition: debug.h:115

Referenced by implicit_handle(), and NetUseGetInfo().

◆ NetrValidateName()

unsigned long __stdcall NetrValidateName ( void  )

Definition at line 476 of file rpcserver.c.

477 {
478  TRACE("NetrValidateName()\n");
479  return ERROR_NOT_SUPPORTED;
480 }
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_NOT_SUPPORTED
Definition: compat.h:100

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 591 of file rpcserver.c.

598 {
600  return 0;
601 }
#define UNIMPLEMENTED
Definition: debug.h:115

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;
94  PPOLICY_PRIMARY_DOMAIN_INFO DomainInfo = NULL;
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  default:
212  FIXME("Level %d unimplemented\n", Level);
213  dwResult = ERROR_INVALID_LEVEL;
214  break;
215  }
216 
217  if (DomainInfo != NULL)
218  LsaFreeMemory(DomainInfo);
219 
220  return dwResult;
221 }
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
LPWSTR wki101_computername
Definition: lmwksta.h:73
NTSTATUS WINAPI LsaQueryInformationPolicy(IN LSA_HANDLE PolicyHandle, IN POLICY_INFORMATION_CLASS InformationClass, OUT PVOID *Buffer)
Definition: lsa.c:1471
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define POLICY_VIEW_LOCAL_INFORMATION
Definition: ntsecapi.h:61
#define WARN(fmt,...)
Definition: debug.h:112
LONG NTSTATUS
Definition: precomp.h:26
DWORD wki101_ver_minor
Definition: lmwksta.h:76
WKSTA_INFO_101 WkstaInfo101
Definition: wkssvc.idl:217
NTSTATUS WINAPI LsaClose(IN LSA_HANDLE ObjectHandle)
Definition: lsa.c:192
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ZeroMemory
Definition: winbase.h:1664
LPWSTR wki101_lanroot
Definition: lmwksta.h:77
DWORD wki101_ver_major
Definition: lmwksta.h:75
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:55
DWORD wki102_ver_minor
Definition: lmwksta.h:84
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
Definition: compname.c:446
OSVERSIONINFOW VersionInfo
Definition: wkssvc.c:40
#define NERR_Success
Definition: lmerr.h:5
DWORD wki102_ver_major
Definition: lmwksta.h:83
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:1181
#define FIXME(fmt,...)
Definition: debug.h:111
LSA_UNICODE_STRING Name
Definition: ntsecapi.h:570
NTSTATUS WINAPI LsaFreeMemory(IN PVOID Buffer)
Definition: lsa.c:699
LPWSTR wki102_lanroot
Definition: lmwksta.h:85
#define TRACE(s)
Definition: solgame.cpp:4
ULONG dwMajorVersion
Definition: rtltypes.h:247
DWORD wki102_platform_id
Definition: lmwksta.h:80
__wchar_t WCHAR
Definition: xmlstorage.h:180
ULONG WINAPI LsaNtStatusToWinError(IN NTSTATUS Status)
Definition: lsa.c:1129
unsigned long DWORD
Definition: ntddk_ex.h:95
LPWSTR wki102_computername
Definition: lmwksta.h:81
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
LPWSTR wki100_langroup
Definition: lmwksta.h:67
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:240
DWORD wki100_ver_minor
Definition: lmwksta.h:69
#define PLATFORM_ID_NT
Definition: lmcons.h:60
LPWSTR wki102_langroup
Definition: lmwksta.h:82
DWORD wki100_ver_major
Definition: lmwksta.h:68
#define NULL
Definition: types.h:112
WKSTA_INFO_100 WkstaInfo100
Definition: wkssvc.idl:216
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
void __RPC_FAR *__RPC_USER midl_user_allocate(SIZE_T len)
Definition: rpcserver.c:49
ULONG dwMinorVersion
Definition: rtltypes.h:248
LPWSTR wki100_computername
Definition: lmwksta.h:66
#define STATUS_SUCCESS
Definition: shellext.h:65
#define ERROR_INVALID_LEVEL
Definition: winerror.h:196
LPWSTR wki101_langroup
Definition: lmwksta.h:74
DWORD wki100_platform_id
Definition: lmwksta.h:65
WKSTA_INFO_102 WkstaInfo102
Definition: wkssvc.idl:218
DWORD wki102_logged_on_users
Definition: lmwksta.h:86
DWORD wki101_platform_id
Definition: lmwksta.h:72

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 227 of file rpcserver.c.

232 {
234  return 0;
235 }
#define UNIMPLEMENTED
Definition: debug.h:115

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 304 of file rpcserver.c.

309 {
311  return 0;
312 }
#define UNIMPLEMENTED
Definition: debug.h:115

Referenced by implicit_handle(), and NetWkstaTransportAdd().

◆ NetrWkstaTransportDel()

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

Definition at line 318 of file rpcserver.c.

322 {
324  return 0;
325 }
#define UNIMPLEMENTED
Definition: debug.h:115

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 289 of file rpcserver.c.

295 {
297  return 0;
298 }
#define UNIMPLEMENTED
Definition: debug.h:115

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 241 of file rpcserver.c.

247 {
248  ERR("NetrWkstaUserEnum(%p %p 0x%lx %p %p)\n",
249  ServerName, UserInfo, PreferredMaximumLength, TotalEntries, ResumeHandle);
250 
251 
253  return 0;
254 }
#define ERR(fmt,...)
Definition: debug.h:110
#define UNIMPLEMENTED
Definition: debug.h:115

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 260 of file rpcserver.c.

264 {
265  FIXME("(%s, %d, %p)\n", debugstr_w(Unused), Level, UserInfo);
266 
268  return 0;
269 }
_Must_inspect_result_ typedef _In_ PVOID Unused
Definition: iotypes.h:1166
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:55
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define UNIMPLEMENTED
Definition: debug.h:115

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 275 of file rpcserver.c.

280 {
282  return 0;
283 }
#define UNIMPLEMENTED
Definition: debug.h:115

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 397 of file rpcserver.c.

403 {
404  PSTAT_WORKSTATION_0 pStatBuffer;
405 
406  TRACE("NetrWorkstationStatisticsGet(%p %p %lu 0x%lx %p)\n",
407  ServerName, ServiceName, Level, Options, Buffer);
408 
409  if (Level != 0)
410  return ERROR_INVALID_LEVEL;
411 
412  if (Options != 0)
414 
415  pStatBuffer = midl_user_allocate(sizeof(STAT_WORKSTATION_0));
416  if (pStatBuffer == NULL)
418 
419  ZeroMemory(pStatBuffer, sizeof(STAT_WORKSTATION_0));
420 
421  // FIXME: Return the actual statistcs data!
422 
423  *Buffer = pStatBuffer;
424 
425  return NERR_Success;
426 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ZeroMemory
Definition: winbase.h:1664
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:55
#define NERR_Success
Definition: lmerr.h:5
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
Definition: wdfdevice.h:3531
LPTSTR ServiceName
Definition: ServiceMain.c:15
#define NULL
Definition: types.h:112
void __RPC_FAR *__RPC_USER midl_user_allocate(SIZE_T len)
Definition: rpcserver.c:49
#define ERROR_INVALID_LEVEL
Definition: winerror.h:196

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 }
long RPC_STATUS
Definition: rpc.h:52
#define FALSE
Definition: types.h:117
RPC_STATUS WINAPI RpcServerListen(UINT MinimumCallThreads, UINT MaxCalls, UINT DontWait)
Definition: rpc_server.c:1520
#define RPC_C_LISTEN_MAX_CALLS_DEFAULT
Definition: rpcdce.h:122
Status
Definition: gdiplustypes.h:24
RPC_STATUS WINAPI RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv)
Definition: rpc_server.c:1116
static const WCHAR L[]
Definition: oid.c:1250
RPC_STATUS WINAPI RpcServerUseProtseqEpW(RPC_WSTR Protseq, UINT MaxCalls, RPC_WSTR Endpoint, LPVOID SecurityDescriptor)
Definition: rpc_server.c:927
#define ERR(fmt,...)
Definition: debug.h:110
#define NULL
Definition: types.h:112
#define RPC_S_OK
Definition: rpcnterr.h:22

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wkssvc  )