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.

94 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 2002 Microsoft Corporation
  3. Module Name:
  4. Outlook98Wizard.cpp
  5. Abstract:
  6. This DLL hooks VerQueryValue, and will return English Language information
  7. for Japanese outlook 98 setup file.
  8. Notes:
  9. This is an app specific shim.
  10. History:
  11. 01/21/2002 v-rbabu Created
  12. --*/
  13. #include "precomp.h"
  14. #include "string.h"
  15. IMPLEMENT_SHIM_BEGIN(Outlook98Wizard)
  16. #include "ShimHookMacro.h"
  17. APIHOOK_ENUM_BEGIN
  18. APIHOOK_ENUM_ENTRY(VerQueryValueA)
  19. APIHOOK_ENUM_END
  20. /*++
  21. The actual problem is, the outlook 98 setup is comparing the language
  22. informations of the Shell32.dll and the setup file (outlwzd.exe). But
  23. according to the bug scenario, the system is having English OS and Japanese
  24. Locale. So, Shell32.dll have English language as its language. So, this
  25. differs with the Language informaiton of Japanese Outlook setuip file.
  26. So, setup thorows an error that the Language of the outlook 98 going to be
  27. installed differs with the system language.
  28. This stub function lie about the language information of the outlook setup
  29. file. Though the setup file is Japanese as language informaiton, this shim
  30. returns as if it is English.
  31. --*/
  32. BOOL
  33. APIHOOK(VerQueryValueA)(
  34. const LPVOID pBlock,
  35. LPSTR lpSubBlock,
  36. LPVOID *lplpBuffer,
  37. PUINT puLen
  38. )
  39. {
  40. BOOL bRet = ORIGINAL_API(VerQueryValueA)(pBlock, lpSubBlock, lplpBuffer, puLen);
  41. if (bRet) {
  42. CSTRING_TRY
  43. {
  44. //
  45. // If trying to get the \VarFileInfo\Translation, then assign English
  46. // Language information to the output buffer.
  47. //
  48. CString csSubBlockString(lpSubBlock);
  49. if (lplpBuffer && (csSubBlockString.Find(L"\\VarFileInfo\\Translation") != -1)) {
  50. // Adjust the version info
  51. LOGN(eDbgLevelInfo, "[VerQueryValueA] Return modified version info");
  52. *lplpBuffer = L"03a40409";
  53. }
  54. }
  55. CSTRING_CATCH
  56. {
  57. // Do nothing
  58. }
  59. }
  60. return bRet;
  61. }
  62. /*++
  63. Register hooked functions
  64. --*/
  65. HOOK_BEGIN
  66. APIHOOK_ENTRY(VERSION.DLL, VerQueryValueA)
  67. HOOK_END
  68. IMPLEMENT_SHIM_END