- Timestamp:
- Oct 20, 2003, 7:18:30 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/inituser32.cpp
r10256 r10277 1 /* $Id: inituser32.cpp,v 1.1 4 2003-10-02 10:35:59sandervl Exp $ */1 /* $Id: inituser32.cpp,v 1.15 2003-10-20 17:18:30 sandervl Exp $ */ 2 2 /* 3 3 * USER32 DLL entry point … … 29 29 #define INCL_DOSMISC 30 30 #define INCL_DOSERRORS 31 #define INCL_WINSHELLDATA 31 32 #include <os2wrap.h> //Odin32 OS/2 api wrappers 32 33 #include <stdlib.h> … … 67 68 DWORD hInstanceUser32 = 0; 68 69 70 extern INT __cdecl wsnprintfA(LPSTR,UINT,LPCSTR,...); 69 71 70 72 /**************************************************************/ … … 92 94 strcpy(PMKBDHK_MODULE, pszKbdDllName); 93 95 } 96 97 #define FONTSDIRECTORY "Fonts" 98 #define REGPATH "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts" 99 100 //****************************************************************************** 101 //****************************************************************************** 102 void MigrateWindowsFonts() 103 { 104 HKEY hkFonts,hkOS2Fonts; 105 char buffer[512]; 106 UINT len = GetWindowsDirectoryA( NULL, 0 ); 107 108 if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, REGPATH ,0, KEY_ALL_ACCESS, &hkFonts) == 0) 109 { 110 DWORD dwIndex, dwType; 111 char subKeyName[255], dataArray[512]; 112 DWORD sizeOfSubKeyName = 254, sizeOfDataArray = 511; 113 114 // loop over all values of the current key 115 for (dwIndex=0; 116 RegEnumValueA(hkFonts, dwIndex, subKeyName, &sizeOfSubKeyName, NULL, &dwType ,(LPBYTE)dataArray, &sizeOfDataArray) != ERROR_NO_MORE_ITEMS_W; 117 ++dwIndex, sizeOfSubKeyName = 254, sizeOfDataArray = 511) 118 { 119 //Check OS/2 INI profile for font entry 120 if (!PrfQueryProfileString(HINI_PROFILE, "PM_Fonts", dataArray, 121 NULL, (PVOID)subKeyName, (LONG)sizeof(subKeyName))) 122 { 123 HDIR hdirFindHandle = HDIR_CREATE; 124 FILEFINDBUF3 FindBuffer = {0}; 125 ULONG ulResultBufLen = sizeof(FILEFINDBUF3); 126 ULONG ulFindCount = 1; 127 APIRET rc = NO_ERROR; 128 129 dprintf(("Migrating font %s to OS/2",dataArray)); 130 131 GetWindowsDirectoryA( buffer, len + 1 ); 132 wsnprintfA( buffer, sizeof(buffer), "%s\\%s\\%s", buffer, FONTSDIRECTORY, dataArray ); 133 134 rc = DosFindFirst( buffer, &hdirFindHandle, FILE_NORMAL,&FindBuffer, ulResultBufLen, &ulFindCount, FIL_STANDARD); 135 136 //Check that file actaully exist 137 if ( rc == NO_ERROR && !(FindBuffer.attrFile & FILE_DIRECTORY)) 138 { 139 PrfWriteProfileString(HINI_PROFILE,"PM_Fonts",dataArray, buffer); 140 DosFindClose(hdirFindHandle); 141 } 142 } 143 } 144 RegCloseKey(hkFonts); 145 } 146 } 147 94 148 //****************************************************************************** 95 149 //****************************************************************************** … … 227 281 //CB: initialize PM monitor driver 228 282 MONITOR_Initialize(&MONITOR_PrimaryMonitor); 283 284 //PF: migrate windows fonts 285 MigrateWindowsFonts(); 229 286 230 287 break;
Note:
See TracChangeset
for help on using the changeset viewer.