diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-02 18:55:37 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-02 18:55:37 +0000 |
commit | 828535640691c97027c9844a8e84b4c34d4720bd (patch) | |
tree | 01d7f95fcf7abaac8d9daeb984d3dc99976e1a57 /protocols/SkypeWeb/src/skype_db.h | |
parent | 26a22a753462573077d2a8072fd2eb822a288d7d (diff) |
pass_ptrA, pass_ptrW and pass_ptrT
git-svn-id: http://svn.miranda-ng.org/main/trunk@14822 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_db.h')
-rw-r--r-- | protocols/SkypeWeb/src/skype_db.h | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/protocols/SkypeWeb/src/skype_db.h b/protocols/SkypeWeb/src/skype_db.h index f4ea89184b..d42d7f40b4 100644 --- a/protocols/SkypeWeb/src/skype_db.h +++ b/protocols/SkypeWeb/src/skype_db.h @@ -33,20 +33,39 @@ enum SKYPE_DB_EVENT_TYPE #define SKYPE_SETTINGS_PASSWORD "Password"
#define SKYPE_SETTINGS_GROUP "DefaultGroup"
-class pass_ptr
+class pass_ptrA
{
char* data;
public:
- __inline explicit pass_ptr() : data(NULL) {}
- __inline explicit pass_ptr(char* _p) : data(_p) {}
- __inline ~pass_ptr() { zero(); mir_free(data); }
+ __inline explicit pass_ptrA() : data(NULL) {}
+ __inline explicit pass_ptrA(char* _p) : data(_p) {}
+ __inline ~pass_ptrA() { zero(); mir_free(data); }
__inline char* operator = (char * _p) { if (data){ zero(); mir_free(data); } data = _p; return data; }
__inline char* operator->() const { return data; }
__inline operator char *() const { return data; }
__inline operator INT_PTR() const { return (INT_PTR)data; }
__inline char * detach() { char *res = data; data = NULL; return res; }
- __inline void zero(){ if (data) SecureZeroMemory(data, mir_strlen(data)); }
+ __inline void zero() { if (data) SecureZeroMemory(data, mir_strlen(data)); }
};
+class pass_ptrW
+{
+ WCHAR* data;
+
+public:
+ __inline explicit pass_ptrW() : data(NULL) {}
+ __inline explicit pass_ptrW(WCHAR* _p) : data(_p) {}
+ __inline ~pass_ptrW() { zero(); mir_free(data); }
+ __inline WCHAR* operator = (WCHAR * _p) { if (data){ zero(); mir_free(data); } data = _p; return data; }
+ __inline WCHAR* operator->() const { return data; }
+ __inline operator WCHAR *() const { return data; }
+ __inline operator INT_PTR() const { return (INT_PTR)data; }
+ __inline WCHAR * detach() { WCHAR *res = data; data = NULL; return res; }
+ __inline void zero() { if (data) SecureZeroMemory(data, (mir_wstrlen(data)*sizeof(TCHAR))); }
+};
+
+typedef pass_ptrW pass_ptrT;
+
+
#endif //_SKYPE_DB_H_
\ No newline at end of file |