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.

162 lines
5.3 KiB

  1. #include "priv.h"
  2. #pragma hdrstop
  3. #include "limits.h"
  4. /*********** STRINGS - Should _not_ be localized */
  5. #define SZOFCROOT TEXT("Software\\Microsoft\\Microsoft Office\\95\\")
  6. #define SZOFCSHAREDROOT TEXT("Software\\Microsoft\\Shared Tools\\")
  7. const TCHAR vcszCreateShortcuts[] = SZOFCROOT TEXT("Shell Folders");
  8. const TCHAR vcszKeyAnthem[] = SZOFCROOT TEXT("Anthem");
  9. const TCHAR vcszKeyFileNewNFT[] = SZOFCROOT TEXT("FileNew\\NFT");
  10. const TCHAR vcszKeyFileNewLocal[] = SZOFCROOT TEXT("FileNew\\LocalTemplates");
  11. const TCHAR vcszKeyFileNewShared[] = SZOFCROOT TEXT("FileNew\\SharedTemplates");
  12. const TCHAR vcszKeyFileNew[] = SZOFCROOT TEXT("FileNew");
  13. const TCHAR vcszFullKeyFileNew[] = TEXT("HKEY_CURRENT_USER\\") SZOFCROOT TEXT("FileNew");
  14. const TCHAR vcszKeyIS[] = SZOFCROOT TEXT("IntelliSearch");
  15. const TCHAR vcszSubKeyISToWHelp[] = TEXT("towinhelp");
  16. const TCHAR vcszSubKeyAutoInitial[] = TEXT("CorrectTwoInitialCapitals");
  17. const TCHAR vcszSubKeyAutoCapital[] = TEXT("CapitalizeNamesOfDays");
  18. const TCHAR vcszSubKeyReplace[] = TEXT("ReplaceText");
  19. const TCHAR vcszIntlPrefix[] = TEXT("MSO5");
  20. const TCHAR vcszDllPostfix[] = TEXT(".DLL");
  21. const TCHAR vcszName[] = TEXT("Name");
  22. const TCHAR vcszType[] = TEXT("Type");
  23. const TCHAR vcszApp[] = TEXT("Application");
  24. const TCHAR vcszCmd[] = TEXT("Command");
  25. const TCHAR vcszTopic[] = TEXT("Topic");
  26. const TCHAR vcszDde[] = TEXT("DDEExec");
  27. const TCHAR vcszRc[] = TEXT("ReturnCode");
  28. const TCHAR vcszPos[] = TEXT("Position");
  29. const TCHAR vcszPrevue[] = TEXT("Preview");
  30. const TCHAR vcszFlags[] = TEXT("Flags");
  31. const TCHAR vcszNFT[] = TEXT("NFT");
  32. const TCHAR vcszMicrosoft[] = TEXT("Microsoft");
  33. const TCHAR vcszElipsis[] = TEXT(" ...");
  34. const TCHAR vcszLocalPath[] = TEXT("C:\\Microsoft Office\\Templates");
  35. const TCHAR vcszAllFiles[] = TEXT("*.*\0\0");
  36. const TCHAR vcszSpace[] = TEXT(" ");
  37. const TCHAR vcszMSNInstalled[] = TEXT("SOFTWARE\\Microsoft\\MOS\\SoftwareInstalled");
  38. const TCHAR vcszMSNDir[] = SZOFCROOT TEXT("Microsoft Network");
  39. const TCHAR vcszMSNLocDir[] = TEXT("Local Directory");
  40. const TCHAR vcszMSNNetDir[] = TEXT("Network Directory");
  41. const TCHAR vcszMSNFiles[] = TEXT("*.mcc\0\0");
  42. const TCHAR vcszShellFolders[] = TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders");
  43. const TCHAR vcszUserShellFolders[] = TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders");
  44. const TCHAR vcszDefaultShellFolders[] = TEXT(".Default\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders");
  45. const TCHAR vcszDefaultUserShellFolders[] = TEXT(".Default\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders");
  46. const TCHAR vcszMyDocs[] = TEXT("Personal");
  47. const TCHAR vcszNoTracking[] = SZOFCROOT TEXT("Options\\NoTracking");
  48. const TCHAR vcszOldDocs[] = SZOFCROOT TEXT("Old Doc");
  49. #ifdef WAIT3340
  50. const TCHAR vcszMSHelp[]= TEXT("SOFTWARE\\Microsoft\\Windows\\Help");
  51. #endif
  52. BOOL fChicago = TRUE; // Are we running on Chicago or what!!
  53. /*--------------------------------------------------------------------
  54. * offglue.c
  55. Util routines taken from office.c
  56. --------------------------------------------------------------------*/
  57. //
  58. // FUNCTION: FScanMem
  59. //
  60. // Purpose: To scan memory for a given value.
  61. //
  62. // Parameters: pb - pointer to memory
  63. // bVal - value to scan for
  64. // cb - cb pointed to by pb
  65. //
  66. // Returns: TRUE iff all the memory has the value cbVal.
  67. // FALSE otherwise.
  68. //
  69. BOOL FScanMem(LPBYTE pb, byte bVal, DWORD cb)
  70. {
  71. DWORD i;
  72. for (i = 0; i < cb; ++i)
  73. {
  74. if (*pb++ != bVal)
  75. return FALSE;
  76. }
  77. return TRUE;
  78. }
  79. int CchGetString(ids,rgch,cchMax)
  80. int ids;
  81. TCHAR rgch[];
  82. int cchMax;
  83. {
  84. return(LoadString(g_hmodThisDll, ids, rgch, cchMax));
  85. }
  86. #define SZRES_BUFMAX 100
  87. int ScanDateNums(TCHAR *pch, TCHAR *pszSep, unsigned int aiNum[], int cNum, int iYear)
  88. {
  89. int i = 0;
  90. TCHAR *pSep;
  91. if (cNum < 1)
  92. return 1;
  93. do
  94. {
  95. aiNum[i] = wcstol(pch, &pch, 10);
  96. if ( 0 == aiNum[i] )
  97. {
  98. if( i != iYear )
  99. {
  100. return 0;
  101. }
  102. }
  103. i ++;
  104. if (i < cNum)
  105. {
  106. while (isspace(*pch))
  107. {
  108. pch++;
  109. }
  110. /* check the separator */
  111. pSep = pszSep;
  112. while (*pSep && (*pSep == *pch))
  113. {
  114. pSep++, pch++;
  115. }
  116. if (*pSep && (*pSep != *pch))
  117. return 0;
  118. }
  119. } while (*pch && (i < cNum));
  120. return 1;
  121. }
  122. //
  123. // Displays the actual alert
  124. //
  125. static int DoMessageBox(HWND hwnd, TCHAR *pszText, TCHAR *pszTitle, UINT fuStyle)
  126. {
  127. int res;
  128. res = MessageBox((hwnd == NULL) ? GetFocus() : hwnd, pszText, pszTitle, fuStyle);
  129. return(res);
  130. }
  131. //--------------------------------------------------------------------------
  132. // Displays the give ids as an alert
  133. //--------------------------------------------------------------------------
  134. int IdDoAlert(HWND hwnd, int ids, int mb)
  135. {
  136. TCHAR rgch[258];
  137. TCHAR rgchM[258];
  138. CchGetString(ids, rgch, 258);
  139. CchGetString(idsMsftOffice, rgchM, 258);
  140. return(DoMessageBox (hwnd, rgch, rgchM, mb));
  141. }