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.

123 lines
2.4 KiB

  1. //____________________________________________________________________________
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1994 - 1995.
  5. //
  6. // File: dllutil.cxx
  7. //
  8. // Contents: DLL related stuff
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 1/4/1996 RaviR Created
  15. //
  16. //____________________________________________________________________________
  17. #include "..\pch\headers.hxx"
  18. #pragma hdrstop
  19. #include <locale.h>
  20. #include "dbg.h"
  21. #include "macros.h"
  22. #include "common.hxx"
  23. //
  24. // Debug stuff
  25. //
  26. DECLARE_INFOLEVEL(Job);
  27. DECLARE_HEAPCHECKING;
  28. #if defined(DBX) && defined(_CHICAGO_)
  29. TCHAR emsg[300];
  30. #endif
  31. //
  32. // Clipboard formats
  33. //
  34. #define CFSTR_JOBIDLIST TEXT("Job IDList Array")
  35. #define CFSTR_PREFERREDDROPEFFECT TEXT("Preferred DropEffect")
  36. extern "C" UINT g_cfJobIDList = 0;
  37. extern "C" UINT g_cfShellIDList = 0;
  38. extern "C" UINT g_cfPreferredDropEffect = 0;
  39. #if (DBG == 1)
  40. extern BOOL fInfoLevelInit;
  41. #endif // (DBG == 1)
  42. BOOL
  43. JFOnProcessAttach(void)
  44. {
  45. //
  46. // Init debugging stuff.
  47. //
  48. #if DBG == 1
  49. {
  50. InitializeDebugging();
  51. JobInfoLevel = DEB_ERROR | DEB_WARN;
  52. #ifdef DBX
  53. JobInfoLevel |= DEB_USER1;
  54. #endif // DBX
  55. fInfoLevelInit = FALSE;
  56. CheckInit(JobInfoLevelString, &JobInfoLevel);
  57. //SetSmAssertLevel(ASSRT_BREAK | ASSRT_MESSAGE);
  58. SetSmAssertLevel(ASSRT_POPUP | ASSRT_MESSAGE);
  59. }
  60. #endif // DBG == 1
  61. TRACE_FUNCTION(JFOnProcessAttach);
  62. //
  63. // Get the clipboard formats used by the data object.
  64. //
  65. g_cfJobIDList = RegisterClipboardFormat(CFSTR_JOBIDLIST);
  66. g_cfShellIDList = RegisterClipboardFormat(CFSTR_SHELLIDLIST);
  67. g_cfPreferredDropEffect = RegisterClipboardFormat(
  68. CFSTR_PREFERREDDROPEFFECT);
  69. if (g_cfJobIDList == 0 ||
  70. g_cfPreferredDropEffect == 0)
  71. {
  72. DEBUG_OUT_LASTERROR;
  73. return FALSE;
  74. }
  75. //
  76. // Get common controls
  77. //
  78. InitCommonControls();
  79. INITCOMMONCONTROLSEX icce;
  80. icce.dwSize = sizeof(icce);
  81. icce.dwICC = ICC_DATE_CLASSES;
  82. InitCommonControlsEx(&icce);
  83. #if !defined(_CHICAGO_)
  84. //
  85. // Set the C runtime library locale, for string operations (not needed on
  86. // Chicago 'cause it isn't UNICODE nor does the statically linked subset
  87. // of the CRTs that we use include it).
  88. //
  89. setlocale(LC_CTYPE, "");
  90. #endif
  91. return TRUE;
  92. }