summaryrefslogtreecommitdiff
path: root/protocols/Omegle/src/stdafx.h
diff options
context:
space:
mode:
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_;
+};