Example #1
0
//---------------------------------------------------------------------------
int  Connection::Write(const std::string dataStr)
{
    int nRet;
    EnterCriticalSection(&this->critSection);
    CopyMemory(lpbyWriteBuffer, dataStr.c_str(), dataStr.length());
	nRet = WriteBinaryData((char*)lpbyWriteBuffer, dataStr.length());
 	LeaveCriticalSection(&this->critSection);

    return nRet;
}
Example #2
0
//---------------------------------------------------------------------------
int  Connection::WriteDataCmd(const std::string cmdStr, const char *data, const unsigned int dataLen)
{
    int nRet;

	EnterCriticalSection(&this->critSection);
    int nCmdLen = cmdStr.length();
    CopyMemory(lpbyWriteBuffer, cmdStr.c_str(), nCmdLen);
    if (dataLen > 0)
    {
        CopyMemory(lpbyWriteBuffer + nCmdLen, data, dataLen);
    }
    nRet = WriteBinaryData((char*)lpbyWriteBuffer, nCmdLen + dataLen);
 	LeaveCriticalSection(&this->critSection);
    
    return nRet;
}
void THierarchicalStorage::WriteBinaryData(const UnicodeString & Name,
  const RawByteString & Value)
{
  WriteBinaryData(Name, Value.c_str(), Value.Length());
}
Example #4
0
void TRegistry::WriteInt64(const UnicodeString & Name, __int64 Value)
{
  WriteBinaryData(Name, &Value, sizeof(Value));
}