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.

104 lines
4.9 KiB

  1. #ifndef _WINNETWK_
  2. #include <winnetwk.h>
  3. #endif // _WINNETWK_
  4. #define SHID_JUNCTION 0x80
  5. #define SHID_GROUPMASK 0x70
  6. #define SHID_TYPEMASK 0x7f
  7. #define SHID_INGROUPMASK 0x0f
  8. #define SHID_ROOT 0x10
  9. #define SHID_ROOT_REGITEM 0x1f // Mail
  10. #if ((DRIVE_REMOVABLE|DRIVE_FIXED|DRIVE_REMOTE|DRIVE_CDROM|DRIVE_RAMDISK) != 0x07)
  11. #error Definitions of DRIVE_* are changed!
  12. #endif
  13. #define SHID_COMPUTER 0x20
  14. #define SHID_COMPUTER_1 0x21 // free
  15. #define SHID_COMPUTER_REMOVABLE (0x20 | DRIVE_REMOVABLE) // 2
  16. #define SHID_COMPUTER_FIXED (0x20 | DRIVE_FIXED) // 3
  17. #define SHID_COMPUTER_REMOTE (0x20 | DRIVE_REMOTE) // 4
  18. #define SHID_COMPUTER_CDROM (0x20 | DRIVE_CDROM) // 5
  19. #define SHID_COMPUTER_RAMDISK (0x20 | DRIVE_RAMDISK) // 6
  20. #define SHID_COMPUTER_7 0x27 // free
  21. #define SHID_COMPUTER_DRIVE525 0x28 // 5.25 inch floppy disk drive
  22. #define SHID_COMPUTER_DRIVE35 0x29 // 3.5 inch floppy disk drive
  23. #define SHID_COMPUTER_NETDRIVE 0x2a // Network drive
  24. #define SHID_COMPUTER_NETUNAVAIL 0x2b // Network drive that is not restored.
  25. #define SHID_COMPUTER_C 0x2c // free
  26. #define SHID_COMPUTER_D 0x2d // free
  27. #define SHID_COMPUTER_REGITEM 0x2e // Controls, Printers, ...
  28. #define SHID_COMPUTER_MISC 0x2f // Unknown drive type
  29. #define SHID_FS 0x30
  30. #define SHID_FS_TYPEMASK 0x3F
  31. #define SHID_FS_DIRECTORY 0x31 // CHICAGO
  32. #define SHID_FS_FILE 0x32 // FOO.TXT
  33. #define SHID_FS_UNICODE 0x34 // Is it unicode? (this is a bitmask)
  34. #define SHID_FS_DIRUNICODE 0x35 // Folder with a unicode name
  35. #define SHID_FS_FILEUNICODE 0x36 // File with a unicode name
  36. #define SHID_NET 0x40
  37. #define SHID_NET_DOMAIN (SHID_NET | RESOURCEDISPLAYTYPE_DOMAIN)
  38. #define SHID_NET_SERVER (SHID_NET | RESOURCEDISPLAYTYPE_SERVER)
  39. #define SHID_NET_SHARE (SHID_NET | RESOURCEDISPLAYTYPE_SHARE)
  40. #define SHID_NET_FILE (SHID_NET | RESOURCEDISPLAYTYPE_FILE)
  41. #define SHID_NET_GROUP (SHID_NET | RESOURCEDISPLAYTYPE_GROUP)
  42. #define SHID_NET_NETWORK (SHID_NET | RESOURCEDISPLAYTYPE_NETWORK)
  43. #define SHID_NET_RESTOFNET (SHID_NET | RESOURCEDISPLAYTYPE_ROOT)
  44. #define SHID_NET_SHAREADMIN (SHID_NET | RESOURCEDISPLAYTYPE_SHAREADMIN)
  45. #define SHID_NET_DIRECTORY (SHID_NET | RESOURCEDISPLAYTYPE_DIRECTORY)
  46. #define SHID_NET_TREE (SHID_NET | RESOURCEDISPLAYTYPE_TREE)
  47. #define SHID_NET_REGITEM 0x4e // Remote Computer items
  48. #define SHID_NET_PRINTER 0x4f // \\PYREX\LASER1
  49. #define SIL_GetType(pidl) (ILIsEmpty(pidl) ? 0 : (pidl)->mkid.abID[0])
  50. #define FS_IsValidID(pidl) ((SIL_GetType(pidl) & SHID_GROUPMASK) == SHID_FS)
  51. #define NET_IsValidID(pidl) ((SIL_GetType(pidl) & SHID_GROUPMASK) == SHID_NET)
  52. typedef struct _ICONMAP // icmp
  53. {
  54. UINT uType; // SHID_ type
  55. UINT indexResource; // Resource index (of SHELL232.DLL)
  56. } ICONMAP, FAR* LPICONMAP;
  57. UINT SILGetIconIndex(LPCITEMIDLIST pidl, const ICONMAP aicmp[], UINT cmax);
  58. #pragma pack(1)
  59. typedef struct _IDNETRESOURCE // idn
  60. {
  61. WORD cb;
  62. BYTE bFlags; // Display type in low nibble
  63. BYTE uType;
  64. BYTE uUsage; // Usage in low nibble, More Flags in high nibble
  65. CHAR szNetResName[1];
  66. // char szProvider[*] - If NET_HASPROVIDER bit is set
  67. // char szComment[*] - If NET_HASCOMMENT bit is set.
  68. // WCHAR szNetResNameWide[*] - If NET_UNICODE bit it set.
  69. // WCHAR szProviderWide[*] - If NET_UNICODE and NET_HASPROVIDER
  70. // WCHAR szCommentWide[*] - If NET_UNICODE and NET_HASCOMMENT
  71. } IDNETRESOURCE, *LPIDNETRESOURCE;
  72. typedef const IDNETRESOURCE *LPCIDNETRESOURCE;
  73. #pragma pack()
  74. //===========================================================================
  75. // CNetwork: Some private macro
  76. //===========================================================================
  77. #define NET_DISPLAYNAMEOFFSET ((UINT)((LPIDNETRESOURCE)0)->szNetResName)
  78. #define NET_GetFlags(pidnRel) ((pidnRel)->bFlags)
  79. #define NET_GetDisplayType(pidnRel) ((pidnRel)->bFlags & 0x0f)
  80. #define NET_GetType(pidnRel) ((pidnRel)->uType)
  81. #define NET_GetUsage(pidnRel) ((pidnRel)->uUsage & 0x0f)
  82. // Define some Flags that are on high nibble of uUsage byte
  83. #define NET_HASPROVIDER 0x80 // Has own copy of provider
  84. #define NET_HASCOMMENT 0x40 // Has comment field in pidl
  85. #define NET_REMOTEFLD 0x20 // Is remote folder
  86. #define NET_UNICODE 0x10 // Has unicode names
  87. #define NET_FHasComment(pidnRel) ((pidnRel)->uUsage & NET_HASCOMMENT)
  88. #define NET_FHasProvider(pidnRel) ((pidnRel)->uUsage & NET_HASPROVIDER)
  89. #define NET_IsRemoteFld(pidnRel) ((pidnRel)->uUsage & NET_REMOTEFLD)
  90. #define NET_IsUnicode(pidnRel) ((pidnRel)->uUsage & NET_UNICODE)