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.

126 lines
3.6 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: S H U T I L . H
  7. //
  8. // Contents: Various shell utilities to be used by the connections folder
  9. //
  10. // Notes:
  11. //
  12. // Author: jeffspr 21 Oct 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #ifndef _SHUTIL_H_
  17. #define _SHUTIL_H_
  18. #include <ndispnp.h>
  19. #include <ntddndis.h>
  20. #include <ncshell.h>
  21. HRESULT HrDupeShellStringLength(
  22. IN PCWSTR pszInput,
  23. IN ULONG cchInput,
  24. OUT PWSTR * ppszOutput);
  25. inline
  26. HRESULT HrDupeShellString(
  27. IN PCWSTR pszInput,
  28. OUT PWSTR * ppszOutput)
  29. {
  30. return HrDupeShellStringLength(pszInput, wcslen(pszInput), ppszOutput);
  31. }
  32. HRESULT HrGetConnectionPidlWithRefresh(IN const GUID& guidId,
  33. OUT PCONFOLDPIDL& ppidlCon);
  34. //---[ Various refresh functions ]--------------------------------------------
  35. // Notify the shell that an object is going away, and remove it from our list
  36. //
  37. HRESULT HrDeleteFromCclAndNotifyShell(
  38. IN const PCONFOLDPIDLFOLDER& pidlFolder,
  39. IN const PCONFOLDPIDL& pidlConnection,
  40. IN const CONFOLDENTRY& ccfe);
  41. VOID ForceRefresh(IN HWND hwnd) throw();
  42. // Update the folder, but don't flush the items. Update them as needed.
  43. // pidlFolder is optional -- if not passed in, we'll generate it.
  44. //
  45. HRESULT HrForceRefreshNoFlush(IN const PCONFOLDPIDLFOLDER& pidlFolder);
  46. // Update the connection data based on the pidl. Notify the shell as
  47. // appropriate
  48. //
  49. HRESULT HrOnNotifyUpdateConnection(
  50. IN const PCONFOLDPIDLFOLDER& pidlFolder,
  51. IN const GUID * pguid,
  52. IN NETCON_MEDIATYPE ncm,
  53. IN NETCON_SUBMEDIATYPE ncsm,
  54. IN NETCON_STATUS ncs,
  55. IN DWORD dwCharacteristics,
  56. IN PCWSTR pszwName,
  57. IN PCWSTR pszwDeviceName,
  58. IN PCWSTR pszwPhoneNumberOrHostAddress);
  59. // Update the connection status, including sending the correct shell
  60. // notifications for icon updates and such.
  61. //
  62. HRESULT HrOnNotifyUpdateStatus(
  63. IN const PCONFOLDPIDLFOLDER& pidlFolder,
  64. IN const PCONFOLDPIDL& pidlCached,
  65. IN NETCON_STATUS ncsNew);
  66. // update the shell/connection list with the new connection status
  67. //
  68. HRESULT HrUpdateConnectionStatus(
  69. IN const PCONFOLDPIDL& pcfp,
  70. IN NETCON_STATUS ncs,
  71. IN const PCONFOLDPIDLFOLDER& pidlFolder,
  72. IN BOOL fUseCharacter,
  73. IN DWORD dwCharacter);
  74. //---[ Menu merging functions ]-----------------------------------------------
  75. VOID MergeMenu(
  76. IN HINSTANCE hinst,
  77. IN UINT idMainMerge,
  78. IN UINT idPopupMerge,
  79. IN OUT LPQCMINFO pqcm);
  80. INT IMergePopupMenus(
  81. IN OUT HMENU hmMain,
  82. IN HMENU hmMerge,
  83. IN int idCmdFirst,
  84. IN int idCmdLast);
  85. HRESULT HrGetMenuFromID(
  86. IN HMENU hmenuMain,
  87. IN UINT uID,
  88. OUT HMENU * phmenu);
  89. HRESULT HrLoadPopupMenu(
  90. IN HINSTANCE hinst,
  91. IN UINT id,
  92. OUT HMENU * phmenu);
  93. HRESULT HrShellView_GetSelectedObjects(
  94. IN HWND hwnd,
  95. OUT PCONFOLDPIDLVEC& apidlSelection);
  96. HRESULT HrRenameConnectionInternal(
  97. IN const PCONFOLDPIDL& pidlCon,
  98. IN const PCONFOLDPIDLFOLDER& pidlFolder,
  99. IN LPCWSTR pszNewName,
  100. IN BOOL fRaiseError,
  101. IN HWND hwndOwner,
  102. OUT PCONFOLDPIDL& ppidlOut);
  103. #endif // _SHUTIL_H_