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.

114 lines
3.0 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. ComptonsBible.cpp
  5. Abstract:
  6. This shim checks to see if Compton's Interactive Bible is calling DdeClientTransaction to create
  7. a program group in the Start Menu for America Online. If so, NULL is passed as pData to prevent
  8. the application from doing anything with the program group, i.e. CreateGroup or ShowGroup.
  9. Notes:
  10. This is an app specific shim.
  11. History:
  12. 12/14/2000 jdoherty Created
  13. --*/
  14. #include "precomp.h"
  15. #include <ParseDde.h>
  16. IMPLEMENT_SHIM_BEGIN(ComptonsBible)
  17. #include "ShimHookMacro.h"
  18. APIHOOK_ENUM_BEGIN
  19. APIHOOK_ENUM_ENTRY(DdeClientTransaction)
  20. APIHOOK_ENUM_END
  21. /*++
  22. Hook ShellExecuteA so we can check the return value.
  23. --*/
  24. HDDEDATA
  25. APIHOOK(DdeClientTransaction)(
  26. IN LPBYTE pData, // pointer to data to pass to server
  27. IN DWORD cbData, // length of data
  28. IN HCONV hConv, // handle to conversation
  29. IN HSZ hszItem, // handle to item name string
  30. IN UINT wFmt, // clipboard data format
  31. IN UINT wType, // transaction type
  32. IN DWORD dwTimeout, // time-out duration
  33. OUT LPDWORD pdwResult // pointer to transaction result
  34. )
  35. {
  36. //
  37. // Checking to see if pData contains America Online.
  38. //
  39. DPFN( eDbgLevelInfo, "[DdeClientTransaction] Checking pData parameter: %s, for calls including America Online.", pData);
  40. if (pData)
  41. {
  42. CSTRING_TRY
  43. {
  44. CString csData((LPSTR)pData);
  45. if (csData.Find(L"America Online") >= 0)
  46. {
  47. DPFN( eDbgLevelInfo, "[DdeClientTransaction] They are trying to create or show the "
  48. "America Online Group calling DdeClientTransaction with NULL pData.");
  49. //
  50. // The application is trying to create or show the America Online Group recalling API with
  51. // NULL as pData.
  52. //
  53. return ORIGINAL_API(DdeClientTransaction)(
  54. NULL,
  55. cbData,
  56. hConv,
  57. hszItem,
  58. wFmt,
  59. wType,
  60. dwTimeout,
  61. pdwResult
  62. );
  63. }
  64. }
  65. CSTRING_CATCH
  66. {
  67. // Do nothing
  68. }
  69. }
  70. return ORIGINAL_API(DdeClientTransaction)(
  71. pData,
  72. cbData,
  73. hConv,
  74. hszItem,
  75. wFmt,
  76. wType,
  77. dwTimeout,
  78. pdwResult
  79. );
  80. }
  81. /*++
  82. Register hooked functions
  83. --*/
  84. HOOK_BEGIN
  85. APIHOOK_ENTRY(USER32.DLL, DdeClientTransaction)
  86. HOOK_END
  87. IMPLEMENT_SHIM_END