//--------------------------------------------------------------------------- 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; }
//--------------------------------------------------------------------------- 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()); }
void TRegistry::WriteInt64(const UnicodeString & Name, __int64 Value) { WriteBinaryData(Name, &Value, sizeof(Value)); }