ReactOS 0.4.15-dev-7931-gfd331f1
wksta_new.c File Reference
#include "netapi32.h"
#include "wkssvc_c.h"
Include dependency graph for wksta_new.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (netapi32)
 
void __RPC_FAR *__RPC_USER midl_user_allocate (SIZE_T len)
 
void __RPC_USER midl_user_free (void __RPC_FAR *ptr)
 
handle_t __RPC_USER WKSSVC_IDENTIFY_HANDLE_bind (WKSSVC_IDENTIFY_HANDLE pszSystemName)
 
void __RPC_USER WKSSVC_IDENTIFY_HANDLE_unbind (WKSSVC_IDENTIFY_HANDLE pszSystemName, handle_t hBinding)
 
handle_t __RPC_USER WKSSVC_IMPERSONATE_HANDLE_bind (WKSSVC_IMPERSONATE_HANDLE pszSystemName)
 
void __RPC_USER WKSSVC_IMPERSONATE_HANDLE_unbind (WKSSVC_IMPERSONATE_HANDLE pszSystemName, handle_t hBinding)
 
NET_API_STATUS NetpBind (LPCWSTR pszServerName, handle_t *pBindingHandle)
 
NET_API_STATUS NetpUnbind (handle_t BindingHandle)
 
NET_API_STATUS WINAPI NetAddAlternateComputerName (_In_opt_ LPCWSTR Server, _In_ LPCWSTR AlternateName, _In_opt_ LPCWSTR DomainAccount, _In_opt_ LPCWSTR DomainAccountPassword, _In_ ULONG Reserved)
 
NET_API_STATUS WINAPI NetEnumerateComputerNames (_In_opt_ LPCWSTR Server, _In_ NET_COMPUTER_NAME_TYPE NameType, _In_ ULONG Reserved, _Out_ PDWORD EntryCount, _Out_ LPWSTR **ComputerNames)
 
NET_API_STATUS WINAPI NetGetJoinInformation (_In_ LPCWSTR lpServer, _Out_ LPWSTR *lpNameBuffer, _Out_ PNETSETUP_JOIN_STATUS BufferType)
 
NET_API_STATUS WINAPI NetGetJoinableOUs (_In_opt_ LPCWSTR lpServer, _In_ LPCWSTR lpDomain, _In_opt_ LPCWSTR lpAccount, _In_opt_ LPCWSTR lpPassword, _Out_ DWORD *OUCount, _Out_ LPWSTR **OUs)
 
NET_API_STATUS WINAPI NetJoinDomain (_In_opt_ LPCWSTR lpServer, _In_ LPCWSTR lpDomain, _In_opt_ LPCWSTR lpAccountOU, _In_opt_ LPCWSTR lpAccount, _In_opt_ LPCWSTR lpPassword, _In_ DWORD fJoinOptions)
 
NET_API_STATUS WINAPI NetRemoveAlternateComputerName (_In_opt_ LPCWSTR Server, _In_ LPCWSTR AlternateName, _In_opt_ LPCWSTR DomainAccount, _In_opt_ LPCWSTR DomainAccountPassword, _In_ ULONG Reserved)
 
NET_API_STATUS WINAPI NetRenameMachineInDomain (_In_opt_ LPCWSTR lpServer, _In_opt_ LPCWSTR lpNewMachineName, _In_opt_ LPCWSTR lpAccount, _In_opt_ LPCWSTR lpPassword, _In_ DWORD fRenameOptions)
 
NET_API_STATUS WINAPI NetSetPrimaryComputerName (_In_opt_ LPCWSTR Server, _In_ LPCWSTR PrimaryName, _In_opt_ LPCWSTR DomainAccount, _In_opt_ LPCWSTR DomainAccountPassword, _In_ ULONG Reserved)
 
NET_API_STATUS WINAPI NetUnjoinDomain (_In_opt_ LPCWSTR lpServer, _In_opt_ LPCWSTR lpAccount, _In_opt_ LPCWSTR lpPassword, _In_ DWORD fUnjoinOptions)
 
NET_API_STATUS WINAPI NetUseAdd (_In_ LMSTR UncServerName, _In_ DWORD Level, _In_ LPBYTE Buf, _Out_ LPDWORD ParmError)
 
NET_API_STATUS WINAPI NetUseDel (_In_ LMSTR UncServerName, _In_ LMSTR UseName, _In_ DWORD ForceCond)
 
NET_API_STATUS WINAPI NetUseEnum (_In_ LMSTR UncServerName, _In_ DWORD Level, _Out_ LPBYTE *BufPtr, _In_ DWORD PreferedMaximumSize, _Out_ LPDWORD EntriesRead, _Out_ LPDWORD TotalEntries, _Inout_ LPDWORD ResumeHandle)
 
NET_API_STATUS WINAPI NetUseGetInfo (_In_ LMSTR UncServerName, _In_ LMSTR UseName, _In_ DWORD Level, _Out_ LPBYTE *BufPtr)
 
NET_API_STATUS WINAPI NetValidateName (_In_opt_ LPCWSTR lpServer, _In_ LPCWSTR lpName, _In_opt_ LPCWSTR lpAccount, _In_opt_ LPCWSTR lpPassword, _In_ NETSETUP_NAME_TYPE NameType)
 
NET_API_STATUS WINAPI NetWkstaGetInfo (_In_ LPWSTR servername, _In_ DWORD level, _Out_ LPBYTE *bufptr)
 
NET_API_STATUS WINAPI NetWkstaSetInfo (_In_ LPWSTR servername, _In_ DWORD level, _In_ LPBYTE buffer, _Out_ LPDWORD parm_err)
 
NET_API_STATUS WINAPI NetWkstaTransportAdd (_In_opt_ LPWSTR servername, _In_ DWORD level, _In_ LPBYTE buf, _Out_ LPDWORD parm_err)
 
NET_API_STATUS WINAPI NetWkstaTransportDel (_In_opt_ LPWSTR servername, _In_ LPWSTR transportname, _In_ DWORD ucond)
 
NET_API_STATUS WINAPI NetWkstaUserEnum (_In_ LPWSTR servername, _In_ DWORD level, _Out_ LPBYTE *bufptr, _In_ DWORD prefmaxlen, _Out_ LPDWORD entriesread, _Out_ LPDWORD totalentries, _Inout_ LPDWORD resumehandle)
 
NET_API_STATUS WINAPI NetWkstaUserSetInfo (LPWSTR reserved, _In_ DWORD level, _In_ LPBYTE buf, _Out_ LPDWORD parm_err)
 

Function Documentation

◆ midl_user_allocate()

void __RPC_FAR *__RPC_USER midl_user_allocate ( SIZE_T  len)

Definition at line 19 of file wksta_new.c.

20{
22}
#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 25 of file wksta_new.c.

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

◆ NetAddAlternateComputerName()

NET_API_STATUS WINAPI NetAddAlternateComputerName ( _In_opt_ LPCWSTR  Server,
_In_ LPCWSTR  AlternateName,
_In_opt_ LPCWSTR  DomainAccount,
_In_opt_ LPCWSTR  DomainAccountPassword,
_In_ ULONG  Reserved 
)

Definition at line 207 of file wksta_new.c.

213{
214 PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword = NULL;
217
218 TRACE("NetAddAlternateComputerName(%s %s %s %s 0x%lx)\n",
219 debugstr_w(Server), debugstr_w(AlternateName), debugstr_w(DomainAccount),
220 debugstr_w(DomainAccountPassword), Reserved);
221
222 /* FIXME */
223
226 if (status != NERR_Success)
227 {
228 ERR("NetpBind() failed (status 0x%lx)\n", status);
229 return status;
230 }
231
233 {
235 (PWSTR)Server,
236 (PWSTR)AlternateName,
237 (PWSTR)DomainAccount,
238 EncryptedPassword,
239 Reserved);
240 }
242 {
244 }
246
248
249 return status;
250}
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: rpcserver.c:624
#define ERR(fmt,...)
Definition: debug.h:110
#define NULL
Definition: types.h:112
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define debugstr_w
Definition: kernel32.h:32
#define NERR_Success
Definition: lmerr.h:5
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:740
#define RpcEndExcept
Definition: rpc.h:128
#define RpcTryExcept
Definition: rpc.h:126
#define RpcExcept(expr)
Definition: rpc.h:127
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
static void Server(int port)
Definition: srltest.c:69
Definition: ps.c:97
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1147
uint16_t * PWSTR
Definition: typedefs.h:56
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
NET_API_STATUS NetpBind(LPCWSTR pszServerName, handle_t *pBindingHandle)
Definition: wksta_new.c:142
NET_API_STATUS NetpUnbind(handle_t BindingHandle)
Definition: wksta_new.c:187

◆ NetEnumerateComputerNames()

NET_API_STATUS WINAPI NetEnumerateComputerNames ( _In_opt_ LPCWSTR  Server,
_In_ NET_COMPUTER_NAME_TYPE  NameType,
_In_ ULONG  Reserved,
_Out_ PDWORD  EntryCount,
_Out_ LPWSTR **  ComputerNames 
)

Definition at line 255 of file wksta_new.c.

261{
262 PNET_COMPUTER_NAME_ARRAY ComputerNameArray = NULL;
264 PWSTR *NameBuffer = NULL, Ptr;
266
267 TRACE("NetEnumerateComputerNames(%s %lu %lu %p %p)\n",
268 debugstr_w(Server), NameType, Reserved, EntryCount, ComputerNames);
269
271 {
273 NameType,
274 Reserved,
275 &ComputerNameArray);
276 if (status == NERR_Success)
277 {
278 *EntryCount = ComputerNameArray->EntryCount;
279
280 BufferSize = 0;
281 for (i = 0; i < ComputerNameArray->EntryCount; i++)
282 {
283 BufferSize += ComputerNameArray->ComputerNames[i].Length + sizeof(WCHAR) + sizeof(PWSTR);
284 }
285
287 if (status == NERR_Success)
288 {
289 ZeroMemory(NameBuffer, BufferSize);
290
291 Ptr = (PWSTR)((ULONG_PTR)NameBuffer + ComputerNameArray->EntryCount * sizeof(PWSTR));
292 for (i = 0; i < ComputerNameArray->EntryCount; i++)
293 {
294 NameBuffer[i] = Ptr;
296 ComputerNameArray->ComputerNames[i].Buffer,
297 ComputerNameArray->ComputerNames[i].Length);
298 Ptr = (PWSTR)((ULONG_PTR)Ptr + ComputerNameArray->ComputerNames[i].Length + sizeof(WCHAR));
299 }
300
301 *ComputerNames = NameBuffer;
302 }
303 }
304 }
306 {
308 }
310
311 return status;
312}
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 NameType
Definition: acpixf.h:658
unsigned long __stdcall NetrEnumerateComputerNames(WKSSVC_IMPERSONATE_HANDLE ServerName, NET_COMPUTER_NAME_TYPE NameType, unsigned long Reserved, PNET_COMPUTER_NAME_ARRAY *ComputerNames)
Definition: rpcserver.c:672
#define BufferSize
Definition: mmc.h:75
NET_API_STATUS WINAPI NetApiBufferAllocate(DWORD ByteCount, LPVOID *Buffer)
Definition: apibuf.c:28
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned long EntryCount
Definition: wkssvc.idl:359
PUNICODE_STRING ComputerNames
Definition: wkssvc.idl:360
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
#define ZeroMemory
Definition: winbase.h:1712
#define CopyMemory
Definition: winbase.h:1710
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ NetGetJoinableOUs()

NET_API_STATUS WINAPI NetGetJoinableOUs ( _In_opt_ LPCWSTR  lpServer,
_In_ LPCWSTR  lpDomain,
_In_opt_ LPCWSTR  lpAccount,
_In_opt_ LPCWSTR  lpPassword,
_Out_ DWORD OUCount,
_Out_ LPWSTR **  OUs 
)

Definition at line 355 of file wksta_new.c.

362{
363 PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword = NULL;
366
367 TRACE("NetGetJoinableOUs(%s %s %s %s %p %p)\n",
368 debugstr_w(lpServer), debugstr_w(lpDomain), debugstr_w(lpAccount),
369 debugstr_w(lpPassword), OUCount, OUs);
370
371 /* FIXME */
372
373 status = NetpBind(lpServer,
375 if (status != NERR_Success)
376 {
377 ERR("NetpBind() failed (status 0x%lx)\n", status);
378 return status;
379 }
380
382 {
384 (PWSTR)lpServer,
385 (PWSTR)lpDomain,
386 (PWSTR)lpAccount,
387 EncryptedPassword,
388 OUCount,
389 OUs);
390 }
392 {
394 }
396
398
399 return status;
400}
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: rpcserver.c:607

◆ NetGetJoinInformation()

NET_API_STATUS WINAPI NetGetJoinInformation ( _In_ LPCWSTR  lpServer,
_Out_ LPWSTR lpNameBuffer,
_Out_ PNETSETUP_JOIN_STATUS  BufferType 
)

Definition at line 317 of file wksta_new.c.

321{
323
324 TRACE("NetGetJoinInformation(%s %p %p)\n",
325 debugstr_w(lpServer), lpNameBuffer, BufferType);
326
327 if (lpNameBuffer == NULL || BufferType == NULL)
329
330 /* Disabled because of CORE-17679 */
331#if 0
334 {
337 BufferType);
338 }
340 {
342 }
344#endif
345
347 *BufferType = NetSetupUnknownStatus;
348
349 return status;
350}
unsigned long __stdcall NetrGetJoinInformation(WKSSVC_IMPERSONATE_HANDLE ServerName, wchar_t **NameBuffer, PNETSETUP_JOIN_STATUS BufferType)
Definition: rpcserver.c:496
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
@ NetSetupUnknownStatus
Definition: lmjoin.h:10
static LPSTR lpNameBuffer
Definition: secur32.c:50
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by AllSysInfo(), and GetComputerNames().

◆ NetJoinDomain()

NET_API_STATUS WINAPI NetJoinDomain ( _In_opt_ LPCWSTR  lpServer,
_In_ LPCWSTR  lpDomain,
_In_opt_ LPCWSTR  lpAccountOU,
_In_opt_ LPCWSTR  lpAccount,
_In_opt_ LPCWSTR  lpPassword,
_In_ DWORD  fJoinOptions 
)

Definition at line 405 of file wksta_new.c.

412{
413 PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword = NULL;
416
417 FIXME("NetJoinDomain(%s %s %s %s 0x%lx)\n",
418 debugstr_w(lpServer), debugstr_w(lpDomain), debugstr_w(lpAccountOU),
419 debugstr_w(lpAccount), debugstr_w(lpPassword), fJoinOptions);
420
421 /* FIXME */
422
423 status = NetpBind(lpServer,
425 if (status != NERR_Success)
426 {
427 ERR("NetpBind() failed (status 0x%lx)\n", status);
428 return status;
429 }
430
432 {
434 (PWSTR)lpServer,
435 (PWSTR)lpDomain,
436 (PWSTR)lpAccountOU,
437 (PWSTR)lpAccount,
438 EncryptedPassword,
439 fJoinOptions);
440 }
442 {
443 RPC_STATUS rpcStatus = RpcExceptionCode();
444 FIXME("Exception 0x%lx\n", rpcStatus);
445 status = I_RpcMapWin32Status(rpcStatus);
446 }
448
450
451 return status;
452}
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: rpcserver.c:525
#define FIXME(fmt,...)
Definition: debug.h:111
long RPC_STATUS
Definition: rpc.h:52

◆ NetpBind()

NET_API_STATUS NetpBind ( LPCWSTR  pszServerName,
handle_t pBindingHandle 
)

Definition at line 142 of file wksta_new.c.

145{
147 LPWSTR pszStringBinding;
149
150 FIXME("NetpBind(%S)\n", pszServerName);
151
152 *pBindingHandle = NULL;
153
155 L"ncacn_np",
156 (LPWSTR)pszServerName,
157 L"\\pipe\\wkssvc",
158 NULL,
159 &pszStringBinding);
160 if (status)
161 {
162 FIXME("RpcStringBindingCompose returned 0x%x\n", status);
164 }
165
166 /* Set the binding handle that will be used to bind to the server. */
167 status = RpcBindingFromStringBindingW(pszStringBinding,
168 &hBinding);
169 if (status)
170 {
171 FIXME("RpcBindingFromStringBinding returned 0x%x\n", status);
172 }
173
174 status = RpcStringFreeW(&pszStringBinding);
175 if (status)
176 {
177 FIXME("RpcStringFree returned 0x%x\n", status);
178 }
179
180 *pBindingHandle = hBinding;
181
183}
handle_t hBinding
Definition: ctx_c.c:54
NET_API_STATUS WINAPI NetpNtStatusToApiStatus(_In_ NTSTATUS Status)
Definition: misc.c:289
#define L(x)
Definition: ntvdm.h:50
RPC_STATUS WINAPI RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:880
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
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:175

Referenced by NetAddAlternateComputerName(), NetGetJoinableOUs(), NetJoinDomain(), NetRemoveAlternateComputerName(), NetRenameMachineInDomain(), NetSetPrimaryComputerName(), NetUnjoinDomain(), and NetValidateName().

◆ NetpUnbind()

NET_API_STATUS NetpUnbind ( handle_t  BindingHandle)

Definition at line 187 of file wksta_new.c.

189{
191
192 FIXME("NetpUnbind(%p)\n", BindingHandle);
193
194 status = RpcBindingFree(&wkssvc_hBinding);
195 if (status)
196 {
197 TRACE("RpcBindingFree returned 0x%x\n", status);
199 }
200
201 return NERR_Success;
202}
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:787

Referenced by NetAddAlternateComputerName(), NetGetJoinableOUs(), NetJoinDomain(), NetRemoveAlternateComputerName(), NetRenameMachineInDomain(), NetSetPrimaryComputerName(), NetUnjoinDomain(), and NetValidateName().

◆ NetRemoveAlternateComputerName()

NET_API_STATUS WINAPI NetRemoveAlternateComputerName ( _In_opt_ LPCWSTR  Server,
_In_ LPCWSTR  AlternateName,
_In_opt_ LPCWSTR  DomainAccount,
_In_opt_ LPCWSTR  DomainAccountPassword,
_In_ ULONG  Reserved 
)

Definition at line 457 of file wksta_new.c.

463{
464 PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword = NULL;
467
468 TRACE("NetRemoveAlternateComputerName(%s %s %s %s 0x%lx)\n",
469 debugstr_w(Server), debugstr_w(AlternateName), debugstr_w(DomainAccount),
470 debugstr_w(DomainAccountPassword), Reserved);
471
472 /* FIXME */
473
476 if (status != NERR_Success)
477 {
478 ERR("NetpBind() failed (status 0x%lx)\n", status);
479 return status;
480 }
481
483 {
485 (PWSTR)Server,
486 (PWSTR)AlternateName,
487 (PWSTR)DomainAccount,
488 EncryptedPassword,
489 Reserved);
490 }
492 {
494 }
496
498
499 return status;
500}
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: rpcserver.c:640

◆ NetRenameMachineInDomain()

NET_API_STATUS WINAPI NetRenameMachineInDomain ( _In_opt_ LPCWSTR  lpServer,
_In_opt_ LPCWSTR  lpNewMachineName,
_In_opt_ LPCWSTR  lpAccount,
_In_opt_ LPCWSTR  lpPassword,
_In_ DWORD  fRenameOptions 
)

Definition at line 505 of file wksta_new.c.

511{
512 PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword = NULL;
515
516 TRACE("NetRenameMachineInDomain(%s %s %s %s 0x%lx)\n",
517 debugstr_w(lpServer), debugstr_w(lpNewMachineName), debugstr_w(lpAccount),
518 debugstr_w(lpPassword), fRenameOptions);
519
520 /* FIXME */
521
522 status = NetpBind(lpServer,
524 if (status != NERR_Success)
525 {
526 ERR("NetpBind() failed (status 0x%lx)\n", status);
527 return status;
528 }
529
531 {
533 (PWSTR)lpServer,
534 (PWSTR)lpNewMachineName,
535 (PWSTR)lpAccount,
536 EncryptedPassword,
537 fRenameOptions);
538 }
540 {
542 }
544
546
547 return status;
548}
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: rpcserver.c:575

◆ NetSetPrimaryComputerName()

NET_API_STATUS WINAPI NetSetPrimaryComputerName ( _In_opt_ LPCWSTR  Server,
_In_ LPCWSTR  PrimaryName,
_In_opt_ LPCWSTR  DomainAccount,
_In_opt_ LPCWSTR  DomainAccountPassword,
_In_ ULONG  Reserved 
)

Definition at line 553 of file wksta_new.c.

559{
560 PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword = NULL;
563
564 TRACE("NetSetPrimaryComputerName(%s %s %s %s %lu)\n",
565 debugstr_w(Server), debugstr_w(PrimaryName), debugstr_w(DomainAccount),
566 debugstr_w(DomainAccountPassword), Reserved);
567
568 /* FIXME */
569
572 if (status != NERR_Success)
573 {
574 ERR("NetpBind() failed (status 0x%lx)\n", status);
575 return status;
576 }
577
579 {
581 (PWSTR)Server,
582 (PWSTR)PrimaryName,
583 (PWSTR)DomainAccount,
584 EncryptedPassword,
585 Reserved);
586 }
588 {
590 }
592
594
595 return status;
596}
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: rpcserver.c:656

◆ NetUnjoinDomain()

NET_API_STATUS WINAPI NetUnjoinDomain ( _In_opt_ LPCWSTR  lpServer,
_In_opt_ LPCWSTR  lpAccount,
_In_opt_ LPCWSTR  lpPassword,
_In_ DWORD  fUnjoinOptions 
)

Definition at line 601 of file wksta_new.c.

606{
607 PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword = NULL;
610
611 TRACE("NetUnjoinDomain(%s %s %s %s 0x%lx)\n",
612 debugstr_w(lpServer), debugstr_w(lpAccount),
613 debugstr_w(lpPassword), fUnjoinOptions);
614
615 /* FIXME */
616
617 status = NetpBind(lpServer,
619 if (status != NERR_Success)
620 {
621 ERR("NetpBind() failed (status 0x%lx)\n", status);
622 return status;
623 }
624
626 {
628 (PWSTR)lpServer,
629 (PWSTR)lpAccount,
630 EncryptedPassword,
631 fUnjoinOptions);
632 }
634 {
636 }
638
640
641 return status;
642}
unsigned long __stdcall NetrUnjoinDomain2(handle_t RpcBindingHandle, wchar_t *ServerName, wchar_t *AccountName, PJOINPR_ENCRYPTED_USER_PASSWORD Password, unsigned long Options)
Definition: rpcserver.c:560

◆ NetUseAdd()

NET_API_STATUS WINAPI NetUseAdd ( _In_ LMSTR  UncServerName,
_In_ DWORD  Level,
_In_ LPBYTE  Buf,
_Out_ LPDWORD  ParmError 
)

Definition at line 647 of file wksta_new.c.

652{
654
655 TRACE("NetUseAdd(%s %d %p %p)\n", debugstr_w(UncServerName),
656 Level, Buf, ParmError);
657
659 {
660 status = NetrUseAdd(UncServerName,
661 Level,
662 (LPUSE_INFO)Buf,
663 ParmError);
664 }
666 {
668 }
670
671 return status;
672}
unsigned long __stdcall NetrUseAdd(WKSSVC_IMPERSONATE_HANDLE ServerName, unsigned long Level, LPUSE_INFO InfoStruct, unsigned long *ErrorParameter)
Definition: rpcserver.c:331
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:56

◆ NetUseDel()

NET_API_STATUS WINAPI NetUseDel ( _In_ LMSTR  UncServerName,
_In_ LMSTR  UseName,
_In_ DWORD  ForceCond 
)

Definition at line 677 of file wksta_new.c.

681{
683
684 TRACE("NetUseDel(%s %s %d)\n", debugstr_w(UncServerName),
685 debugstr_w(UseName), ForceCond);
686
688 {
689 status = NetrUseDel(UncServerName,
690 UseName,
691 ForceCond);
692 }
694 {
696 }
698
699 return status;
700}
unsigned long __stdcall NetrUseDel(WKSSVC_IMPERSONATE_HANDLE ServerName, wchar_t *UseName, unsigned long ForceLevel)
Definition: rpcserver.c:359

◆ NetUseEnum()

NET_API_STATUS WINAPI NetUseEnum ( _In_ LMSTR  UncServerName,
_In_ DWORD  Level,
_Out_ LPBYTE BufPtr,
_In_ DWORD  PreferedMaximumSize,
_Out_ LPDWORD  EntriesRead,
_Out_ LPDWORD  TotalEntries,
_Inout_ LPDWORD  ResumeHandle 
)

Definition at line 705 of file wksta_new.c.

713{
714 USE_ENUM_STRUCT UseEnumInfo;
715 USE_INFO_0_CONTAINER Container0;
716 USE_INFO_1_CONTAINER Container1;
717 USE_INFO_2_CONTAINER Container2;
719
720 TRACE("NetUseEnum(%s, %d, %p, %d, %p, %p, %p)\n", debugstr_w(UncServerName),
721 Level, BufPtr, PreferedMaximumSize, EntriesRead, TotalEntries, ResumeHandle);
722
723 UseEnumInfo.Level = Level;
724 switch (Level)
725 {
726 case 0:
727 UseEnumInfo.UseInfo.Level0 = &Container0;
728 Container0.EntriesRead = 0;
729 Container0.Buffer = NULL;
730 break;
731
732 case 1:
733 UseEnumInfo.UseInfo.Level1 = &Container1;
734 Container1.EntriesRead = 0;
735 Container1.Buffer = NULL;
736 break;
737
738 case 2:
739 UseEnumInfo.UseInfo.Level2 = &Container2;
740 Container2.EntriesRead = 0;
741 Container2.Buffer = NULL;
742 break;
743
744 default:
746 }
747
749 {
750 status = NetrUseEnum(UncServerName,
751 &UseEnumInfo,
752 PreferedMaximumSize,
753 TotalEntries,
754 ResumeHandle);
756 {
757 switch (Level)
758 {
759 case 0:
760 *BufPtr = (LPBYTE)UseEnumInfo.UseInfo.Level0->Buffer;
761 *EntriesRead = UseEnumInfo.UseInfo.Level0->EntriesRead;
762 break;
763
764 case 1:
765 *BufPtr = (LPBYTE)UseEnumInfo.UseInfo.Level1->Buffer;
766 *EntriesRead = UseEnumInfo.UseInfo.Level1->EntriesRead;
767 break;
768
769 case 2:
770 *BufPtr = (LPBYTE)UseEnumInfo.UseInfo.Level2->Buffer;
771 *EntriesRead = UseEnumInfo.UseInfo.Level2->EntriesRead;
772 break;
773 }
774 }
775 }
777 {
779 }
781
782 return status;
783}
unsigned long __stdcall NetrUseEnum(WKSSVC_IDENTIFY_HANDLE ServerName, LPUSE_ENUM_STRUCT InfoStruct, unsigned long PreferredMaximumLength, unsigned long *TotalEntries, unsigned long *ResumeHandle)
Definition: rpcserver.c:372
#define ERROR_MORE_DATA
Definition: dderror.h:13
union _USE_ENUM_STRUCT::_USE_ENUM_UNION UseInfo
unsigned long EntriesRead
Definition: wkssvc.idl:267
LPUSE_INFO_0 Buffer
Definition: wkssvc.idl:268
unsigned long EntriesRead
Definition: wkssvc.idl:273
LPUSE_INFO_1 Buffer
Definition: wkssvc.idl:274
unsigned long EntriesRead
Definition: wkssvc.idl:279
LPUSE_INFO_2 Buffer
Definition: wkssvc.idl:280
unsigned char * LPBYTE
Definition: typedefs.h:53
LPUSE_INFO_1_CONTAINER Level1
Definition: wkssvc.idl:289
LPUSE_INFO_2_CONTAINER Level2
Definition: wkssvc.idl:290
LPUSE_INFO_0_CONTAINER Level0
Definition: wkssvc.idl:288

◆ NetUseGetInfo()

NET_API_STATUS WINAPI NetUseGetInfo ( _In_ LMSTR  UncServerName,
_In_ LMSTR  UseName,
_In_ DWORD  Level,
_Out_ LPBYTE BufPtr 
)

Definition at line 788 of file wksta_new.c.

793{
795
796 TRACE("NetUseGetInfo(%s, %s, %d, %p)\n", debugstr_w(UncServerName),
797 debugstr_w(UseName), Level, BufPtr);
798
799 *BufPtr = NULL;
800
802 {
803 status = NetrUseGetInfo(UncServerName,
804 UseName,
805 Level,
806 (LPUSE_INFO)BufPtr);
807 }
809 {
811 }
813
814 return status;
815}
unsigned long __stdcall NetrUseGetInfo(WKSSVC_IMPERSONATE_HANDLE ServerName, wchar_t *UseName, unsigned long Level, LPUSE_INFO InfoStruct)
Definition: rpcserver.c:345

◆ NetValidateName()

NET_API_STATUS WINAPI NetValidateName ( _In_opt_ LPCWSTR  lpServer,
_In_ LPCWSTR  lpName,
_In_opt_ LPCWSTR  lpAccount,
_In_opt_ LPCWSTR  lpPassword,
_In_ NETSETUP_NAME_TYPE  NameType 
)

Definition at line 820 of file wksta_new.c.

826{
827 PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword = NULL;
830
831 TRACE("NetValidateName(%s %s %s %s %u)\n",
832 debugstr_w(lpServer), debugstr_w(lpName), debugstr_w(lpAccount),
833 debugstr_w(lpPassword), NameType);
834
835 /* FIXME */
836
837 status = NetpBind(lpServer,
839 if (status != NERR_Success)
840 {
841 ERR("NetpBind() failed (status 0x%lx)\n", status);
842 return status;
843 }
844
846 {
848 (PWSTR)lpServer,
849 (PWSTR)lpName,
850 (PWSTR)lpAccount,
851 EncryptedPassword,
852 NameType);
853 }
855 {
857 }
859
861
862 return status;
863}
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: rpcserver.c:591
_In_ LPCSTR lpName
Definition: winbase.h:2789

◆ NetWkstaGetInfo()

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

Definition at line 868 of file wksta_new.c.

872{
874
875 TRACE("NetWkstaGetInfo(%s, %d, %p)\n",
876 debugstr_w(servername), level, bufptr);
877
878 if (bufptr == NULL)
880
881 *bufptr = NULL;
882
884 {
885 status = NetrWkstaGetInfo(servername,
886 level,
888 }
890 {
892 }
894
895 return status;
896}
unsigned long __stdcall NetrWkstaGetInfo(WKSSVC_IDENTIFY_HANDLE ServerName, unsigned long Level, LPWKSTA_INFO *WkstaInfo)
Definition: rpcserver.c:83
GLint level
Definition: gl.h:1546
static unsigned int bufptr
Definition: tncon.cpp:77

Referenced by DisplayWorkstationConfig(), and DisplayWorkstationStatistics().

◆ NetWkstaSetInfo()

NET_API_STATUS WINAPI NetWkstaSetInfo ( _In_ LPWSTR  servername,
_In_ DWORD  level,
_In_ LPBYTE  buffer,
_Out_ LPDWORD  parm_err 
)

Definition at line 901 of file wksta_new.c.

906{
908
909 TRACE("NetWkstaSetInfo(%s, %d, %p, %p)\n",
910 debugstr_w(servername), level, buffer, parm_err);
911
913 {
914 status = NetrWkstaSetInfo(servername,
915 level,
917 parm_err);
918 }
920 {
922 }
924
925 return status;
926}
unsigned long __stdcall NetrWkstaSetInfo(WKSSVC_IDENTIFY_HANDLE ServerName, unsigned long Level, LPWKSTA_INFO WkstaInfo, unsigned long *ErrorParameter)
Definition: rpcserver.c:227
GLuint buffer
Definition: glext.h:5915

◆ NetWkstaTransportAdd()

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

Definition at line 931 of file wksta_new.c.

936{
938
939 TRACE("NetWkstaTransportAdd(%s, %d, %p, %p)\n", debugstr_w(servername),
940 level, buf, parm_err);
941
943 {
944 status = NetrWkstaTransportAdd(servername,
945 level,
947 parm_err);
948 }
950 {
952 }
954
955 return status;
956}
unsigned long __stdcall NetrWkstaTransportAdd(WKSSVC_IDENTIFY_HANDLE ServerName, unsigned long Level, LPWKSTA_TRANSPORT_INFO_0 TransportInfo, unsigned long *ErrorParameter)
Definition: rpcserver.c:304
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751

◆ NetWkstaTransportDel()

NET_API_STATUS WINAPI NetWkstaTransportDel ( _In_opt_ LPWSTR  servername,
_In_ LPWSTR  transportname,
_In_ DWORD  ucond 
)

Definition at line 961 of file wksta_new.c.

965{
967
968 TRACE("NetWkstaTransportDel(%s, %s, %d)\n", debugstr_w(servername),
969 debugstr_w(transportname), ucond);
970
972 {
973 status = NetrWkstaTransportDel(servername,
974 transportname,
975 ucond);
976 }
978 {
980 }
982
983 return status;
984}
unsigned long __stdcall NetrWkstaTransportDel(WKSSVC_IDENTIFY_HANDLE ServerName, wchar_t *TransportName, unsigned long ForceLevel)
Definition: rpcserver.c:318

◆ NetWkstaUserEnum()

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

Definition at line 1050 of file wksta_new.c.

1058{
1059 WKSTA_USER_ENUM_STRUCT UserEnumInfo;
1060 WKSTA_USER_INFO_0_CONTAINER Container0;
1061 WKSTA_USER_INFO_1_CONTAINER Container1;
1063
1064 TRACE("NetWkstaUserEnum(%s, %d, %p, %d, %p, %p, %p)\n", debugstr_w(servername),
1065 level, bufptr, prefmaxlen, entriesread, totalentries, resumehandle);
1066
1067 UserEnumInfo.Level = level;
1068 switch (level)
1069 {
1070 case 0:
1071 UserEnumInfo.WkstaUserInfo.Level0 = &Container0;
1072 Container0.EntriesRead = 0;
1073 Container0.Buffer = NULL;
1074 break;
1075
1076 case 1:
1077 UserEnumInfo.WkstaUserInfo.Level1 = &Container1;
1078 Container1.EntriesRead = 0;
1079 Container1.Buffer = NULL;
1080 break;
1081
1082 default:
1084 }
1085
1087 {
1088 status = NetrWkstaUserEnum(servername,
1089 &UserEnumInfo,
1090 prefmaxlen,
1091 totalentries,
1092 resumehandle);
1094 {
1095 switch (level)
1096 {
1097 case 0:
1098 *bufptr = (LPBYTE)UserEnumInfo.WkstaUserInfo.Level0->Buffer;
1099 *entriesread = UserEnumInfo.WkstaUserInfo.Level0->EntriesRead;
1100 break;
1101
1102 case 1:
1103 *bufptr = (LPBYTE)UserEnumInfo.WkstaUserInfo.Level1->Buffer;
1104 *entriesread = UserEnumInfo.WkstaUserInfo.Level1->EntriesRead;
1105 break;
1106 }
1107 }
1108 }
1110 {
1112 }
1114
1115 return status;
1116}
unsigned long __stdcall NetrWkstaUserEnum(WKSSVC_IDENTIFY_HANDLE ServerName, LPWKSTA_USER_ENUM_STRUCT UserInfo, unsigned long PreferredMaximumLength, unsigned long *TotalEntries, unsigned long *ResumeHandle)
Definition: rpcserver.c:241
unsigned long Level
Definition: wkssvc.idl:309
union _WKSTA_USER_ENUM_STRUCT::_WKSTA_USER_ENUM_UNION WkstaUserInfo
unsigned long EntriesRead
Definition: wkssvc.idl:297
LPWKSTA_USER_INFO_0 Buffer
Definition: wkssvc.idl:298
unsigned long EntriesRead
Definition: wkssvc.idl:303
LPWKSTA_USER_INFO_1 Buffer
Definition: wkssvc.idl:304
LPWKSTA_USER_INFO_0_CONTAINER Level0
Definition: wkssvc.idl:312
LPWKSTA_USER_INFO_1_CONTAINER Level1
Definition: wkssvc.idl:313

◆ NetWkstaUserSetInfo()

NET_API_STATUS WINAPI NetWkstaUserSetInfo ( LPWSTR  reserved,
_In_ DWORD  level,
_In_ LPBYTE  buf,
_Out_ LPDWORD  parm_err 
)

Definition at line 1156 of file wksta_new.c.

1161{
1163
1164 TRACE("NetWkstaSetInfo(%s, %d, %p, %p)\n",
1165 debugstr_w(reserved), level, buf, parm_err);
1166
1167 if (reserved != NULL)
1169
1171 {
1173 level,
1175 parm_err);
1176 }
1178 {
1180 }
1182
1183 return status;
1184}
unsigned long __stdcall NetrWkstaUserSetInfo(WKSSVC_IDENTIFY_HANDLE Unused, unsigned long Level, LPWKSTA_USER_INFO UserInfo, unsigned long *ErrorParameter)
Definition: rpcserver.c:275
r reserved
Definition: btrfs.c:3006

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( netapi32  )

◆ WKSSVC_IDENTIFY_HANDLE_bind()

handle_t __RPC_USER WKSSVC_IDENTIFY_HANDLE_bind ( WKSSVC_IDENTIFY_HANDLE  pszSystemName)

Definition at line 32 of file wksta_new.c.

33{
35 LPWSTR pszStringBinding;
37
38 TRACE("WKSSVC_IDENTIFY_HANDLE_bind() called\n");
39
41 L"ncacn_np",
42 pszSystemName,
43 L"\\pipe\\wkssvc",
44 NULL,
45 &pszStringBinding);
46 if (status)
47 {
48 TRACE("RpcStringBindingCompose returned 0x%x\n", status);
49 return NULL;
50 }
51
52 /* Set the binding handle that will be used to bind to the server. */
53 status = RpcBindingFromStringBindingW(pszStringBinding,
54 &hBinding);
55 if (status)
56 {
57 TRACE("RpcBindingFromStringBinding returned 0x%x\n", status);
58 }
59
60 status = RpcStringFreeW(&pszStringBinding);
61 if (status)
62 {
63// TRACE("RpcStringFree returned 0x%x\n", status);
64 }
65
66 return hBinding;
67}

◆ WKSSVC_IDENTIFY_HANDLE_unbind()

void __RPC_USER WKSSVC_IDENTIFY_HANDLE_unbind ( WKSSVC_IDENTIFY_HANDLE  pszSystemName,
handle_t  hBinding 
)

Definition at line 71 of file wksta_new.c.

73{
75
76 TRACE("WKSSVC_IDENTIFY_HANDLE_unbind() called\n");
77
79 if (status)
80 {
81 TRACE("RpcBindingFree returned 0x%x\n", status);
82 }
83}

◆ WKSSVC_IMPERSONATE_HANDLE_bind()

handle_t __RPC_USER WKSSVC_IMPERSONATE_HANDLE_bind ( WKSSVC_IMPERSONATE_HANDLE  pszSystemName)

Definition at line 87 of file wksta_new.c.

88{
90 LPWSTR pszStringBinding;
92
93 TRACE("WKSSVC_IMPERSONATE_HANDLE_bind() called\n");
94
96 L"ncacn_np",
97 pszSystemName,
98 L"\\pipe\\wkssvc",
99 NULL,
100 &pszStringBinding);
101 if (status)
102 {
103 TRACE("RpcStringBindingCompose returned 0x%x\n", status);
104 return NULL;
105 }
106
107 /* Set the binding handle that will be used to bind to the server. */
108 status = RpcBindingFromStringBindingW(pszStringBinding,
109 &hBinding);
110 if (status)
111 {
112 TRACE("RpcBindingFromStringBinding returned 0x%x\n", status);
113 }
114
115 status = RpcStringFreeW(&pszStringBinding);
116 if (status)
117 {
118// TRACE("RpcStringFree returned 0x%x\n", status);
119 }
120
121 return hBinding;
122}

◆ WKSSVC_IMPERSONATE_HANDLE_unbind()

void __RPC_USER WKSSVC_IMPERSONATE_HANDLE_unbind ( WKSSVC_IMPERSONATE_HANDLE  pszSystemName,
handle_t  hBinding 
)

Definition at line 126 of file wksta_new.c.

128{
130
131 TRACE("WKSSVC_IMPERSONATE_HANDLE_unbind() called\n");
132
134 if (status)
135 {
136 TRACE("RpcBindingFree returned 0x%x\n", status);
137 }
138}