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.

61 lines
2.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1995 - 1995.
  5. //
  6. // File: shares.h
  7. //
  8. // Contents: Definition of the shell IDLIST type for Shares
  9. //
  10. // History: 13-Dec-95 BruceFo Created
  11. //
  12. //----------------------------------------------------------------------------
  13. #ifndef __SHARES_H__
  14. #define __SHARES_H__
  15. struct IDSHARE
  16. {
  17. USHORT cb;
  18. BYTE bFlags;
  19. BYTE bReserved; // for alignment
  20. DWORD type; // shiX_type field
  21. DWORD maxUses; // only valid for SHID_SHARE_2
  22. USHORT oPath; // only valid for SHID_SHARE_2: cBuf[oPath] is start of path
  23. USHORT oComment; // cBuf[oComment] is start of comment
  24. TCHAR cBuf[MAX_PATH*3]; // cBuf[0] is the start of name
  25. };
  26. typedef IDSHARE* LPIDSHARE;
  27. #define SHID_SHARE_1 0x50 // Net share info level 1
  28. #define SHID_SHARE_2 0x51 // Net share info level 2
  29. #ifdef WIZARDS
  30. #define SHID_SHARE_ALL 0x5c // "all" shares wizard
  31. #define SHID_SHARE_NW 0x5d // NetWare shares wizard
  32. #define SHID_SHARE_MAC 0x5e // Mac shares wizard
  33. #define SHID_SHARE_NEW 0x5f // New Share wizard
  34. #endif // WIZARDS
  35. #define Share_GetFlags(pidl) (pidl->bFlags)
  36. #define Share_GetName(pidl) (pidl->cBuf)
  37. #define Share_GetComment(pidl) (&(pidl->cBuf[pidl->oComment]))
  38. #define Share_GetPath(pidl) (&(pidl->cBuf[pidl->oPath]))
  39. #define Share_GetType(pidl) (pidl->type)
  40. #define Share_GetMaxUses(pidl) (pidl->maxUses)
  41. #ifdef WIZARDS
  42. #define Share_IsAllWizard(pidl) (pidl->bFlags == SHID_SHARE_ALL)
  43. #define Share_IsNetWareWizard(pidl) (pidl->bFlags == SHID_SHARE_NW)
  44. #define Share_IsMacWizard(pidl) (pidl->bFlags == SHID_SHARE_MAC)
  45. #define Share_IsNewShareWizard(pidl) (pidl->bFlags == SHID_SHARE_NEW)
  46. #define Share_IsSpecial(pidl) (Share_IsNetWareWizard(pidl) || Share_IsMacWizard(pidl) || Share_IsNewShareWizard(pidl))
  47. #endif // WIZARDS
  48. #define Share_IsShare(pidl) (pidl->bFlags == SHID_SHARE_1 || pidl->bFlags == SHID_SHARE_2)
  49. #define Share_GetLevel(pidl) (appAssert(Share_IsShare(pidl)), pidl->bFlags - SHID_SHARE_1 + 1)
  50. #define Share_GetNameOffset(pidl) offsetof(IDSHARE, cBuf)
  51. #define Share_GetCommentOffset(pidl) (offsetof(IDSHARE, cBuf) + pidl->oComment * sizeof(TCHAR))
  52. #define Share_GetPathOffset(pidl) (offsetof(IDSHARE, cBuf) + pidl->oPath * sizeof(TCHAR))
  53. #endif // __SHARES_H__