ReactOS 0.4.16-dev-819-g75c0dc0
precomp.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winerror.h>
#include <winreg.h>
#include <winsvc.h>
#include <lmcons.h>
#include <lmerr.h>
#include <lmjoin.h>
#include <lmserver.h>
#include <ntsecapi.h>
#include <ntmsv1_0.h>
#include <ndk/obfuncs.h>
#include <ndk/psfuncs.h>
#include <ndk/rtlfuncs.h>
#include <ndk/sefuncs.h>
#include <wkssvc_s.h>
#include <wine/debug.h>
Include dependency graph for precomp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define WKSTA_KEEPCONN_PARMNUM   13
 
#define WKSTA_MAXCMDS_PARMNUM   15
 
#define WKSTA_SESSTIMEOUT_PARMNUM   18
 
#define WKSTA_DORMANTFILELIMIT_PARMNUM   46
 

Functions

NET_API_STATUS NetpJoinWorkgroup (_In_ LPCWSTR WorkgroupName)
 
NET_API_STATUS NetpGetJoinInformation (LPWSTR *NameBuffer, PNETSETUP_JOIN_STATUS BufferType)
 
VOID InitWorkstationInfo (VOID)
 
VOID SaveWorkstationInfo (_In_ DWORD Level)
 
DWORD WINAPI RpcThreadRoutine (LPVOID lpParameter)
 

Variables

OSVERSIONINFOW VersionInfo
 
HANDLE LsaHandle
 
ULONG LsaAuthenticationPackage
 
WKSTA_INFO_502 WkstaInfo502
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 5 of file precomp.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 6 of file precomp.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 4 of file precomp.h.

◆ WKSTA_DORMANTFILELIMIT_PARMNUM

#define WKSTA_DORMANTFILELIMIT_PARMNUM   46

Definition at line 32 of file precomp.h.

◆ WKSTA_KEEPCONN_PARMNUM

#define WKSTA_KEEPCONN_PARMNUM   13

Definition at line 29 of file precomp.h.

◆ WKSTA_MAXCMDS_PARMNUM

#define WKSTA_MAXCMDS_PARMNUM   15

Definition at line 30 of file precomp.h.

◆ WKSTA_SESSTIMEOUT_PARMNUM

#define WKSTA_SESSTIMEOUT_PARMNUM   18

Definition at line 31 of file precomp.h.

Function Documentation

◆ InitWorkstationInfo()

VOID InitWorkstationInfo ( VOID  )

Definition at line 23 of file info.c.

24{
25 HKEY hInfoKey = NULL;
26 DWORD dwType, dwSize, dwValue;
27 DWORD dwError;
28
30 L"System\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters",
31 0,
33 &hInfoKey);
34 if (dwError != ERROR_SUCCESS)
35 {
36 ERR("RegOpenKeyExW() failed!\n");
37 return;
38 }
39
40 dwSize = sizeof(dwValue);
41 dwError = RegQueryValueExW(hInfoKey,
42 L"CharWait",
43 0,
44 &dwType,
45 (PBYTE)&dwValue,
46 &dwSize);
47 if ((dwError == ERROR_SUCCESS) && (dwValue <= 65535))
49 else
51
52 dwSize = sizeof(dwValue);
53 dwError = RegQueryValueExW(hInfoKey,
54 L"CollectionTime",
55 0,
56 &dwType,
57 (PBYTE)&dwValue,
58 &dwSize);
59 if ((dwError == ERROR_SUCCESS) && (dwValue <= 65535000))
61 else
63
64 dwSize = sizeof(dwValue);
65 dwError = RegQueryValueExW(hInfoKey,
66 L"MaximumCollectionCount",
67 0,
68 &dwType,
69 (PBYTE)&dwValue,
70 &dwSize);
71 if ((dwError == ERROR_SUCCESS) && (dwValue <= 65535))
73 else
75
76 dwSize = sizeof(dwValue);
77 dwError = RegQueryValueExW(hInfoKey,
78 L"KeepConn",
79 0,
80 &dwType,
81 (PBYTE)&dwValue,
82 &dwSize);
83 if ((dwError == ERROR_SUCCESS) && (dwValue >= 1) && (dwValue <= 65535))
85 else
87
88 dwSize = sizeof(dwValue);
89 dwError = RegQueryValueExW(hInfoKey,
90 L"MaxCmds",
91 0,
92 &dwType,
93 (PBYTE)&dwValue,
94 &dwSize);
95 if ((dwError == ERROR_SUCCESS) && (dwValue >= 50) && (dwValue <= 65535))
97 else
99
100 dwSize = sizeof(dwValue);
101 dwError = RegQueryValueExW(hInfoKey,
102 L"SessTimeout",
103 0,
104 &dwType,
105 (PBYTE)&dwValue,
106 &dwSize);
107 if ((dwError == ERROR_SUCCESS) && (dwValue >= 60) && (dwValue <= 65535))
109 else
111
112
113 dwSize = sizeof(dwValue);
114 dwError = RegQueryValueExW(hInfoKey,
115 L"SizCharBuf",
116 0,
117 &dwType,
118 (PBYTE)&dwValue,
119 &dwSize);
120 if ((dwError == ERROR_SUCCESS) && (dwValue >= 64) && (dwValue <= 4096))
122 else
124
125 dwSize = sizeof(dwValue);
126 dwError = RegQueryValueExW(hInfoKey,
127 L"MaxThreads",
128 0,
129 &dwType,
130 (PBYTE)&dwValue,
131 &dwSize);
132 if ((dwError == ERROR_SUCCESS) && (dwValue >= 1) && (dwValue <= 256))
134 else
136
137 dwSize = sizeof(dwValue);
138 dwError = RegQueryValueExW(hInfoKey,
139 L"LockQuota",
140 0,
141 &dwType,
142 (PBYTE)&dwValue,
143 &dwSize);
144 if (dwError == ERROR_SUCCESS)
146 else
148
149 dwSize = sizeof(dwValue);
150 dwError = RegQueryValueExW(hInfoKey,
151 L"LockQuota",
152 0,
153 &dwType,
154 (PBYTE)&dwValue,
155 &dwSize);
156 if (dwError == ERROR_SUCCESS)
158 else
160
161 dwSize = sizeof(dwValue);
162 dwError = RegQueryValueExW(hInfoKey,
163 L"LockIncrement",
164 0,
165 &dwType,
166 (PBYTE)&dwValue,
167 &dwSize);
168 if (dwError == ERROR_SUCCESS)
170 else
172
173 dwSize = sizeof(dwValue);
174 dwError = RegQueryValueExW(hInfoKey,
175 L"LockMaximum",
176 0,
177 &dwType,
178 (PBYTE)&dwValue,
179 &dwSize);
180 if (dwError == ERROR_SUCCESS)
182 else
184
185 dwSize = sizeof(dwValue);
186 dwError = RegQueryValueExW(hInfoKey,
187 L"PipeIncrement",
188 0,
189 &dwType,
190 (PBYTE)&dwValue,
191 &dwSize);
192 if (dwError == ERROR_SUCCESS)
194 else
196
197 dwSize = sizeof(dwValue);
198 dwError = RegQueryValueExW(hInfoKey,
199 L"PipeMaximum",
200 0,
201 &dwType,
202 (PBYTE)&dwValue,
203 &dwSize);
204 if (dwError == ERROR_SUCCESS)
206 else
208
209 dwSize = sizeof(dwValue);
210 dwError = RegQueryValueExW(hInfoKey,
211 L"CacheFileTimeout",
212 0,
213 &dwType,
214 (PBYTE)&dwValue,
215 &dwSize);
216 if (dwError == ERROR_SUCCESS)
218 else
220
221 dwSize = sizeof(dwValue);
222 dwError = RegQueryValueExW(hInfoKey,
223 L"DormantFileLimit",
224 0,
225 &dwType,
226 (PBYTE)&dwValue,
227 &dwSize);
228 if (dwError == ERROR_SUCCESS && dwValue >= 1)
230 else
232
233 dwSize = sizeof(dwValue);
234 dwError = RegQueryValueExW(hInfoKey,
235 L"ReadAheadThroughput",
236 0,
237 &dwType,
238 (PBYTE)&dwValue,
239 &dwSize);
240 if (dwError == ERROR_SUCCESS)
242 else
244
245 dwSize = sizeof(dwValue);
246 dwError = RegQueryValueExW(hInfoKey,
247 L"MailslotBuffers",
248 0,
249 &dwType,
250 (PBYTE)&dwValue,
251 &dwSize);
252 if (dwError == ERROR_SUCCESS)
254 else
256
257 dwSize = sizeof(dwValue);
258 dwError = RegQueryValueExW(hInfoKey,
259 L"ServerAnnounceBuffers",
260 0,
261 &dwType,
262 (PBYTE)&dwValue,
263 &dwSize);
264 if (dwError == ERROR_SUCCESS)
266 else
268
269 dwSize = sizeof(dwValue);
270 dwError = RegQueryValueExW(hInfoKey,
271 L"NumIllegalDatagramEvents",
272 0,
273 &dwType,
274 (PBYTE)&dwValue,
275 &dwSize);
276 if (dwError == ERROR_SUCCESS)
278 else
280
281 dwSize = sizeof(dwValue);
282 dwError = RegQueryValueExW(hInfoKey,
283 L"IllegalDatagramResetTime",
284 0,
285 &dwType,
286 (PBYTE)&dwValue,
287 &dwSize);
288 if (dwError == ERROR_SUCCESS)
290 else
292
293 dwSize = sizeof(dwValue);
294 dwError = RegQueryValueExW(hInfoKey,
295 L"LogElectionPackets",
296 0,
297 &dwType,
298 (PBYTE)&dwValue,
299 &dwSize);
300 if (dwError == ERROR_SUCCESS)
302 else
304
305 dwSize = sizeof(dwValue);
306 dwError = RegQueryValueExW(hInfoKey,
307 L"UseOpportunisticLocking",
308 0,
309 &dwType,
310 (PBYTE)&dwValue,
311 &dwSize);
312 if (dwError == ERROR_SUCCESS)
314 else
316
317 dwSize = sizeof(dwValue);
318 dwError = RegQueryValueExW(hInfoKey,
319 L"UseUnlockBehind",
320 0,
321 &dwType,
322 (PBYTE)&dwValue,
323 &dwSize);
324 if (dwError == ERROR_SUCCESS)
326 else
328
329 dwSize = sizeof(dwValue);
330 dwError = RegQueryValueExW(hInfoKey,
331 L"UseCloseBehind",
332 0,
333 &dwType,
334 (PBYTE)&dwValue,
335 &dwSize);
336 if (dwError == ERROR_SUCCESS)
338 else
340
341 dwSize = sizeof(dwValue);
342 dwError = RegQueryValueExW(hInfoKey,
343 L"BufNamedPipes",
344 0,
345 &dwType,
346 (PBYTE)&dwValue,
347 &dwSize);
348 if (dwError == ERROR_SUCCESS)
350 else
352
353 dwSize = sizeof(dwValue);
354 dwError = RegQueryValueExW(hInfoKey,
355 L"UseLockReadUnlock",
356 0,
357 &dwType,
358 (PBYTE)&dwValue,
359 &dwSize);
360 if (dwError == ERROR_SUCCESS)
362 else
364
365 dwSize = sizeof(dwValue);
366 dwError = RegQueryValueExW(hInfoKey,
367 L"UtilizeNtCaching",
368 0,
369 &dwType,
370 (PBYTE)&dwValue,
371 &dwSize);
372 if (dwError == ERROR_SUCCESS)
374 else
376
377 dwSize = sizeof(dwValue);
378 dwError = RegQueryValueExW(hInfoKey,
379 L"UseRawRead",
380 0,
381 &dwType,
382 (PBYTE)&dwValue,
383 &dwSize);
384 if (dwError == ERROR_SUCCESS)
386 else
388
389 dwSize = sizeof(dwValue);
390 dwError = RegQueryValueExW(hInfoKey,
391 L"UseRawWrite",
392 0,
393 &dwType,
394 (PBYTE)&dwValue,
395 &dwSize);
396 if (dwError == ERROR_SUCCESS)
398 else
400
401 dwSize = sizeof(dwValue);
402 dwError = RegQueryValueExW(hInfoKey,
403 L"UseWriteRawData",
404 0,
405 &dwType,
406 (PBYTE)&dwValue,
407 &dwSize);
408 if (dwError == ERROR_SUCCESS)
410 else
412
413 dwSize = sizeof(dwValue);
414 dwError = RegQueryValueExW(hInfoKey,
415 L"UseEncryption",
416 0,
417 &dwType,
418 (PBYTE)&dwValue,
419 &dwSize);
420 if (dwError == ERROR_SUCCESS)
422 else
424
425 dwSize = sizeof(dwValue);
426 dwError = RegQueryValueExW(hInfoKey,
427 L"BufFilesDenyWrite",
428 0,
429 &dwType,
430 (PBYTE)&dwValue,
431 &dwSize);
432 if (dwError == ERROR_SUCCESS)
434 else
436
437 dwSize = sizeof(dwValue);
438 dwError = RegQueryValueExW(hInfoKey,
439 L"BufReadOnlyFiles",
440 0,
441 &dwType,
442 (PBYTE)&dwValue,
443 &dwSize);
444 if (dwError == ERROR_SUCCESS)
446 else
448
449 dwSize = sizeof(dwValue);
450 dwError = RegQueryValueExW(hInfoKey,
451 L"ForceCoreCreateMode",
452 0,
453 &dwType,
454 (PBYTE)&dwValue,
455 &dwSize);
456 if (dwError == ERROR_SUCCESS)
458 else
460
461 dwSize = sizeof(dwValue);
462 dwError = RegQueryValueExW(hInfoKey,
463 L"Use512ByteMaxTransfer",
464 0,
465 &dwType,
466 (PBYTE)&dwValue,
467 &dwSize);
468 if (dwError == ERROR_SUCCESS)
470 else
472
473 RegCloseKey(hInfoKey);
474}
WKSTA_INFO_502 WkstaInfo502
Definition: info.c:17
#define ERR(fmt,...)
Definition: precomp.h:57
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
unsigned long DWORD
Definition: ntddk_ex.h:95
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define KEY_READ
Definition: nt_native.h:1023
#define L(x)
Definition: ntvdm.h:50
BYTE * PBYTE
Definition: pedump.c:66
DWORD wki502_dormant_file_limit
Definition: lmwksta.h:148
DWORD wki502_illegal_datagram_event_reset_frequency
Definition: lmwksta.h:153
BOOL wki502_use_opportunistic_locking
Definition: lmwksta.h:155
DWORD wki502_pipe_increment
Definition: lmwksta.h:145
DWORD wki502_char_wait
Definition: lmwksta.h:134
BOOL wki502_use_raw_write
Definition: lmwksta.h:162
DWORD wki502_lock_maximum
Definition: lmwksta.h:144
DWORD wki502_cache_file_timeout
Definition: lmwksta.h:147
DWORD wki502_keep_conn
Definition: lmwksta.h:137
DWORD wki502_num_mailslot_buffers
Definition: lmwksta.h:150
BOOL wki502_force_core_create_mode
Definition: lmwksta.h:167
BOOL wki502_buf_named_pipes
Definition: lmwksta.h:158
BOOL wki502_utilize_nt_caching
Definition: lmwksta.h:160
BOOL wki502_use_close_behind
Definition: lmwksta.h:157
BOOL wki502_use_encryption
Definition: lmwksta.h:164
DWORD wki502_read_ahead_throughput
Definition: lmwksta.h:149
DWORD wki502_num_srv_announce_buffers
Definition: lmwksta.h:151
BOOL wki502_buf_read_only_files
Definition: lmwksta.h:166
DWORD wki502_siz_char_buf
Definition: lmwksta.h:140
BOOL wki502_use_unlock_behind
Definition: lmwksta.h:156
DWORD wki502_collection_time
Definition: lmwksta.h:135
BOOL wki502_use_512_byte_max_transfer
Definition: lmwksta.h:168
DWORD wki502_sess_timeout
Definition: lmwksta.h:139
BOOL wki502_log_election_packets
Definition: lmwksta.h:154
DWORD wki502_max_illegal_datagram_events
Definition: lmwksta.h:152
DWORD wki502_maximum_collection_count
Definition: lmwksta.h:136
BOOL wki502_use_raw_read
Definition: lmwksta.h:161
DWORD wki502_lock_increment
Definition: lmwksta.h:143
BOOL wki502_use_write_raw_data
Definition: lmwksta.h:163
BOOL wki502_buf_files_deny_write
Definition: lmwksta.h:165
DWORD wki502_max_cmds
Definition: lmwksta.h:138
DWORD wki502_pipe_maximum
Definition: lmwksta.h:146
DWORD wki502_lock_quota
Definition: lmwksta.h:142
DWORD wki502_max_threads
Definition: lmwksta.h:141
BOOL wki502_use_lock_read_unlock
Definition: lmwksta.h:159
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by ServiceInit().

◆ NetpGetJoinInformation()

NET_API_STATUS NetpGetJoinInformation ( LPWSTR NameBuffer,
PNETSETUP_JOIN_STATUS  BufferType 
)

Definition at line 71 of file domain.c.

74{
76 PPOLICY_PRIMARY_DOMAIN_INFO PrimaryDomainInfo = NULL;
77 LSA_HANDLE PolicyHandle = NULL;
79
80 *BufferType = NetSetupUnknownStatus;
81 *NameBuffer = NULL;
82
85
89 &PolicyHandle);
90 if (!LSA_SUCCESS(Status))
92
93 Status = LsaQueryInformationPolicy(PolicyHandle,
95 (PVOID*)&PrimaryDomainInfo);
97 {
98 TRACE("Sid: %p\n", PrimaryDomainInfo->Sid);
99 TRACE("Name: %S\n", PrimaryDomainInfo->Name.Buffer);
100
101 if (PrimaryDomainInfo->Name.Length > 0)
102 {
103 if (PrimaryDomainInfo->Sid != NULL)
104 *BufferType = NetSetupDomainName;
105 else
106 *BufferType = NetSetupWorkgroupName;
107
108 *NameBuffer = midl_user_allocate(PrimaryDomainInfo->Name.Length + sizeof(WCHAR));
109 if (*NameBuffer)
110 wcscpy(*NameBuffer, PrimaryDomainInfo->Name.Buffer);
111 }
112 else
113 {
114 *BufferType = NetSetupUnjoined;
115 }
116
117 if (PrimaryDomainInfo->Sid)
118 LsaFreeMemory(PrimaryDomainInfo->Sid);
119
120 LsaFreeMemory(PrimaryDomainInfo);
121 }
122
123 LsaClose(PolicyHandle);
124
126}
LONG NTSTATUS
Definition: precomp.h:26
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
wcscpy
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
Status
Definition: gdiplustypes.h:25
@ NetSetupDomainName
Definition: lmjoin.h:13
@ NetSetupWorkgroupName
Definition: lmjoin.h:12
@ NetSetupUnjoined
Definition: lmjoin.h:11
@ NetSetupUnknownStatus
Definition: lmjoin.h:10
@ PolicyPrimaryDomainInformation
Definition: ntsecapi.h:245
struct _LSA_OBJECT_ATTRIBUTES LSA_OBJECT_ATTRIBUTES
#define POLICY_VIEW_LOCAL_INFORMATION
Definition: ntsecapi.h:61
#define LSA_SUCCESS(x)
Definition: ntsecapi.h:23
#define midl_user_allocate
Definition: rpc.h:40
#define TRACE(s)
Definition: solgame.cpp:4
LSA_UNICODE_STRING Name
Definition: ntsecapi.h:570
#define ZeroMemory
Definition: winbase.h:1737
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by NetrGetJoinInformation().

◆ NetpJoinWorkgroup()

NET_API_STATUS NetpJoinWorkgroup ( _In_ LPCWSTR  WorkgroupName)

Definition at line 52 of file domain.c.

54{
56
57 FIXME("NetpJoinWorkgroup(%S)\n", lpWorkgroupName);
58
59 status = NetpSetPrimaryDomain(lpWorkgroupName);
60 if (status != NERR_Success)
61 {
62 ERR("NetpSetPrimaryDomain failed (Status %lu)\n", status);
63 return status;
64 }
65
66 return NERR_Success;
67}
static NET_API_STATUS NetpSetPrimaryDomain(_In_ LPCWSTR lpWorkgroupName)
Definition: domain.c:19
#define FIXME(fmt,...)
Definition: precomp.h:53
#define NERR_Success
Definition: lmerr.h:5
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
Definition: ps.c:97

Referenced by NetrJoinDomain2().

◆ RpcThreadRoutine()

DWORD WINAPI RpcThreadRoutine ( LPVOID  lpParameter)

Definition at line 20 of file rpcserver.c.

22{
24
25 Status = RpcServerUseProtseqEpW(L"ncacn_np", 20, L"\\pipe\\browser", NULL);
26 if (Status != RPC_S_OK)
27 {
28 ERR("RpcServerUseProtseqEpW() failed (Status %lx)\n", Status);
29 return 0;
30 }
31
32 Status = RpcServerRegisterIf(browser_v0_0_s_ifspec, NULL, NULL);
33 if (Status != RPC_S_OK)
34 {
35 ERR("RpcServerRegisterIf() failed (Status %lx)\n", Status);
36 return 0;
37 }
38
40 if (Status != RPC_S_OK)
41 {
42 ERR("RpcServerListen() failed (Status %lx)\n", Status);
43 }
44
45 return 0;
46}
#define FALSE
Definition: types.h:117
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:48

◆ SaveWorkstationInfo()

VOID SaveWorkstationInfo ( _In_ DWORD  Level)

Definition at line 478 of file info.c.

480{
481 HKEY hInfoKey = NULL;
482 DWORD dwError;
483
485 L"System\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters",
486 0,
487 KEY_WRITE,
488 &hInfoKey);
489 if (dwError != ERROR_SUCCESS)
490 {
491 ERR("RegOpenKeyExW() failed!\n");
492 return;
493 }
494
495 switch (Level)
496 {
497 case 502:
498 RegSetValueExW(hInfoKey,
499 L"CharWait",
500 0,
501 REG_DWORD,
503 sizeof(DWORD));
504
505 RegSetValueExW(hInfoKey,
506 L"CollectionTime",
507 0,
508 REG_DWORD,
510 sizeof(DWORD));
511
512 RegSetValueExW(hInfoKey,
513 L"MaximumCollectionCount",
514 0,
515 REG_DWORD,
517 sizeof(DWORD));
518
519 RegSetValueExW(hInfoKey,
520 L"KeepConn",
521 0,
522 REG_DWORD,
524 sizeof(DWORD));
525
526 RegSetValueExW(hInfoKey,
527 L"MaxCmds",
528 0,
529 REG_DWORD,
531 sizeof(DWORD));
532
533 RegSetValueExW(hInfoKey,
534 L"SessTimeout",
535 0,
536 REG_DWORD,
538 sizeof(DWORD));
539
540 RegSetValueExW(hInfoKey,
541 L"SizCharBuf",
542 0,
543 REG_DWORD,
545 sizeof(DWORD));
546
547 RegSetValueExW(hInfoKey,
548 L"MaxThreads",
549 0,
550 REG_DWORD,
552 sizeof(DWORD));
553
554 RegSetValueExW(hInfoKey,
555 L"LockQuota",
556 0,
557 REG_DWORD,
559 sizeof(DWORD));
560
561 RegSetValueExW(hInfoKey,
562 L"LockIncrement",
563 0,
564 REG_DWORD,
566 sizeof(DWORD));
567
568 RegSetValueExW(hInfoKey,
569 L"LockMaximum",
570 0,
571 REG_DWORD,
573 sizeof(DWORD));
574
575 RegSetValueExW(hInfoKey,
576 L"PipeIncrement",
577 0,
578 REG_DWORD,
580 sizeof(DWORD));
581
582 RegSetValueExW(hInfoKey,
583 L"PipeMaximum",
584 0,
585 REG_DWORD,
587 sizeof(DWORD));
588
589 RegSetValueExW(hInfoKey,
590 L"CacheFileTimeout",
591 0,
592 REG_DWORD,
594 sizeof(DWORD));
595
596 RegSetValueExW(hInfoKey,
597 L"DormantFileLimit",
598 0,
599 REG_DWORD,
601 sizeof(DWORD));
602
603 RegSetValueExW(hInfoKey,
604 L"ReadAheadThroughput",
605 0,
606 REG_DWORD,
608 sizeof(DWORD));
609
610 RegSetValueExW(hInfoKey,
611 L"MailslotBuffers",
612 0,
613 REG_DWORD,
615 sizeof(DWORD));
616
617 RegSetValueExW(hInfoKey,
618 L"ServerAnnounceBuffers",
619 0,
620 REG_DWORD,
622 sizeof(DWORD));
623
624 RegSetValueExW(hInfoKey,
625 L"NumIllegalDatagramEvents",
626 0,
627 REG_DWORD,
629 sizeof(DWORD));
630
631 RegSetValueExW(hInfoKey,
632 L"IllegalDatagramResetTime",
633 0,
634 REG_DWORD,
636 sizeof(DWORD));
637
638 RegSetValueExW(hInfoKey,
639 L"LogElectionPackets",
640 0,
641 REG_DWORD,
643 sizeof(BOOL));
644
645 RegSetValueExW(hInfoKey,
646 L"UseOpportunisticLocking",
647 0,
648 REG_DWORD,
650 sizeof(BOOL));
651
652 RegSetValueExW(hInfoKey,
653 L"UseUnlockBehind",
654 0,
655 REG_DWORD,
657 sizeof(BOOL));
658
659 RegSetValueExW(hInfoKey,
660 L"UseCloseBehind",
661 0,
662 REG_DWORD,
664 sizeof(BOOL));
665
666 RegSetValueExW(hInfoKey,
667 L"BufNamedPipes",
668 0,
669 REG_DWORD,
671 sizeof(BOOL));
672
673 RegSetValueExW(hInfoKey,
674 L"UseLockReadUnlock",
675 0,
676 REG_DWORD,
678 sizeof(BOOL));
679
680 RegSetValueExW(hInfoKey,
681 L"UtilizeNtCaching",
682 0,
683 REG_DWORD,
685 sizeof(BOOL));
686
687 RegSetValueExW(hInfoKey,
688 L"UseRawRead",
689 0,
690 REG_DWORD,
692 sizeof(BOOL));
693
694 RegSetValueExW(hInfoKey,
695 L"UseRawWrite",
696 0,
697 REG_DWORD,
699 sizeof(BOOL));
700
701 RegSetValueExW(hInfoKey,
702 L"UseWriteRawData",
703 0,
704 REG_DWORD,
706 sizeof(BOOL));
707
708 RegSetValueExW(hInfoKey,
709 L"UseEncryption",
710 0,
711 REG_DWORD,
713 sizeof(BOOL));
714
715 RegSetValueExW(hInfoKey,
716 L"BufFilesDenyWrite",
717 0,
718 REG_DWORD,
720 sizeof(BOOL));
721
722 RegSetValueExW(hInfoKey,
723 L"BufReadOnlyFiles",
724 0,
725 REG_DWORD,
727 sizeof(BOOL));
728
729 RegSetValueExW(hInfoKey,
730 L"ForceCoreCreateMode",
731 0,
732 REG_DWORD,
734 sizeof(BOOL));
735
736 RegSetValueExW(hInfoKey,
737 L"Use512ByteMaxTransfer",
738 0,
739 REG_DWORD,
741 sizeof(BOOL));
742 break;
743
744 case 1013:
745 RegSetValueExW(hInfoKey,
746 L"KeepConn",
747 0,
748 REG_DWORD,
750 sizeof(DWORD));
751 break;
752
753 case 1018:
754 RegSetValueExW(hInfoKey,
755 L"SessTimeout",
756 0,
757 REG_DWORD,
759 sizeof(DWORD));
760 break;
761
762 case 1046:
763 RegSetValueExW(hInfoKey,
764 L"DormantFileLimit",
765 0,
766 REG_DWORD,
768 sizeof(DWORD));
769 break;
770 }
771
772 RegCloseKey(hInfoKey);
773}
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
unsigned int BOOL
Definition: ntddk_ex.h:94
#define KEY_WRITE
Definition: nt_native.h:1031
#define REG_DWORD
Definition: sdbapi.c:596
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:56

Referenced by NetrWkstaSetInfo().

Variable Documentation

◆ LsaAuthenticationPackage

ULONG LsaAuthenticationPackage
extern

Definition at line 42 of file wkssvc.c.

Referenced by NetrWkstaGetInfo(), NetrWkstaUserEnum(), NetrWkstaUserGetInfo(), and ServiceInit().

◆ LsaHandle

◆ VersionInfo

◆ WkstaInfo502

WKSTA_INFO_502 WkstaInfo502
extern