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.

105 lines
2.8 KiB

  1. #ifndef _SHALIAS_H_
  2. #define _SHALIAS_H_
  3. // Editing modes
  4. #define ADD_ALIAS 0x01
  5. #define EDIT_ALIAS 0x02
  6. #define LocalRealloc(a, b) LocalReAlloc(a, b, LMEM_MOVEABLE)
  7. class CAlias;
  8. typedef struct tagALIASINFO
  9. {
  10. HWND hDlg;
  11. int mode;
  12. HDPA aliasList;
  13. HDPA aliasDelList;
  14. BOOL fInternalChange;
  15. BOOL fChanged;
  16. } ALIASINFO, * LPALIASINFO;
  17. #define ALIASLIST_COLUMNS 2
  18. typedef struct tagALIASITEM
  19. {
  20. LPSTR aCols[ALIASLIST_COLUMNS];
  21. } ALIASITEM;
  22. typedef struct tagALIASEDITINFO
  23. {
  24. HDPA aliasList;
  25. CAlias * alias;
  26. HWND hWnd;
  27. DWORD dwFlags;
  28. } ALIASEDITINFO, *LPALIASEDITINFO;
  29. #define ALIASINFO_FROM_HDLG( hDlg ) \
  30. ((LPALIASINFO)GetWindowLong(hDlg, DWL_USER)) \
  31. TCHAR * EatSpaces( TCHAR * str );
  32. TCHAR * ChopSpaces( TCHAR * str );
  33. TCHAR * DuplicateString( TCHAR * str );
  34. // CAlias - object representing one alias.
  35. class CAlias
  36. {
  37. public:
  38. LPTSTR m_alias;
  39. LPTSTR m_szurl;
  40. BOOL m_fDirty;
  41. CAlias( LPTSTR name );
  42. ~CAlias();
  43. // Operations defined for Asscociation
  44. Load();
  45. Save();
  46. Delete();
  47. #ifdef DEBUG
  48. Print();
  49. #endif
  50. };
  51. // Some Helper Function Prototypes
  52. BOOL FAR PASCAL InitAliasDialog(HWND hDlg, CAlias * current, BOOL fFullInit );
  53. CAlias * GetCurrentAlias( HWND hDlg );
  54. #define MAX_ALIAS_LENGTH 256
  55. STDAPI_(BOOL) LoadAliases( HDPA aliasListIn );
  56. STDAPI_(BOOL) SaveAliases( HDPA aliasListIn );
  57. STDAPI_(BOOL) FreeAliases( HDPA aliasListIn );
  58. STDAPI_(LPCTSTR) GetAliasName( CAlias * ptr );
  59. STDAPI_(LPCTSTR) GetAliasUrl( CAlias * ptr );
  60. STDAPI_(LPVOID) CreateAlias( LPTSTR str );
  61. STDAPI_(VOID) DestroyAlias( CAlias * ptr );
  62. STDAPI_(BOOL) SetAliasInfo( CAlias * ptr, TCHAR * alias, TCHAR * url );
  63. #ifdef UNICODE
  64. // TODO :
  65. #define FindAliasIndex FindAliasIndexW
  66. #define FindAliasByURL FindAliasByURLW
  67. #define AddAliasToList AddAliasToListW
  68. #define GetURLForAlias GetURLForAliasW
  69. #else
  70. #define FindAliasIndex FindAliasIndexA
  71. #define FindAliasByURL FindAliasByURLA
  72. #define AddAliasToList AddAliasToListA
  73. #define GetURLForAlias GetURLForAliasA
  74. #endif
  75. STDAPI_(BOOL) GetURLForAliasW(HDPA aliasListIn, LPWSTR alias, LPWSTR szurl, int cchUrl );
  76. STDAPI_(BOOL) AddAliasToListW(HDPA aliasListIn, LPWSTR alias, LPWSTR szurl, HWND hwnd);
  77. STDAPI_(BOOL) FindAliasByURLW(HDPA aliasListIn, LPWSTR szurl, LPWSTR alias, INT cchAlias);
  78. STDAPI_(INT) FindAliasIndexW(HDPA aliasListIn, LPWSTR alias);
  79. STDAPI_(BOOL) GetURLForAliasA(HDPA aliasListIn, LPSTR alias, LPSTR szurl, int cchUrl );
  80. STDAPI_(BOOL) AddAliasToListA(HDPA aliasListIn, LPSTR alias, LPSTR szurl, HWND hwnd);
  81. STDAPI_(BOOL) FindAliasByURLA(HDPA aliasListIn, LPSTR szurl, LPSTR alias, INT cchAlias);
  82. STDAPI_(INT) FindAliasIndexA(HDPA aliasListIn, LPSTR alias);
  83. #endif