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.

88 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. DongFangKuaiChe3000Setup.cpp
  5. Abstract:
  6. At the end of setup, the app is calling CreateProcessA with following
  7. "rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 \Z:\act\DongFangKuaiChe3000Pro\dfkc3000\MultiLanguage\Chinese\cn.inf"
  8. there are altogether 4 calls to install Japanese/Chinese/Korean languagepack
  9. (lagacy IE's langpack). The '\' before Z:\act\DongFang... is an extra one
  10. and caused rundll32.exe fails in NT.
  11. Notes:
  12. This shim is to disable calls to install lagacy IE langpack, since NT has
  13. already it's own.
  14. History:
  15. 07/09/2001 xiaoz Created
  16. --*/
  17. #include "precomp.h"
  18. IMPLEMENT_SHIM_BEGIN(DongFangKuaiChe3000Setup)
  19. #include "ShimHookMacro.h"
  20. APIHOOK_ENUM_BEGIN
  21. APIHOOK_ENUM_ENTRY(CreateProcessA)
  22. APIHOOK_ENUM_END
  23. BOOL
  24. APIHOOK(CreateProcessA)(
  25. LPCSTR lpApplicationName, // name of executable module
  26. LPSTR lpCommandLine, // command line string
  27. LPSECURITY_ATTRIBUTES lpProcessAttributes, // SD
  28. LPSECURITY_ATTRIBUTES lpThreadAttributes, // SD
  29. BOOL bInheritHandles, // handle inheritance option
  30. DWORD dwCreationFlags, // creation flags
  31. LPVOID lpEnvironment, // new environment block
  32. LPCSTR lpCurrentDirectory, // current directory name
  33. LPSTARTUPINFOA lpStartupInfo, // startup information
  34. LPPROCESS_INFORMATION lpProcessInformation // process information
  35. )
  36. {
  37. CSTRING_TRY
  38. {
  39. CString cstrPattern = L"rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 \\";
  40. CString cstrCmdLine(lpCommandLine);
  41. int nIndex;
  42. nIndex = cstrCmdLine.Find(cstrPattern);
  43. if ( nIndex >=0 )
  44. {
  45. return TRUE;
  46. }
  47. }
  48. CSTRING_CATCH
  49. {
  50. // Do Nothing
  51. }
  52. return ORIGINAL_API(CreateProcessA)(lpApplicationName, lpCommandLine,
  53. lpProcessAttributes, lpThreadAttributes, bInheritHandles,
  54. dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo,
  55. lpProcessInformation);
  56. }
  57. /*++
  58. Register hooked functions
  59. --*/
  60. HOOK_BEGIN
  61. APIHOOK_ENTRY(KERNEL32.DLL, CreateProcessA)
  62. HOOK_END
  63. IMPLEMENT_SHIM_END