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.

56 lines
1.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1992.
  5. //
  6. // File: common.h
  7. //
  8. // Contents: headers shared by sources in common and in the servers and
  9. // clients.
  10. //
  11. // History: 04-Feb-94 Rickhi Created
  12. //
  13. //--------------------------------------------------------------------------
  14. #include <windows.h>
  15. #include <ole2.h>
  16. #ifdef THREADING_SUPPORT
  17. #include <olecairo.h> //
  18. #include <oleext.h> // OleInitializeEx, etc.
  19. #endif
  20. #include <srvmain.hxx> // COM Server entry points
  21. #ifdef WIN32
  22. #define olestrlen(x) wcslen(x)
  23. #define olestrcmp(x,y) wcscmp(x,y)
  24. #define olestrcpy(x,y) wcscpy(x,y)
  25. #define olestrcat(x,y) wcscat(x,y)
  26. #define olestrchr(x,y) wcsrchr(x,y)
  27. #else
  28. #define olestrlen(x) strlen(x)
  29. #define olestrcmp(x,y) strcmp(x,y)
  30. #define olestrcpy(x,y) strcpy(x,y)
  31. #define olestrcat(x,y) strcat(x,y)
  32. #define olestrchr(x,y) strchr(x,y)
  33. #endif
  34. #ifdef WIN32
  35. #ifdef UNICODE
  36. #define TEXT_TO_OLESTR(ole,wsz) wcscpy(ole,wsz)
  37. #define OLESTR_TO_TEXT(wsz,ole) wcscpy(wsz,ole)
  38. #else
  39. #define TEXT_TO_OLESTR(ole,str) mbstowcs(ole,str,strlen(str)+1)
  40. #define OLESTR_TO_TEXT(str,ole) wcstombs(str,ole,wcslen(ole)+1)
  41. #endif // UNICODE
  42. #else
  43. #ifdef UNICODE
  44. #define TEXT_TO_OLESTR(ole,wsz) wcstombs(ole,wsz,wcslen(wsz)+1)
  45. #define OLESTR_TO_TEXT(wsz,ole) mbstowcs(wsz,ole,strlen(ole)+1)
  46. #else
  47. #define TEXT_TO_OLESTR(ole,str) strcpy(ole,str)
  48. #define OLESTR_TO_TEXT(str,ole) strcpy(str,ole)
  49. #endif // UNICODE
  50. #endif // WIN32