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.

104 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. DisableThemes.cpp
  5. Abstract:
  6. This shim is for apps that don't support themes.
  7. Notes:
  8. This is a general purpose shim.
  9. History:
  10. 01/15/2001 clupu Created
  11. --*/
  12. #include "precomp.h"
  13. #include <stdio.h>
  14. IMPLEMENT_SHIM_BEGIN(FeedbackReport)
  15. #include "ShimHookMacro.h"
  16. APIHOOK_ENUM_BEGIN
  17. APIHOOK_ENUM_END
  18. void
  19. LaunchFeedbackUI(
  20. void
  21. )
  22. {
  23. CSTRING_TRY
  24. {
  25. STARTUPINFOW si;
  26. PROCESS_INFORMATION pi;
  27. CString csCmdLine;
  28. CString csExeName;
  29. ZeroMemory(&si, sizeof(si));
  30. ZeroMemory(&pi, sizeof(pi));
  31. si.cb = sizeof(si);
  32. csExeName.GetModuleFileNameW(NULL);
  33. csCmdLine.Format(L"ahui.exe feedback \"%s\"", csExeName);
  34. if (CreateProcessW(NULL,
  35. (LPWSTR)csCmdLine.Get(),
  36. NULL,
  37. NULL,
  38. FALSE,
  39. 0,
  40. NULL,
  41. NULL,
  42. &si,
  43. &pi))
  44. {
  45. CloseHandle(pi.hProcess);
  46. CloseHandle(pi.hThread);
  47. }
  48. else
  49. {
  50. DPFN( eDbgLevelError, "CreateProcess failed.GetLastError = %d", GetLastError());
  51. }
  52. }
  53. CSTRING_CATCH
  54. {
  55. }
  56. }
  57. BOOL
  58. NOTIFY_FUNCTION(
  59. DWORD fdwReason
  60. )
  61. {
  62. if (fdwReason == SHIM_PROCESS_DYING) {
  63. LaunchFeedbackUI();
  64. }
  65. return TRUE;
  66. }
  67. /*++
  68. Register hooked functions
  69. --*/
  70. HOOK_BEGIN
  71. CALL_NOTIFY_FUNCTION
  72. HOOK_END
  73. IMPLEMENT_SHIM_END