summaryrefslogtreecommitdiff
path: root/protocols/Omegle/src/stdafx.h
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2015-10-20 09:37:26 +0000
committerRobert Pösel <robyer@seznam.cz>2015-10-20 09:37:26 +0000
commit1b270f957517df4def8cf85ee3dc75050cce3357 (patch)
tree1972b6e4270c798f1848f19e2a8574e0cc88f30c /protocols/Omegle/src/stdafx.h
parentd3e496e29030a0ebe980dcd0326a1c3262d2db1e (diff)
Omegle: Adapt to use std_string_utils
git-svn-id: http://svn.miranda-ng.org/main/trunk@15575 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Omegle/src/stdafx.h')
-rw-r--r--protocols/Omegle/src/stdafx.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/protocols/Omegle/src/stdafx.h b/protocols/Omegle/src/stdafx.h
index 58bd9ed275..69ea6c6e9c 100644
--- a/protocols/Omegle/src/stdafx.h
+++ b/protocols/Omegle/src/stdafx.h
@@ -64,8 +64,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
class OmegleProto;
+#include "../../utils/std_string_utils.h"
+
#include "http.h"
-#include "utils.h"
#include "client.h"
#include "proto.h"
#include "db.h"
@@ -76,4 +77,25 @@ class OmegleProto;
extern HINSTANCE g_hInstance;
extern std::string g_strUserAgent;
-extern DWORD g_mirandaVersion; \ No newline at end of file
+extern DWORD g_mirandaVersion;
+
+class ScopedLock
+{
+public:
+ ScopedLock(HANDLE h) : handle_(h)
+ {
+ WaitForSingleObject(handle_,INFINITE);
+ }
+ ~ScopedLock()
+ {
+ if(handle_)
+ ReleaseMutex(handle_);
+ }
+ void Unlock()
+ {
+ ReleaseMutex(handle_);
+ handle_ = 0;
+ }
+private:
+ HANDLE handle_;
+};