Changeset 10319 for trunk/src/user32/inituser32.cpp
- Timestamp:
- Nov 14, 2003, 2:44:11 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/inituser32.cpp
r10316 r10319 1 /* $Id: inituser32.cpp,v 1.1 7 2003-11-12 14:10:19sandervl Exp $ */1 /* $Id: inituser32.cpp,v 1.18 2003-11-14 13:44:10 sandervl Exp $ */ 2 2 /* 3 3 * USER32 DLL entry point … … 30 30 #define INCL_DOSERRORS 31 31 #define INCL_WINSHELLDATA 32 #define INCL_GPI 33 #define INCL_WINERRORS 32 34 #include <os2wrap.h> //Odin32 OS/2 api wrappers 33 35 #include <stdlib.h> … … 79 81 HKEY hkFonts,hkOS2Fonts; 80 82 char buffer[512]; 81 UINT len = GetWindowsDirectoryA( NULL, 0 );83 UINT len; 82 84 83 85 if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, REGPATH ,0, KEY_ALL_ACCESS, &hkFonts) == 0) … … 92 94 ++dwIndex, sizeOfSubKeyName = 254, sizeOfDataArray = 511) 93 95 { 94 //Check OS/2 INI profile for font entry 95 if (!PrfQueryProfileString(HINI_PROFILE, "PM_Fonts", dataArray, 96 NULL, (PVOID)subKeyName, (LONG)sizeof(subKeyName))) 96 HDIR hdirFindHandle = HDIR_CREATE; 97 FILEFINDBUF3 FindBuffer = {0}; 98 ULONG ulResultBufLen = sizeof(FILEFINDBUF3); 99 ULONG ulFindCount = 1, ret; 100 APIRET rc = NO_ERROR; 101 102 GetWindowsDirectoryA( buffer, sizeof(buffer) ); 103 wsnprintfA( buffer, sizeof(buffer), "%s\\%s\\%s", buffer, FONTSDIRECTORY, dataArray ); 104 105 rc = DosFindFirst( buffer, &hdirFindHandle, FILE_NORMAL,&FindBuffer, ulResultBufLen, &ulFindCount, FIL_STANDARD); 106 //Check that file actaully exist 107 if ( rc == NO_ERROR && !(FindBuffer.attrFile & FILE_DIRECTORY)) 97 108 { 98 HDIR hdirFindHandle = HDIR_CREATE; 99 FILEFINDBUF3 FindBuffer = {0}; 100 ULONG ulResultBufLen = sizeof(FILEFINDBUF3); 101 ULONG ulFindCount = 1; 102 APIRET rc = NO_ERROR; 103 104 dprintf(("Migrating font %s to OS/2",dataArray)); 105 106 GetWindowsDirectoryA( buffer, len + 1 ); 107 wsnprintfA( buffer, sizeof(buffer), "%s\\%s\\%s", buffer, FONTSDIRECTORY, dataArray ); 108 109 rc = DosFindFirst( buffer, &hdirFindHandle, FILE_NORMAL,&FindBuffer, ulResultBufLen, &ulFindCount, FIL_STANDARD); 110 111 //Check that file actaully exist 112 if ( rc == NO_ERROR && !(FindBuffer.attrFile & FILE_DIRECTORY)) 113 { 114 PrfWriteProfileString(HINI_PROFILE,"PM_Fonts",dataArray, buffer); 115 DosFindClose(hdirFindHandle); 116 } 117 } 109 //Check OS/2 INI profile for font entry 110 len = PrfQueryProfileString(HINI_PROFILE, "PM_Fonts", dataArray, 111 NULL, (PVOID)subKeyName, (LONG)sizeof(subKeyName)); 112 113 //If it doesn't exist OR if it's outdated 114 if(len == 0 || strcmp(subKeyName, buffer)) 115 { 116 dprintf(("Migrating font %s to OS/2",dataArray)); 117 118 ret = GpiLoadFonts(0, buffer); 119 if(ret == FALSE) { 120 dprintf(("GpiLoadFonts %s failed with %x", buffer, WinGetLastError(0))); 121 } 122 } 123 } 124 DosFindClose(hdirFindHandle); 118 125 } 119 126 RegCloseKey(hkFonts);
Note:
See TracChangeset
for help on using the changeset viewer.