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.

151 lines
4.5 KiB

  1. #ifndef _MIGUTIL_H_
  2. #define _MIGUTIL_H_
  3. #define MAX_LOADSTRING 1024
  4. #define IID_PPV_ARG(IType, ppType) IID_##IType, reinterpret_cast<void**>(static_cast<IType**>(ppType))
  5. LPWSTR _ConvertToUnicode(UINT cp, LPCSTR pcszSource);
  6. LPSTR _ConvertToAnsi(UINT cp, LPCWSTR pcwszSource);
  7. HRESULT _SHAnsiToUnicode(LPSTR pszIn, LPWSTR pwszOut, UINT cchOut);
  8. HRESULT _SHUnicodeToAnsi(LPWSTR pwszIn, LPSTR pszOut, UINT cchOut);
  9. INT_PTR _ExclusiveDialogBox(HINSTANCE hInstance, LPCTSTR lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc);
  10. int _ExclusiveMessageBox(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType);
  11. int _ComboBoxEx_AddString(HWND hwndBox, LPTSTR ptsz);
  12. int _ComboBoxEx_SetIconW(HWND hwndBox, LPWSTR wsz, UINT iDex);
  13. HRESULT _ListView_AddDrives(HWND hwndList, LPTSTR pszNetworkName);
  14. int _GetRemovableDriveCount();
  15. TCHAR _GetRemovableDrive(int iDex);
  16. LPTSTR _GetRemovableDrivePretty(int iDex);
  17. BOOL _IsRemovableOrCDDrive(TCHAR chDrive);
  18. BOOL _IsValidStore(LPTSTR pszStore, BOOL bCreate, HINSTANCE hinst, HWND hwnd);
  19. INT _ComboBoxEx_AddDrives(HWND hwndBox);
  20. INT _ComboBoxEx_AddCOMPorts(HWND hwndBox, INT SelectedPort);
  21. HRESULT _CreateAnimationCtrl(HWND hwndDlg, HINSTANCE hinst, UINT idMarker, UINT idAnim, UINT idAvi, HWND* pHwndAnim);
  22. #define POPULATETREE_FLAGS_FOLDERS 0x1
  23. #define POPULATETREE_FLAGS_FILES 0x2
  24. #define POPULATETREE_FLAGS_FILETYPES 0x3
  25. #define POPULATETREE_FLAGS_SETTINGS 0x4
  26. VOID _PopulateTree (HWND hwndTree, HTREEITEM hti, LPTSTR ptsz, UINT cch,
  27. HRESULT (*fct)(HINSTANCE, BOOL, LPCTSTR, LPTSTR, UINT cchName),
  28. DWORD dwFlags, HINSTANCE Instance, BOOL fNT4);
  29. UINT _ListView_InsertItem(HWND hwndList, LPTSTR ptsz);
  30. HRESULT _GetPrettyFolderName(HINSTANCE Instance, BOOL fNT4, LPCTSTR pctszPath, LPTSTR ptszName, UINT cchName);
  31. HRESULT _GetPrettyTypeName(LPCTSTR pctszType, LPTSTR ptszPrettyType, UINT cchPrettyType);
  32. HANDLE _GetDeviceHandle(LPCTSTR psz, DWORD dwDesiredAccess, DWORD dwFileAttributes);
  33. INT _GetFloppyNumber(BOOL fIsNT);
  34. INT _DriveStrIsFloppy(BOOL fIsNT, PCTSTR psz);
  35. typedef struct {
  36. LPTSTR pszPureName;
  37. BOOL fOverwrite;
  38. } LV_DATASTRUCT;
  39. BOOL _SetTextLoadString(HINSTANCE hInst, HWND hwnd, UINT idText);
  40. VOID DisableCancel (VOID);
  41. VOID EnableCancel (VOID);
  42. VOID PostMessageForWizard (UINT Msg, WPARAM wParam, LPARAM lParam);
  43. VOID _UpdateText (HWND hWnd, LPCTSTR pszString);
  44. BOOL
  45. AppExecute (
  46. IN HINSTANCE Instance,
  47. IN HWND hwndDlg,
  48. IN PCTSTR ExecuteArgs
  49. );
  50. VOID
  51. RestartExplorer (
  52. IN HINSTANCE Instance,
  53. IN HWND hwndDlg,
  54. IN PCTSTR Args
  55. );
  56. typedef struct {
  57. PCTSTR UserName;
  58. PCTSTR UserDomain;
  59. } ROLLBACK_USER_ERROR, *PROLLBACK_USER_ERROR;
  60. PTSTR
  61. GetShellFolderPath (
  62. IN INT Folder,
  63. IN PCTSTR FolderStr,
  64. IN BOOL UserFolder,
  65. OUT LPITEMIDLIST *pidl //OPTIONAL
  66. );
  67. #define IPFL_USECALLBACK 0x0001
  68. #define IPFL_USEDEFAULTS 0x0002
  69. typedef HRESULT (CALLBACK *SHINVOKECALLBACK)(IDispatch *pdisp, struct SHINVOKEPARAMS *pinv);
  70. #include <pshpack1.h>
  71. typedef struct SHINVOKEPARAMS {
  72. UINT flags; // mandatory
  73. DISPID dispidMember; // mandatory
  74. const IID*piid; // IPFL_USEDEFAULTS will fill this in
  75. LCID lcid; // IPFL_USEDEFAULTS will fill this in
  76. WORD wFlags; // IPFL_USEDEFAULTS will fill this in
  77. DISPPARAMS * pdispparams; // mandatory, may be NULL
  78. VARIANT * pvarResult; // IPFL_USEDEFAULTS will fill this in
  79. EXCEPINFO * pexcepinfo; // IPFL_USEDEFAULTS will fill this in
  80. UINT * puArgErr; // IPFL_USEDEFAULTS will fill this in
  81. SHINVOKECALLBACK Callback; // required if IPFL_USECALLBACK
  82. } SHINVOKEPARAMS, *LPSHINVOKEPARAMS;
  83. #include <poppack.h> /* Return to byte packing */
  84. HRESULT IUnknown_CPContainerInvokeIndirect(IUnknown *punk, REFIID riidCP,
  85. SHINVOKEPARAMS *pinv);
  86. VOID
  87. _RemoveSpaces (
  88. IN PTSTR szData,
  89. IN UINT uDataCount
  90. );
  91. HRESULT
  92. OurSHBindToParent (
  93. IN LPCITEMIDLIST pidl,
  94. IN REFIID riid,
  95. OUT VOID **ppv,
  96. OUT LPCITEMIDLIST *ppidlLast
  97. );
  98. typedef struct _TAG_OBJLIST {
  99. PTSTR ObjectName;
  100. PTSTR AlternateName;
  101. struct _TAG_OBJLIST *Next;
  102. } OBJLIST, *POBJLIST;
  103. POBJLIST
  104. _AllocateObjectList (
  105. IN PCTSTR ObjectName
  106. );
  107. VOID
  108. _FreeObjectList (
  109. IN POBJLIST ObjectList
  110. );
  111. #endif