2 * COPYRIGHT: See COPYING in the top level directory
4 * FILE: reactos/dll/win32/netapi32/wksta_new.c
5 * PURPOSE: Workstation service interface code
7 * PROGRAMMERS: Eric Kohl
10 /* INCLUDES ******************************************************************/
15 WINE_DEFAULT_DEBUG_CHANNEL(netapi32
);
17 /* FUNCTIONS *****************************************************************/
19 void __RPC_FAR
* __RPC_USER
midl_user_allocate(SIZE_T len
)
21 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
25 void __RPC_USER
midl_user_free(void __RPC_FAR
* ptr
)
27 HeapFree(GetProcessHeap(), 0, ptr
);
32 WKSSVC_IDENTIFY_HANDLE_bind(WKSSVC_IDENTIFY_HANDLE pszSystemName
)
34 handle_t hBinding
= NULL
;
35 LPWSTR pszStringBinding
;
38 TRACE("WKSSVC_IDENTIFY_HANDLE_bind() called\n");
40 status
= RpcStringBindingComposeW(NULL
,
48 TRACE("RpcStringBindingCompose returned 0x%x\n", status
);
52 /* Set the binding handle that will be used to bind to the server. */
53 status
= RpcBindingFromStringBindingW(pszStringBinding
,
57 TRACE("RpcBindingFromStringBinding returned 0x%x\n", status
);
60 status
= RpcStringFreeW(&pszStringBinding
);
63 // TRACE("RpcStringFree returned 0x%x\n", status);
71 WKSSVC_IDENTIFY_HANDLE_unbind(WKSSVC_IDENTIFY_HANDLE pszSystemName
,
76 TRACE("WKSSVC_IDENTIFY_HANDLE_unbind() called\n");
78 status
= RpcBindingFree(&hBinding
);
81 TRACE("RpcBindingFree returned 0x%x\n", status
);
87 WKSSVC_IMPERSONATE_HANDLE_bind(WKSSVC_IMPERSONATE_HANDLE pszSystemName
)
89 handle_t hBinding
= NULL
;
90 LPWSTR pszStringBinding
;
93 TRACE("WKSSVC_IMPERSONATE_HANDLE_bind() called\n");
95 status
= RpcStringBindingComposeW(NULL
,
103 TRACE("RpcStringBindingCompose returned 0x%x\n", status
);
107 /* Set the binding handle that will be used to bind to the server. */
108 status
= RpcBindingFromStringBindingW(pszStringBinding
,
112 TRACE("RpcBindingFromStringBinding returned 0x%x\n", status
);
115 status
= RpcStringFreeW(&pszStringBinding
);
118 // TRACE("RpcStringFree returned 0x%x\n", status);
126 WKSSVC_IMPERSONATE_HANDLE_unbind(WKSSVC_IMPERSONATE_HANDLE pszSystemName
,
131 TRACE("WKSSVC_IMPERSONATE_HANDLE_unbind() called\n");
133 status
= RpcBindingFree(&hBinding
);
136 TRACE("RpcBindingFree returned 0x%x\n", status
);
143 NetGetJoinInformation(
146 PNETSETUP_JOIN_STATUS type
)
148 NET_API_STATUS status
;
150 FIXME("Stub %s %p %p\n", wine_dbgstr_w(Server
), Name
, type
);
152 if (Name
== NULL
|| type
== NULL
)
153 return ERROR_INVALID_PARAMETER
;
157 status
= NetrGetJoinInformation((LPWSTR
)Server
,
161 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
163 status
= I_RpcMapWin32Status(RpcExceptionCode());
178 NET_API_STATUS status
;
184 status
= NetrWkstaGetInfo(servername
,
186 (LPWKSTA_INFO
)bufptr
);
188 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
190 status
= I_RpcMapWin32Status(RpcExceptionCode());
206 NET_API_STATUS status
;
210 status
= NetrWkstaSetInfo(servername
,
212 (LPWKSTA_INFO
)buffer
,
215 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
217 status
= I_RpcMapWin32Status(RpcExceptionCode());
233 LPDWORD totalentries
,
234 LPDWORD resumehandle
)
236 WKSTA_USER_ENUM_STRUCT UserEnumInfo
;
237 WKSTA_USER_INFO_0_CONTAINER Level0
;
238 WKSTA_USER_INFO_1_CONTAINER Level1
;
239 NET_API_STATUS status
;
241 TRACE("(%s, %d, %p, %d, %p, %p, %p): stub!\n", debugstr_w(servername
),
242 level
, bufptr
, prefmaxlen
, entriesread
, totalentries
, resumehandle
);
244 UserEnumInfo
.Level
= level
;
248 UserEnumInfo
.WkstaUserInfo
.Level0
= &Level0
;
249 UserEnumInfo
.WkstaUserInfo
.Level0
->EntriesRead
= 0;
250 UserEnumInfo
.WkstaUserInfo
.Level0
->Buffer
= NULL
;
254 UserEnumInfo
.WkstaUserInfo
.Level1
= &Level1
;
255 UserEnumInfo
.WkstaUserInfo
.Level1
->EntriesRead
= 0;
256 UserEnumInfo
.WkstaUserInfo
.Level1
->Buffer
= NULL
;
260 return ERROR_INVALID_PARAMETER
;
265 status
= NetrWkstaUserEnum(servername
,
270 if (status
== NERR_Success
|| status
== ERROR_MORE_DATA
)
275 *bufptr
= (LPBYTE
)UserEnumInfo
.WkstaUserInfo
.Level0
->Buffer
;
276 *entriesread
= UserEnumInfo
.WkstaUserInfo
.Level0
->EntriesRead
;
280 *bufptr
= (LPBYTE
)UserEnumInfo
.WkstaUserInfo
.Level1
->Buffer
;
281 *entriesread
= UserEnumInfo
.WkstaUserInfo
.Level1
->EntriesRead
;
286 RpcExcept(EXCEPTION_EXECUTE_HANDLER
)
288 status
= I_RpcMapWin32Status(RpcExceptionCode());