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.

69 lines
3.2 KiB

  1. #include "lm.h"
  2. #pragma pack(1)
  3. typedef struct _IDNETRESOURCE // idn
  4. {
  5. WORD cb;
  6. BYTE bFlags; // Display type in low nibble
  7. BYTE uType;
  8. BYTE uUsage; // Usage in low nibble, More Flags in high nibble
  9. CHAR szNetResName[1];
  10. // char szProvider[*] - If NET_HASPROVIDER bit is set
  11. // char szComment[*] - If NET_HASCOMMENT bit is set.
  12. // WCHAR szNetResNameWide[*] - If NET_UNICODE bit it set.
  13. // WCHAR szProviderWide[*] - If NET_UNICODE and NET_HASPROVIDER
  14. // WCHAR szCommentWide[*] - If NET_UNICODE and NET_HASCOMMENT
  15. } IDNETRESOURCE, *LPIDNETRESOURCE;
  16. typedef const IDNETRESOURCE *LPCIDNETRESOURCE;
  17. #pragma pack()
  18. //===========================================================================
  19. // CNetwork: Some private macro - but probably needed in .cpp file.
  20. //===========================================================================
  21. #define NET_DISPLAYNAMEOFFSET ((UINT)((LPIDNETRESOURCE)0)->szNetResName)
  22. #define NET_GetFlags(pidnRel) ((pidnRel)->bFlags)
  23. #define NET_GetDisplayType(pidnRel) ((pidnRel)->bFlags & 0x0f)
  24. #define NET_GetType(pidnRel) ((pidnRel)->uType)
  25. #define NET_GetUsage(pidnRel) ((pidnRel)->uUsage & 0x0f)
  26. #define NET_IsReg(pidnRel) ((pidnRel)->bFlags == SHID_NET_REGITEM)
  27. #define NET_IsJunction(pidnRel) ((pidnRel)->bFlags & SHID_JUNCTION)
  28. #define NET_IsRootReg(pidnRel) ((pidnRel)->bFlags == SHID_NET_ROOTREGITEM)
  29. #define NET_IsFake(pidnRel) ((pidnRel)->szNetResName[0] == '\0')
  30. // Define some Flags that are on high nibble of uUsage byte
  31. #define NET_HASPROVIDER 0x80 // Has own copy of provider
  32. #define NET_HASCOMMENT 0x40 // Has comment field in pidl
  33. #define NET_REMOTEFLD 0x20 // Is remote folder
  34. #define NET_UNICODE 0x10 // Has unicode names
  35. #define NET_FHasComment(pidnRel) ((pidnRel)->uUsage & NET_HASCOMMENT)
  36. #define NET_FHasProvider(pidnRel) ((pidnRel)->uUsage & NET_HASPROVIDER)
  37. #define NET_IsRemoteFld(pidnRel) ((pidnRel)->uUsage & NET_REMOTEFLD)
  38. #define NET_IsUnicode(pidnRel) ((pidnRel)->uUsage & NET_UNICODE)
  39. STDAPI_(BOOL) NET_IsRemoteRegItem(LPCITEMIDLIST pidl, REFCLSID rclsid, LPCITEMIDLIST* ppidlRemainder);
  40. // These are exported form netviewx.c they are wrappers around the same WNet
  41. // APIs, but play with the parameters to make it easier to call. They accept
  42. // full paths rather than just drive letters.
  43. STDAPI_(DWORD) SHWNetDisconnectDialog1 (LPDISCDLGSTRUCT lpConnDlgStruct);
  44. STDAPI_(DWORD) SHWNetGetConnection (LPCTSTR lpLocalName, LPTSTR lpRemoteName, LPDWORD lpnLength);
  45. STDAPI SHGetDomainWorkgroupIDList(LPITEMIDLIST *ppidl);
  46. STDAPI_(void) SHCacheComputerDescription(LPCTSTR pszMachineName, LPCTSTR pszDescription);
  47. typedef struct
  48. {
  49. LPCTSTR lpName;
  50. WORD wNetType;
  51. } NETPROVIDERS;
  52. EXTERN_C const NETPROVIDERS c_rgProviderMap[];
  53. EXTERN_C const int c_cProviders;
  54. STDAPI_(LPTSTR) NET_CopyResName(LPCIDNETRESOURCE pidn, LPTSTR pszBuff, UINT cchBuff);
  55. STDAPI_(LPTSTR) NET_CopyComment(LPCIDNETRESOURCE pidn, LPTSTR pszBuff, UINT cchBuff);
  56. STDAPI_(LPTSTR) NET_CopyProviderName(LPCIDNETRESOURCE pidn, LPTSTR pszBuff, UINT cchBuff);
  57. // netcrawl.cpp
  58. STDAPI_(void) RefreshNetCrawler();