Changeset 4353 for trunk/src/kernel32/profile.cpp
- Timestamp:
- Oct 1, 2000, 11:16:04 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/profile.cpp
r4098 r4353 1 /* $Id: profile.cpp,v 1.2 4 2000-08-27 03:25:42 birdExp $ */1 /* $Id: profile.cpp,v 1.25 2000-10-01 21:16:04 phaller Exp $ */ 2 2 3 3 /* … … 47 47 48 48 #define SystemHeap GetProcessHeap() 49 50 #ifndef strcasecmp 49 51 #define strcasecmp stricmp 52 #endif 53 50 54 #define DOSFS_GetFullName(a,b,c) strcpy(c,a) 51 55 #define CharLowerA(a) (a) … … 75 79 time_t mtime; 76 80 } PROFILE; 81 82 83 /**************************************************************************** 84 * internal prototypes * 85 ****************************************************************************/ 86 UINT ODIN_INTERNAL ODIN_GetPrivateProfileIntA(LPCSTR, LPCSTR, INT, LPCSTR); 87 UINT ODIN_INTERNAL ODIN_GetPrivateProfileIntW(LPCWSTR, LPCWSTR, INT, LPCWSTR); 88 INT ODIN_INTERNAL ODIN_GetPrivateProfileStringW(LPCWSTR, LPCWSTR, LPCWSTR, LPWSTR, UINT, LPCWSTR); 89 BOOL ODIN_INTERNAL ODIN_WritePrivateProfileStringA(LPCSTR, LPCSTR, LPCSTR, LPCSTR); 90 BOOL ODIN_INTERNAL ODIN_WritePrivateProfileStringW(LPCWSTR, LPCWSTR, LPCWSTR, LPCWSTR); 91 77 92 78 93 … … 1077 1092 INT, def_val) 1078 1093 { 1079 return GetPrivateProfileIntA( section, entry, def_val, WINININAME );1094 return ODIN_GetPrivateProfileIntA( section, entry, def_val, WINININAME ); 1080 1095 } 1081 1096 … … 1089 1104 { 1090 1105 if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, WINININAME ); 1091 return GetPrivateProfileIntW( section, entry, def_val, wininiW );1106 return ODIN_GetPrivateProfileIntW( section, entry, def_val, wininiW ); 1092 1107 } 1093 1108 … … 1102 1117 UINT, len) 1103 1118 { 1104 return GetPrivateProfileStringA( section, entry, def_val,1119 return ODIN_GetPrivateProfileStringA( section, entry, def_val, 1105 1120 buffer, len, WINININAME ); 1106 1121 } … … 1117 1132 { 1118 1133 if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, WINININAME ); 1119 return GetPrivateProfileStringW( section, entry, def_val,1134 return ODIN_GetPrivateProfileStringW( section, entry, def_val, 1120 1135 buffer, len, wininiW ); 1121 1136 } … … 1129 1144 LPCSTR, string) 1130 1145 { 1131 return WritePrivateProfileStringA( section, entry, string, WINININAME );1146 return ODIN_WritePrivateProfileStringA( section, entry, string, WINININAME ); 1132 1147 } 1133 1148 … … 1141 1156 { 1142 1157 if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, WINININAME ); 1143 return WritePrivateProfileStringW( section, entry, string, wininiW );1158 return ODIN_WritePrivateProfileStringW( section, entry, string, wininiW ); 1144 1159 } 1145 1160 … … 1157 1172 long result; 1158 1173 1159 GetPrivateProfileStringA( section, entry, "",1174 ODIN_GetPrivateProfileStringA( section, entry, "", 1160 1175 buffer, sizeof(buffer), filename ); 1161 1176 if (!buffer[0]) return (UINT)def_val; … … 1177 1192 LPSTR entryA = HEAP_strdupWtoA( GetProcessHeap(), 0, entry ); 1178 1193 LPSTR filenameA = HEAP_strdupWtoA( GetProcessHeap(), 0, filename ); 1179 UINT res = GetPrivateProfileIntA(sectionA, entryA, def_val, filenameA);1194 UINT res = ODIN_GetPrivateProfileIntA(sectionA, entryA, def_val, filenameA); 1180 1195 HeapFree( GetProcessHeap(), 0, sectionA ); 1181 1196 HeapFree( GetProcessHeap(), 0, filenameA ); … … 1230 1245 LPSTR def_valA = HEAP_strdupWtoA( GetProcessHeap(), 0, def_val ); 1231 1246 LPSTR bufferA = (LPSTR)HeapAlloc( GetProcessHeap(), 0, len ); 1232 INT ret = GetPrivateProfileStringA( sectionA, entryA, def_valA,1247 INT ret = ODIN_GetPrivateProfileStringA( sectionA, entryA, def_valA, 1233 1248 bufferA, len, filenameA ); 1234 1249 lstrcpynAtoW( buffer, bufferA, len ); … … 1277 1292 LPSTR filenameA = HEAP_strdupWtoA( GetProcessHeap(), 0, filename ); 1278 1293 LPSTR bufferA = (LPSTR)HeapAlloc( GetProcessHeap(), 0, len ); 1279 INT ret = GetPrivateProfileSectionA( sectionA, bufferA, len,1294 INT ret = ODIN_GetPrivateProfileSectionA( sectionA, bufferA, len, 1280 1295 filenameA ); 1281 1296 MultiByteToWideChar(CP_ACP,0,bufferA,ret,buffer,len); … … 1294 1309 DWORD, len) 1295 1310 { 1296 return GetPrivateProfileSectionA( section, buffer, len, WINININAME );1311 return ODIN_GetPrivateProfileSectionA( section, buffer, len, WINININAME ); 1297 1312 } 1298 1313 … … 1306 1321 { 1307 1322 if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, WINININAME ); 1308 return GetPrivateProfileSectionW( section, buffer, len, wininiW );1323 return ODIN_GetPrivateProfileSectionW( section, buffer, len, wininiW ); 1309 1324 } 1310 1325 … … 1347 1362 LPSTR stringA = HEAP_strdupWtoA( GetProcessHeap(), 0, string ); 1348 1363 LPSTR filenameA = HEAP_strdupWtoA( GetProcessHeap(), 0, filename ); 1349 BOOL res = WritePrivateProfileStringA( sectionA, entryA,1364 BOOL res = ODIN_WritePrivateProfileStringA( sectionA, entryA, 1350 1365 stringA, filenameA ); 1351 1366 HeapFree( GetProcessHeap(), 0, sectionA ); … … 1381 1396 LPSTR stringA = HEAP_strdupWtoA( GetProcessHeap(), 0, string ); 1382 1397 LPSTR filenameA = HEAP_strdupWtoA( GetProcessHeap(), 0, filename ); 1383 BOOL res = WritePrivateProfileSectionA( sectionA, stringA, filenameA );1398 BOOL res = ODIN_WritePrivateProfileSectionA( sectionA, stringA, filenameA ); 1384 1399 HeapFree( GetProcessHeap(), 0, sectionA ); 1385 1400 HeapFree( GetProcessHeap(), 0, stringA ); … … 1395 1410 LPCSTR, keys_n_values) 1396 1411 { 1397 return WritePrivateProfileSectionA( section, keys_n_values, WINININAME);1412 return ODIN_WritePrivateProfileSectionA( section, keys_n_values, WINININAME); 1398 1413 } 1399 1414 … … 1407 1422 if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, WINININAME); 1408 1423 1409 return ( WritePrivateProfileSectionW (section,keys_n_values, wininiW));1424 return (ODIN_WritePrivateProfileSectionW (section,keys_n_values, wininiW)); 1410 1425 } 1411 1426 … … 1438 1453 LPCSTR, filename) 1439 1454 { 1440 return ( GetPrivateProfileSectionNames16 (buffer,size,filename));1455 return (ODIN_GetPrivateProfileSectionNames16 (buffer,size,filename)); 1441 1456 } 1442 1457 … … 1452 1467 LPSTR bufferA = (LPSTR)HeapAlloc( GetProcessHeap(), 0, size); 1453 1468 1454 INT ret = GetPrivateProfileSectionNames16 (bufferA, size, filenameA);1469 INT ret = ODIN_GetPrivateProfileSectionNames16 (bufferA, size, filenameA); 1455 1470 lstrcpynAtoW( buffer, bufferA, size); 1456 1471 HeapFree( GetProcessHeap(), 0, bufferA); … … 1501 1516 LPSTR bufferA = (LPSTR)HeapAlloc( GetProcessHeap(), 0, len ); 1502 1517 1503 INT ret = GetPrivateProfileStructA( sectionA, keyA, bufferA,1518 INT ret = ODIN_GetPrivateProfileStructA( sectionA, keyA, bufferA, 1504 1519 len, filenameA ); 1505 1520 lstrcpynAtoW( (LPWSTR)buffer, bufferA, len ); … … 1526 1541 1527 1542 if (!section && !key && !buf) /* flush the cache */ 1528 return WritePrivateProfileStringA( NULL, NULL, NULL, filename );1543 return ODIN_WritePrivateProfileStringA( NULL, NULL, NULL, filename ); 1529 1544 1530 1545 EnterCriticalSection( &PROFILE_CritSect ); … … 1551 1566 LPSTR keyA = HEAP_strdupWtoA( GetProcessHeap(), 0, key); 1552 1567 LPSTR filenameA = HEAP_strdupWtoA( GetProcessHeap(), 0, filename ); 1553 INT ret = WritePrivateProfileStructA( sectionA, keyA, buf, bufsize,1568 INT ret = ODIN_WritePrivateProfileStructA( sectionA, keyA, buf, bufsize, 1554 1569 filenameA ); 1555 1570 HeapFree( GetProcessHeap(), 0, sectionA ); … … 1593 1608 } 1594 1609 1595 1596
Note:
See TracChangeset
for help on using the changeset viewer.