1 /* 2 * COPYRIGHT: See COPYING in the top level directory 3 * PROJECT: ReactOS Services 4 * FILE: base/services/wkssvc/info.c 5 * PURPOSE: Workstation service 6 * PROGRAMMER: Eric Kohl 7 */ 8 9 /* INCLUDES *****************************************************************/ 10 11 #include "precomp.h" 12 13 WINE_DEFAULT_DEBUG_CHANNEL(wkssvc); 14 15 /* GLOBALS *******************************************************************/ 16 17 WKSTA_INFO_502 WkstaInfo502; 18 19 20 /* FUNCTIONS *****************************************************************/ 21 22 VOID 23 InitWorkstationInfo(VOID) 24 { 25 HKEY hInfoKey = NULL; 26 DWORD dwType, dwSize, dwValue; 27 DWORD dwError; 28 29 dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, 30 L"System\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters", 31 0, 32 KEY_READ, 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)) 48 WkstaInfo502.wki502_char_wait = dwValue; 49 else 50 WkstaInfo502.wki502_char_wait = 0; 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)) 60 WkstaInfo502.wki502_collection_time = dwValue; 61 else 62 WkstaInfo502.wki502_collection_time = 250; 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)) 72 WkstaInfo502.wki502_maximum_collection_count = dwValue; 73 else 74 WkstaInfo502.wki502_maximum_collection_count = 16; 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)) 84 WkstaInfo502.wki502_keep_conn = dwValue; 85 else 86 WkstaInfo502.wki502_keep_conn = 600; 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)) 96 WkstaInfo502.wki502_max_cmds = dwValue; 97 else 98 WkstaInfo502.wki502_max_cmds = 50; 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)) 108 WkstaInfo502.wki502_sess_timeout = dwValue; 109 else 110 WkstaInfo502.wki502_sess_timeout = 60; 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)) 121 WkstaInfo502.wki502_siz_char_buf = dwValue; 122 else 123 WkstaInfo502.wki502_siz_char_buf = 512; 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)) 133 WkstaInfo502.wki502_max_threads = dwValue; 134 else 135 WkstaInfo502.wki502_max_threads = 17; 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) 145 WkstaInfo502.wki502_lock_quota = dwValue; 146 else 147 WkstaInfo502.wki502_lock_quota = 6144; 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) 157 WkstaInfo502.wki502_lock_quota = dwValue; 158 else 159 WkstaInfo502.wki502_lock_quota = 6144; 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) 169 WkstaInfo502.wki502_lock_increment = dwValue; 170 else 171 WkstaInfo502.wki502_lock_increment = 10; 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) 181 WkstaInfo502.wki502_lock_maximum = dwValue; 182 else 183 WkstaInfo502.wki502_lock_maximum = 500; 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) 193 WkstaInfo502.wki502_pipe_increment = dwValue; 194 else 195 WkstaInfo502.wki502_pipe_increment = 10; 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) 205 WkstaInfo502.wki502_pipe_maximum = dwValue; 206 else 207 WkstaInfo502.wki502_pipe_maximum = 500; 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) 217 WkstaInfo502.wki502_cache_file_timeout = dwValue; 218 else 219 WkstaInfo502.wki502_cache_file_timeout = 40; 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) 229 WkstaInfo502.wki502_dormant_file_limit = dwValue; 230 else 231 WkstaInfo502.wki502_dormant_file_limit = 1; 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) 241 WkstaInfo502.wki502_read_ahead_throughput = dwValue; 242 else 243 WkstaInfo502.wki502_read_ahead_throughput = 0; 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) 253 WkstaInfo502.wki502_num_mailslot_buffers = dwValue; 254 else 255 WkstaInfo502.wki502_num_mailslot_buffers = 3; 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) 265 WkstaInfo502.wki502_num_srv_announce_buffers = dwValue; 266 else 267 WkstaInfo502.wki502_num_srv_announce_buffers = 20; 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) 277 WkstaInfo502.wki502_max_illegal_datagram_events = dwValue; 278 else 279 WkstaInfo502.wki502_max_illegal_datagram_events = 5; 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) 289 WkstaInfo502.wki502_illegal_datagram_event_reset_frequency = dwValue; 290 else 291 WkstaInfo502.wki502_illegal_datagram_event_reset_frequency = 3600; 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) 301 WkstaInfo502.wki502_log_election_packets = dwValue; 302 else 303 WkstaInfo502.wki502_log_election_packets = 0; 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) 313 WkstaInfo502.wki502_use_opportunistic_locking = dwValue; 314 else 315 WkstaInfo502.wki502_use_opportunistic_locking = 1; 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) 325 WkstaInfo502.wki502_use_unlock_behind = dwValue; 326 else 327 WkstaInfo502.wki502_use_unlock_behind = 1; 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) 337 WkstaInfo502.wki502_use_close_behind = dwValue; 338 else 339 WkstaInfo502.wki502_use_close_behind = 1; 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) 349 WkstaInfo502.wki502_buf_named_pipes = dwValue; 350 else 351 WkstaInfo502.wki502_buf_named_pipes = 1; 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) 361 WkstaInfo502.wki502_use_lock_read_unlock = dwValue; 362 else 363 WkstaInfo502.wki502_use_lock_read_unlock = 1; 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) 373 WkstaInfo502.wki502_utilize_nt_caching = dwValue; 374 else 375 WkstaInfo502.wki502_utilize_nt_caching = 1; 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) 385 WkstaInfo502.wki502_use_raw_read = dwValue; 386 else 387 WkstaInfo502.wki502_use_raw_read = 1; 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) 397 WkstaInfo502.wki502_use_raw_write = dwValue; 398 else 399 WkstaInfo502.wki502_use_raw_write = 1; 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) 409 WkstaInfo502.wki502_use_write_raw_data = dwValue; 410 else 411 WkstaInfo502.wki502_use_write_raw_data = 0; 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) 421 WkstaInfo502.wki502_use_encryption = dwValue; 422 else 423 WkstaInfo502.wki502_use_encryption = 1; 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) 433 WkstaInfo502.wki502_buf_files_deny_write = dwValue; 434 else 435 WkstaInfo502.wki502_buf_files_deny_write = 0; 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) 445 WkstaInfo502.wki502_buf_read_only_files = dwValue; 446 else 447 WkstaInfo502.wki502_buf_read_only_files = 0; 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) 457 WkstaInfo502.wki502_force_core_create_mode = dwValue; 458 else 459 WkstaInfo502.wki502_force_core_create_mode = 0; 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) 469 WkstaInfo502.wki502_use_512_byte_max_transfer = dwValue; 470 else 471 WkstaInfo502.wki502_use_512_byte_max_transfer = 0; 472 473 RegCloseKey(hInfoKey); 474 } 475 476 477 VOID 478 SaveWorkstationInfo( 479 _In_ DWORD Level) 480 { 481 HKEY hInfoKey = NULL; 482 DWORD dwError; 483 484 dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, 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, 502 (PBYTE)&WkstaInfo502.wki502_char_wait, 503 sizeof(DWORD)); 504 505 RegSetValueExW(hInfoKey, 506 L"CollectionTime", 507 0, 508 REG_DWORD, 509 (PBYTE)&WkstaInfo502.wki502_collection_time, 510 sizeof(DWORD)); 511 512 RegSetValueExW(hInfoKey, 513 L"MaximumCollectionCount", 514 0, 515 REG_DWORD, 516 (PBYTE)&WkstaInfo502.wki502_maximum_collection_count, 517 sizeof(DWORD)); 518 519 RegSetValueExW(hInfoKey, 520 L"KeepConn", 521 0, 522 REG_DWORD, 523 (PBYTE)&WkstaInfo502.wki502_keep_conn, 524 sizeof(DWORD)); 525 526 RegSetValueExW(hInfoKey, 527 L"MaxCmds", 528 0, 529 REG_DWORD, 530 (PBYTE)&WkstaInfo502.wki502_max_cmds, 531 sizeof(DWORD)); 532 533 RegSetValueExW(hInfoKey, 534 L"SessTimeout", 535 0, 536 REG_DWORD, 537 (PBYTE)&WkstaInfo502.wki502_sess_timeout, 538 sizeof(DWORD)); 539 540 RegSetValueExW(hInfoKey, 541 L"SizCharBuf", 542 0, 543 REG_DWORD, 544 (PBYTE)&WkstaInfo502.wki502_siz_char_buf, 545 sizeof(DWORD)); 546 547 RegSetValueExW(hInfoKey, 548 L"MaxThreads", 549 0, 550 REG_DWORD, 551 (PBYTE)&WkstaInfo502.wki502_max_threads, 552 sizeof(DWORD)); 553 554 RegSetValueExW(hInfoKey, 555 L"LockQuota", 556 0, 557 REG_DWORD, 558 (PBYTE)&WkstaInfo502.wki502_lock_quota, 559 sizeof(DWORD)); 560 561 RegSetValueExW(hInfoKey, 562 L"LockIncrement", 563 0, 564 REG_DWORD, 565 (PBYTE)&WkstaInfo502.wki502_lock_increment, 566 sizeof(DWORD)); 567 568 RegSetValueExW(hInfoKey, 569 L"LockMaximum", 570 0, 571 REG_DWORD, 572 (PBYTE)&WkstaInfo502.wki502_lock_maximum, 573 sizeof(DWORD)); 574 575 RegSetValueExW(hInfoKey, 576 L"PipeIncrement", 577 0, 578 REG_DWORD, 579 (PBYTE)&WkstaInfo502.wki502_pipe_increment, 580 sizeof(DWORD)); 581 582 RegSetValueExW(hInfoKey, 583 L"PipeMaximum", 584 0, 585 REG_DWORD, 586 (PBYTE)&WkstaInfo502.wki502_pipe_maximum, 587 sizeof(DWORD)); 588 589 RegSetValueExW(hInfoKey, 590 L"CacheFileTimeout", 591 0, 592 REG_DWORD, 593 (PBYTE)&WkstaInfo502.wki502_cache_file_timeout, 594 sizeof(DWORD)); 595 596 RegSetValueExW(hInfoKey, 597 L"DormantFileLimit", 598 0, 599 REG_DWORD, 600 (PBYTE)&WkstaInfo502.wki502_dormant_file_limit, 601 sizeof(DWORD)); 602 603 RegSetValueExW(hInfoKey, 604 L"ReadAheadThroughput", 605 0, 606 REG_DWORD, 607 (PBYTE)&WkstaInfo502.wki502_read_ahead_throughput, 608 sizeof(DWORD)); 609 610 RegSetValueExW(hInfoKey, 611 L"MailslotBuffers", 612 0, 613 REG_DWORD, 614 (PBYTE)&WkstaInfo502.wki502_num_mailslot_buffers, 615 sizeof(DWORD)); 616 617 RegSetValueExW(hInfoKey, 618 L"ServerAnnounceBuffers", 619 0, 620 REG_DWORD, 621 (PBYTE)&WkstaInfo502.wki502_num_srv_announce_buffers, 622 sizeof(DWORD)); 623 624 RegSetValueExW(hInfoKey, 625 L"NumIllegalDatagramEvents", 626 0, 627 REG_DWORD, 628 (PBYTE)&WkstaInfo502.wki502_max_illegal_datagram_events, 629 sizeof(DWORD)); 630 631 RegSetValueExW(hInfoKey, 632 L"IllegalDatagramResetTime", 633 0, 634 REG_DWORD, 635 (PBYTE)&WkstaInfo502.wki502_illegal_datagram_event_reset_frequency, 636 sizeof(DWORD)); 637 638 RegSetValueExW(hInfoKey, 639 L"LogElectionPackets", 640 0, 641 REG_DWORD, 642 (PBYTE)&WkstaInfo502.wki502_log_election_packets, 643 sizeof(BOOL)); 644 645 RegSetValueExW(hInfoKey, 646 L"UseOpportunisticLocking", 647 0, 648 REG_DWORD, 649 (PBYTE)&WkstaInfo502.wki502_use_opportunistic_locking, 650 sizeof(BOOL)); 651 652 RegSetValueExW(hInfoKey, 653 L"UseUnlockBehind", 654 0, 655 REG_DWORD, 656 (PBYTE)&WkstaInfo502.wki502_use_unlock_behind, 657 sizeof(BOOL)); 658 659 RegSetValueExW(hInfoKey, 660 L"UseCloseBehind", 661 0, 662 REG_DWORD, 663 (PBYTE)&WkstaInfo502.wki502_use_close_behind, 664 sizeof(BOOL)); 665 666 RegSetValueExW(hInfoKey, 667 L"BufNamedPipes", 668 0, 669 REG_DWORD, 670 (PBYTE)&WkstaInfo502.wki502_buf_named_pipes, 671 sizeof(BOOL)); 672 673 RegSetValueExW(hInfoKey, 674 L"UseLockReadUnlock", 675 0, 676 REG_DWORD, 677 (PBYTE)&WkstaInfo502.wki502_use_lock_read_unlock, 678 sizeof(BOOL)); 679 680 RegSetValueExW(hInfoKey, 681 L"UtilizeNtCaching", 682 0, 683 REG_DWORD, 684 (PBYTE)&WkstaInfo502.wki502_utilize_nt_caching, 685 sizeof(BOOL)); 686 687 RegSetValueExW(hInfoKey, 688 L"UseRawRead", 689 0, 690 REG_DWORD, 691 (PBYTE)&WkstaInfo502.wki502_use_raw_read, 692 sizeof(BOOL)); 693 694 RegSetValueExW(hInfoKey, 695 L"UseRawWrite", 696 0, 697 REG_DWORD, 698 (PBYTE)&WkstaInfo502.wki502_use_raw_write, 699 sizeof(BOOL)); 700 701 RegSetValueExW(hInfoKey, 702 L"UseWriteRawData", 703 0, 704 REG_DWORD, 705 (PBYTE)&WkstaInfo502.wki502_use_write_raw_data, 706 sizeof(BOOL)); 707 708 RegSetValueExW(hInfoKey, 709 L"UseEncryption", 710 0, 711 REG_DWORD, 712 (PBYTE)&WkstaInfo502.wki502_use_encryption, 713 sizeof(BOOL)); 714 715 RegSetValueExW(hInfoKey, 716 L"BufFilesDenyWrite", 717 0, 718 REG_DWORD, 719 (PBYTE)&WkstaInfo502.wki502_buf_files_deny_write, 720 sizeof(BOOL)); 721 722 RegSetValueExW(hInfoKey, 723 L"BufReadOnlyFiles", 724 0, 725 REG_DWORD, 726 (PBYTE)&WkstaInfo502.wki502_buf_read_only_files, 727 sizeof(BOOL)); 728 729 RegSetValueExW(hInfoKey, 730 L"ForceCoreCreateMode", 731 0, 732 REG_DWORD, 733 (PBYTE)&WkstaInfo502.wki502_force_core_create_mode, 734 sizeof(BOOL)); 735 736 RegSetValueExW(hInfoKey, 737 L"Use512ByteMaxTransfer", 738 0, 739 REG_DWORD, 740 (PBYTE)&WkstaInfo502.wki502_use_512_byte_max_transfer, 741 sizeof(BOOL)); 742 break; 743 744 case 1013: 745 RegSetValueExW(hInfoKey, 746 L"KeepConn", 747 0, 748 REG_DWORD, 749 (PBYTE)&WkstaInfo502.wki502_keep_conn, 750 sizeof(DWORD)); 751 break; 752 753 case 1018: 754 RegSetValueExW(hInfoKey, 755 L"SessTimeout", 756 0, 757 REG_DWORD, 758 (PBYTE)&WkstaInfo502.wki502_sess_timeout, 759 sizeof(DWORD)); 760 break; 761 762 case 1046: 763 RegSetValueExW(hInfoKey, 764 L"DormantFileLimit", 765 0, 766 REG_DWORD, 767 (PBYTE)&WkstaInfo502.wki502_dormant_file_limit, 768 sizeof(DWORD)); 769 break; 770 } 771 772 RegCloseKey(hInfoKey); 773 } 774 775 /* EOF */ 776