BOOL regQueryBinaryValue(const char * key, char *value, int count) { if(regEnabled) { DWORD type = 0; DWORD size = count; DWORD result = 0; LONG res = RegQueryValueEx(vbKey, key, NULL, &type, (UCHAR *)value, &size); if(res == ERROR_SUCCESS && type == REG_BINARY) return TRUE; return FALSE; } CString k = key; k += "Count"; int size = GetPrivateProfileInt(VBA_PREF, k, -1, *regVbaPath); if(size >= 0 && size < count) count = size; return GetPrivateProfileStruct(VBA_PREF, key, value, count, *regVbaPath); }
void IniFile::ReadPassword(char *value,int valuesize) { //int size=ReadInt("UltraVNC", "passwdsize",0); //vnclog.Print(LL_INTERR, VNCLOG("%s \n"),myInifilePasswd); GetPrivateProfileStruct("UltraVNC","passwd",value,8,myInifile); }
BOOL regQueryBinaryValue(char * key, char *value, int count) { if(regEnabled) { DWORD type = 0; DWORD size = count; DWORD result = 0; LONG res = RegQueryValueEx(vbKey, key, NULL, &type, (UCHAR *)value, &size); if(res == ERROR_SUCCESS && type == REG_BINARY) return TRUE; return FALSE; } return GetPrivateProfileStruct(VBA_PREF, key, value, count, regVbaPath); }
void UpdateCustomColors() { #ifdef _WIN32 GetPrivateProfileStruct("REAPER", "custcolors", g_custColors, sizeof(g_custColors), get_ini_file()); #else GetCustomColors(g_custColors); #endif }
// --------------------------------------------------------------------------- // iniファイルからデータを読み取る // --------------------------------------------------------------------------- int ReadIniFileData( char *vname, char *data, int size, char *sec_name, char *ini_fname ) { if( ini_fname==NULL){ if(IniFileName[0]==0){ ini_fname = "default.ini"; }else{ ini_fname = IniFileName; } } return !GetPrivateProfileStruct( sec_name, vname, data, size, ini_fname ); }
long FASTCALL RegQueryValueExRecursive( HKEY hKey, LPCTSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData ) { TCHAR szBuffer[ 256 ]; R_ASSERT( lstrlen( lpValueName ) < countof( szBuffer ) ); (void)lstrcpy( szBuffer, lpValueName ); LPTSTR pszBuffer = szBuffer; LPTSTR pszLast = szBuffer; while( *pszBuffer ) { if( *pszBuffer == _T('\\') || *pszBuffer == _T('/') ) { pszLast = pszBuffer; lpValueName = pszLast + 1; } pszBuffer++; } if(!regEnabled) { if(GetPrivateProfileStruct("Viewer", lpValueName, lpData, *lpcbData, regGetINIPath())) { *lpType = REG_BINARY; return ERROR_SUCCESS; } return -1; } bool m_bNeedToCloseKey = false; if( pszLast != szBuffer ) { *pszLast = _T('\000'); HKEY hkeyTemp; long lRet = RegOpenKey( hKey, szBuffer, &hkeyTemp ); if( lRet != ERROR_SUCCESS ) { return lRet; } hKey = hkeyTemp; m_bNeedToCloseKey = true; } long lRet = RegQueryValueEx( hKey, lpValueName, lpReserved, lpType, lpData, lpcbData ); if( m_bNeedToCloseKey ) { R_VERIFY( RegCloseKey( hKey ) == ERROR_SUCCESS ); } return lRet; }
static int LoadDefaultConfig(void **data, const char *desc) { static WDL_HeapBuf m_hb; const char *fn=get_ini_file(); int l=GetPrivateProfileInt(desc,"default_size",0,fn); if (l<1) return 0; if (GetPrivateProfileStruct(desc,"default",m_hb.Resize(l),l,fn)) { *data = m_hb.Get(); return l; } return 0; }
static int idaapi init(void) { msg("\nLoadMap: Plugin init.\n\n"); // Get the full path of plugin WIN32CHECK(GetModuleFileName(g_hinstPlugin, g_szIniPath, sizeof(g_szIniPath))); g_szIniPath[sizeof(g_szIniPath) - 1] = '\0'; // Change the extension of plugin to '.ini' _VERIFY(PathRenameExtension(g_szIniPath, ".ini")); // Get options saved in ini file _VERIFY(GetPrivateProfileStruct(g_szLoadMapSection, g_szOptionsKey, &g_options, sizeof(g_options), g_szIniPath)); return PLUGIN_KEEP; }
void //PGM IniFile::ReadPassword2(char *value,int valuesize) //PGM { //PGM GetPrivateProfileStruct("UltraVNC","passwd2",value,8,myInifile); //PGM } //PGM
bool//PGM IniFile::ReadPassword2(char *value,int valuesize) //PGM { //PGM return GetPrivateProfileStruct("RunRemote","passwd2",value,8,myInifile); //PGM } //PGM
bool CBaseIni::ReadStruct( LPCTSTR lpszAppName, LPCTSTR lpszKeyName, void * pStruct, unsigned int nSizeStruct ) { return GetPrivateProfileStruct( lpszAppName, lpszKeyName, pStruct, nSizeStruct, m_strFileName.c_str() )==TRUE; }