Files
Client/Server/ToolProject/SeverSetupDlg/misc/INIFunctions.cpp
LGram16 dd97ddec92 Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code:
- Client: Game client source (moved to Client/Client/)
- Server: Game server source
- GameTools: Development tools
- CryptoSource: Encryption utilities
- database: Database scripts
- Script: Game scripts
- rylCoder_16.02.2008_src: Legacy coder tools
- GMFont, Game: Additional resources

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 20:17:20 +09:00

47 lines
1.7 KiB
C++

///////////////////////////////////////////////////////////////////////////////////////////////
//
// ¼³Á¤ ÆÄÀÏ ÇÔ¼ö
//
///////////////////////////////////////////////////////////////////////////////////////////////
#include "../stdafx.h"
#include "INIFunctions.h"
bool WriteStringToReg(const TCHAR *FileName_In, const TCHAR *Section_In,
const TCHAR *KeyName_In, const TCHAR *Value_In)
{
return 0 != WritePrivateProfileString(Section_In, KeyName_In, Value_In, FileName_In);
}
bool ReadStringFromReg(const TCHAR *FileName_In, const TCHAR *Section_In,
const TCHAR *KeyName_In, TCHAR *Value_Out, int nMaxBuffer)
{
return (0 <= GetPrivateProfileString(Section_In, KeyName_In, "", Value_Out, nMaxBuffer, FileName_In));
}
bool ReadStringFromReg(const TCHAR *FileName_In, const TCHAR *Section_In,
const TCHAR *KeyName_In, CString& Value_Out, int nMaxBuffer)
{
TCHAR* szBuffer =
reinterpret_cast<TCHAR*>(_alloca(nMaxBuffer * sizeof(TCHAR)));
if (0 <= GetPrivateProfileString(Section_In, KeyName_In, "", szBuffer, nMaxBuffer, FileName_In))
{
Value_Out.SetString(szBuffer);
return true;
}
return false;
}
bool WriteStructToReg(const TCHAR *FileName_In, const TCHAR *Section_In,
const TCHAR *KeyName_In, void *Value_In, int Size_in)
{
return 0 != WritePrivateProfileStruct(Section_In, KeyName_In, Value_In, Size_in, FileName_In);
}
bool ReadStructFromReg(const TCHAR *FileName_In, const TCHAR *Section_In,
const TCHAR *KeyName_In, void *Value_Out, int Size_in)
{
return 0 != GetPrivateProfileStruct(Section_In, KeyName_In, Value_Out, Size_in, FileName_In);
}