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.

103 lines
2.7 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. Utils.h
  5. Abstract:
  6. Provides utility functions for the entire poject
  7. Author:
  8. Eran Yariv (EranY) Dec, 1999
  9. Revision History:
  10. --*/
  11. #if !defined(AFX_UTILS_H__6E33CFA1_C99A_4691_9F91_00451692D3DB__INCLUDED_)
  12. #define AFX_UTILS_H__6E33CFA1_C99A_4691_9F91_00451692D3DB__INCLUDED_
  13. #if _MSC_VER > 1000
  14. #pragma once
  15. #endif // _MSC_VER > 1000
  16. DWORD
  17. LoadResourceString (
  18. CString &cstr,
  19. int ResId
  20. );
  21. #define SAFE_DELETE(x) if (NULL != (x)) { delete (x); (x) = NULL; }
  22. #define SAFE_DELETE_ARRAY(x) if (NULL != (x)) { delete [](x); (x) = NULL; }
  23. CString DWORDLONG2String (DWORDLONG dwlData);
  24. CString DWORD2String (DWORD dwData);
  25. DWORD Win32Error2String(DWORD dwWin32Err, CString& strError);
  26. DWORD LoadDIBImageList (CImageList &,
  27. int iResourceId,
  28. DWORD dwImageWidth,
  29. COLORREF crMask);
  30. DWORD WaitForThreadDeathOrShutdown (HANDLE hThread);
  31. DWORD
  32. GetUniqueFileName (LPCTSTR lpctstrExt, CString &cstrResult);
  33. DWORD CopyTiffFromServer (CServerNode *pServer,
  34. DWORDLONG dwlMsgId,
  35. FAX_ENUM_MESSAGE_FOLDER Folder,
  36. CString &cstrTiff);
  37. DWORD GetDllVersion (LPCTSTR lpszDllName);
  38. DWORD ReadRegistryString (LPCTSTR lpszSection, LPCTSTR lpszKey, CString& cstrValue);
  39. DWORD WriteRegistryString(LPCTSTR lpszSection, LPCTSTR lpszKey, CString& cstrValue);
  40. DWORD FaxSizeFormat(DWORDLONG dwlSize, CString& cstrValue);
  41. DWORD GetAppLoadPath(CString& cstrLoadPath);
  42. DWORD HtmlHelpTopic(HWND hWnd, TCHAR* tszHelpTopic);
  43. #define PACKVERSION(major,minor) MAKELONG(minor,major)
  44. struct FaxTempFile
  45. {
  46. //
  47. // hWaitHandles[0] handle of application that uses a temp file
  48. // hWaitHandles[1] handle of shutdown event
  49. //
  50. HANDLE hWaitHandles[2];
  51. TCHAR tszFileName[MAX_PATH];
  52. TCHAR tszOldDefaultPrinter[MAX_PATH];
  53. };
  54. DWORD WINAPI DeleteTmpFileThrdProc(LPVOID lpFileStruct);
  55. DWORD GetPrintersInfo(PRINTER_INFO_2*& pPrinterInfo2, DWORD& dwNumPrinters);
  56. UINT_PTR CALLBACK OFNHookProc(HWND, UINT, WPARAM, LPARAM);
  57. int AlignedAfxMessageBox( LPCTSTR lpszText, UINT nType = MB_OK, UINT nIDHelp = 0 );
  58. int AlignedAfxMessageBox( UINT nIDPrompt, UINT nType = MB_OK, UINT nIDHelp = (UINT) -1 );
  59. HINSTANCE GetResourceHandle();
  60. //
  61. // Import.cpp
  62. //
  63. #ifdef UNICODE
  64. DWORD ImportArchiveFolderUI(LPCWSTR cstrImportFolder, BOOL bSentItems, HWND hWnd);
  65. DWORD DetectImportFiles();
  66. #endif // UNICODE
  67. #endif // !defined(AFX_UTILS_H__6E33CFA1_C99A_4691_9F91_00451692D3DB__INCLUDED_)