Source code of Windows XP (NT5)
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.

133 lines
4.1 KiB

  1. /*+-------------------------------------------------------------------------+
  2. | Copyright 1993-1994 (C) Microsoft Corporation - All rights reserved. |
  3. +-------------------------------------------------------------------------+*/
  4. #ifndef _HNWNETAPI_
  5. #define _HNWNETAPI_
  6. #ifdef __cplusplus
  7. extern "C"{
  8. #endif
  9. #ifndef NTSTATUS
  10. typedef LONG NTSTATUS;
  11. #endif
  12. typedef struct _USER_RIGHTS_LIST {
  13. TCHAR Name[MAX_USER_NAME_LEN];
  14. DWORD Rights;
  15. } USER_RIGHTS_LIST;
  16. int NWGetMaxServerNameLen();
  17. int NWGetMaxUserNameLen();
  18. BOOL NWObjectNameGet( DWORD ObjectID, LPTSTR ObjectName );
  19. VOID NWUserInfoGet(LPTSTR szUserName, VOID **UInfo);
  20. VOID NWUserInfoLog(LPTSTR szUserName, VOID *UInfo);
  21. DWORD NWServerSet(LPTSTR FileServer);
  22. DWORD NWServerFree();
  23. DWORD NWUsersEnum(USER_LIST **lpUsers, BOOL Display);
  24. DWORD NWGroupsEnum(GROUP_LIST **lpGroups, BOOL Display);
  25. DWORD NWGroupUsersEnum(LPTSTR GroupName, USER_LIST **lpUsers);
  26. DWORD NWUserEquivalenceEnum(LPTSTR UserName, USER_LIST **lpUsers);
  27. DWORD NWServerEnum(LPTSTR Container, SERVER_BROWSE_LIST **lpServList);
  28. DWORD NWSharesEnum(SHARE_LIST **lpShares);
  29. VOID NWUserDefaultsGet(VOID **UDefaults);
  30. VOID NWUserDefaultsMap(VOID *NWUDefaults, NT_DEFAULTS *NTDefaults);
  31. VOID NWUserDefaultsLog(VOID *UDefaults);
  32. VOID NWNetUserMapInfo (LPTSTR szUserName, VOID *UInfo, NT_USER_INFO *NT_UInfo );
  33. VOID NWFPNWMapInfo(VOID *NWUInfo, PFPNW_INFO fpnw);
  34. VOID NWUseDel(LPTSTR ServerName);
  35. BOOL NWIsAdmin(LPTSTR UserName);
  36. VOID NWServerInfoReset(SOURCE_SERVER_BUFFER *SServ);
  37. VOID NWServerInfoSet(LPTSTR ServerName, SOURCE_SERVER_BUFFER *SServ);
  38. BOOL NWServerValidate(HWND hWnd, LPTSTR ServerName, BOOL DupFlag);
  39. DWORD NWFileRightsEnum(LPTSTR FileName, USER_RIGHTS_LIST **lpUsers, DWORD *UserCount, BOOL DownLevel);
  40. LPTSTR NWRightsLog(DWORD Rights);
  41. LPTSTR NWSpecialNamesMap(LPTSTR Name);
  42. VOID NWServerTimeGet();
  43. typedef struct _NW_TO_NT_MAPPING {
  44. ULONG NWRight ;
  45. ULONG NTAccess ;
  46. } NW_TO_NT_MAPPING, *PNW_TO_NT_MAPPING ;
  47. //
  48. // structure used to define how the Rights for a Netware object maps
  49. // to the corresponding NT AccessMasks.
  50. //
  51. // first entry is the AceFlags to distinguish between ACE for the Object
  52. // and ACE for inheritted objects
  53. //
  54. // the GENERIC_MAPPING structure should match that already defined for
  55. // the NT object in question.
  56. //
  57. // the array of NW mappings defines the NT Access Mask for each NW Right
  58. // the object uses. the last entry should be {0, 0}.
  59. //
  60. // for example, file object mappings:
  61. //
  62. // RIGHTS_MAPPING FileRightsMapping =
  63. // {
  64. // 0,
  65. // { FILE_GENERIC_READ,
  66. // FILE_GENERIC_WRITE,
  67. // FILE_GENERIC_EXECUTE,
  68. // FILE_ALL_ACCESS
  69. // },
  70. // { { NW_FILE_READ, GENERIC_READ }
  71. // { NW_FILE_WRITE, GENERIC_WRITE }
  72. // { NW_FILE_CREATE, 0 }
  73. // { NW_FILE_DELETE, GENERIC_WRITE }
  74. // { NW_FILE_PERM, WRITE_DAC }
  75. // { NW_FILE_SCAN, 0 }
  76. // { NW_FILE_MODIFY, GENERIC_WRITE }
  77. // { NW_FILE_SUPERVISOR, GENERIC_ALL }
  78. // { 0, 0 }
  79. // }
  80. // } ;
  81. //
  82. //
  83. typedef struct _RIGHTS_MAPPING {
  84. ULONG NtAceFlags ;
  85. GENERIC_MAPPING GenericMapping ;
  86. NW_TO_NT_MAPPING Nw2NtMapping[] ;
  87. } RIGHTS_MAPPING, *PRIGHTS_MAPPING ;
  88. // predefined mappings (defined in nwnetapi.c)
  89. extern RIGHTS_MAPPING FileRightsMapping ;
  90. extern RIGHTS_MAPPING DirRightsMapping ;
  91. extern RIGHTS_MAPPING PrintRightsMapping ;
  92. extern RIGHTS_MAPPING JobRightsMapping ;
  93. // define the NW_FILE_* rights
  94. #define NW_FILE_READ 0x0001
  95. #define NW_FILE_WRITE 0x0002
  96. #define NW_FILE_CREATE 0x0008
  97. #define NW_FILE_DELETE 0x0010
  98. #define NW_FILE_PERM 0x0020
  99. #define NW_FILE_SCAN 0x0040
  100. #define NW_FILE_MODIFY 0x0080
  101. #define NW_FILE_SUPERVISOR 0x0100
  102. #define NW_PRINT_USER 0x0001
  103. #define NW_PRINT_ADMIN 0x0002
  104. #define NW_PRINTJOB_ADMIN 0x0004
  105. NTSTATUS MapNwRightsToNTAccess( ULONG NWRights, PRIGHTS_MAPPING pMap, ACCESS_MASK *pAccessMask ) ;
  106. DWORD NWPrintOpsEnum(USER_LIST **lpUsers);
  107. #ifdef __cplusplus
  108. }
  109. #endif
  110. #endif