============================================================================= Manipulation of (cached) ini file sections
| 76 | // Manipulation of (cached) ini file sections |
| 77 | // |
| 78 | int IniSectionGetString ( |
| 79 | LPCWSTR lpCachedIniSection, |
| 80 | LPCWSTR lpName, |
| 81 | LPCWSTR lpDefault, |
| 82 | LPWSTR lpReturnedString, |
| 83 | int cchReturnedString ) |
| 84 | { |
| 85 | WCHAR *p = ( WCHAR * ) lpCachedIniSection; |
| 86 | WCHAR tch[256]; |
| 87 | int ich; |
| 88 | if ( p ) { |
| 89 | lstrcpy ( tch, lpName ); |
| 90 | lstrcat ( tch, L"=" ); |
| 91 | ich = lstrlen ( tch ); |
| 92 | while ( *p ) { |
| 93 | if ( StrCmpNI ( p, tch, ich ) == 0 ) { |
| 94 | lstrcpyn ( lpReturnedString, p + ich, cchReturnedString ); |
| 95 | return ( lstrlen ( lpReturnedString ) ); |
| 96 | } else { |
| 97 | p = StrEnd ( p ) + 1; |
| 98 | } |
| 99 | } |
| 100 | } |
| 101 | lstrcpyn ( lpReturnedString, lpDefault, cchReturnedString ); |
| 102 | return ( lstrlen ( lpReturnedString ) ); |
| 103 | } |
| 104 | |
| 105 | |
| 106 | int IniSectionGetInt ( |
no outgoing calls
no test coverage detected