Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
5.0 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. WksInfo.c
  5. Abstract:
  6. This file contains NetpWkstaStructureInfo().
  7. Author:
  8. John Rogers (JohnRo) 15-Aug-1991
  9. Environment:
  10. Portable to any flat, 32-bit environment. (Uses Win32 typedefs.)
  11. Requires ANSI C extensions: slash-slash comments, long external names.
  12. Revision History:
  13. 15-Aug-1991 JohnRo
  14. Implement downlevel NetWksta APIs.
  15. 20-Nov-1991 JohnRo
  16. Removed NT dependencies to reduce recompiles.
  17. --*/
  18. // These must be included first:
  19. #include <windef.h> // IN, DWORD, etc.
  20. #include <lmcons.h> // LM20_ equates, NET_API_STATUS, etc.
  21. #include <lmwksta.h> // WKSTA_INFO_100, etc. (Needed by dlwksta.h)
  22. #include <rap.h> // LPDESC, needed by <strucinf.h>.
  23. // These may be included in any order:
  24. #include <dlwksta.h> // WKSTA_INFO_0, MAX_WKSTA_ equates, etc.
  25. #include <lmerr.h> // ERROR_ and NERR_ equates.
  26. #include <netlib.h> // NetpSetOptionalArg().
  27. #include <netdebug.h> // NetpAssert().
  28. #include <remdef.h> // REM16_, REM32_, REMSmb_ equates.
  29. #include <strucinf.h> // My prototype.
  30. NET_API_STATUS
  31. NetpWkstaStructureInfo (
  32. IN DWORD Level,
  33. IN DWORD ParmNum, // Use PARMNUM_ALL if not applicable.
  34. IN BOOL Native, // Should sizes be native or RAP?
  35. OUT LPDESC * DataDesc16 OPTIONAL,
  36. OUT LPDESC * DataDesc32 OPTIONAL,
  37. OUT LPDESC * DataDescSmb OPTIONAL,
  38. OUT LPDWORD MaxSize OPTIONAL,
  39. OUT LPDWORD FixedSize OPTIONAL,
  40. OUT LPDWORD StringSize OPTIONAL
  41. )
  42. {
  43. DBG_UNREFERENCED_PARAMETER(ParmNum);
  44. NetpAssert( Native );
  45. //
  46. // Decide what to do based on the info level. Note that normally we'd
  47. // be using REM16_, REM32_, and REMSmb_ descriptors here. However,
  48. // the REM16_ and REM32_ ones have been modified to reflect a nonexistant
  49. // field (svX_platform_id). This messes up the automatic conversions
  50. // done by RxRemoteApi. So, we use "downlevel" descriptors (DL_REM_)
  51. // which are defined in DlWksta.h, or we use the REMSmb descriptors for
  52. // more things than they were intended.
  53. //
  54. switch (Level) {
  55. #define SetSizes(fixed,variable) \
  56. { \
  57. NetpSetOptionalArg( MaxSize, (fixed) + (variable) ); \
  58. NetpSetOptionalArg( FixedSize, (fixed) ); \
  59. NetpSetOptionalArg( StringSize, (variable) ); \
  60. }
  61. case 0 :
  62. NetpSetOptionalArg( DataDesc16, REMSmb_wksta_info_0 );
  63. NetpSetOptionalArg( DataDesc32, DL_REM_wksta_info_0 );
  64. NetpSetOptionalArg( DataDescSmb, REMSmb_wksta_info_0 );
  65. SetSizes( sizeof(WKSTA_INFO_0), MAX_WKSTA_0_STRING_SIZE );
  66. break;
  67. case 1 :
  68. NetpSetOptionalArg( DataDesc16, REMSmb_wksta_info_1 );
  69. NetpSetOptionalArg( DataDesc32, DL_REM_wksta_info_1 );
  70. NetpSetOptionalArg( DataDescSmb, REMSmb_wksta_info_1 );
  71. SetSizes( sizeof(WKSTA_INFO_1), MAX_WKSTA_1_STRING_SIZE );
  72. break;
  73. case 10 :
  74. NetpSetOptionalArg( DataDesc16, REMSmb_wksta_info_10 );
  75. NetpSetOptionalArg( DataDesc32, DL_REM_wksta_info_10 );
  76. NetpSetOptionalArg( DataDescSmb, REMSmb_wksta_info_10 );
  77. SetSizes( sizeof(WKSTA_INFO_10), MAX_WKSTA_10_STRING_SIZE );
  78. break;
  79. case 100 :
  80. NetpSetOptionalArg( DataDesc16, NULL );
  81. NetpSetOptionalArg( DataDesc32, REM32_wksta_info_100 );
  82. NetpSetOptionalArg( DataDescSmb, NULL );
  83. SetSizes( sizeof(WKSTA_INFO_100), MAX_WKSTA_100_STRING_SIZE );
  84. break;
  85. case 101 :
  86. NetpSetOptionalArg( DataDesc16, NULL );
  87. NetpSetOptionalArg( DataDesc32, REM32_wksta_info_101 );
  88. NetpSetOptionalArg( DataDescSmb, NULL );
  89. SetSizes( sizeof(WKSTA_INFO_101), MAX_WKSTA_101_STRING_SIZE );
  90. break;
  91. case 102 :
  92. NetpSetOptionalArg( DataDesc16, NULL );
  93. NetpSetOptionalArg( DataDesc32, REM32_wksta_info_102 );
  94. NetpSetOptionalArg( DataDescSmb, NULL );
  95. SetSizes( sizeof(WKSTA_INFO_102), MAX_WKSTA_102_STRING_SIZE );
  96. break;
  97. case 302 :
  98. NetpSetOptionalArg( DataDesc16, NULL );
  99. NetpSetOptionalArg( DataDesc32, REM32_wksta_info_302 );
  100. NetpSetOptionalArg( DataDescSmb, NULL );
  101. SetSizes( sizeof(WKSTA_INFO_302), MAX_WKSTA_302_STRING_SIZE );
  102. break;
  103. case 402 :
  104. NetpSetOptionalArg( DataDesc16, NULL );
  105. NetpSetOptionalArg( DataDesc32, REM32_wksta_info_402 );
  106. NetpSetOptionalArg( DataDescSmb, NULL );
  107. SetSizes( sizeof(WKSTA_INFO_402), MAX_WKSTA_402_STRING_SIZE );
  108. break;
  109. case 502 :
  110. NetpSetOptionalArg( DataDesc16, NULL );
  111. NetpSetOptionalArg( DataDesc32, REM32_wksta_info_502 );
  112. NetpSetOptionalArg( DataDescSmb, NULL );
  113. SetSizes( sizeof(WKSTA_INFO_502), MAX_WKSTA_502_STRING_SIZE );
  114. break;
  115. default :
  116. return (ERROR_INVALID_LEVEL);
  117. }
  118. return (NERR_Success);
  119. } // NetpWkstaStructureInfo