aboutsummaryrefslogtreecommitdiff
path: root/Src/Winamp/JSAPI2_Security.h
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Winamp/JSAPI2_Security.h
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/Winamp/JSAPI2_Security.h')
-rw-r--r--Src/Winamp/JSAPI2_Security.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/Src/Winamp/JSAPI2_Security.h b/Src/Winamp/JSAPI2_Security.h
new file mode 100644
index 00000000..a7bbe914
--- /dev/null
+++ b/Src/Winamp/JSAPI2_Security.h
@@ -0,0 +1,43 @@
+#pragma once
+#include "JSAPI2_api_security.h"
+#include <bfc/platform/types.h>
+#include <map>
+#include <vector>
+#include "JSAPI_Info.h"
+
+namespace JSAPI2
+{
+ class Security : public JSAPI2::api_security
+ {
+ public:
+ ~Security();
+ static const char *getServiceName() { return "JSAPI2 Security API"; }
+ static const GUID getServiceGuid() { return api_securityGUID; }
+ int GetActionAuthorization(const wchar_t *group, const wchar_t *action, const wchar_t *authorization_key, JSAPI::ifc_info *info, int default_authorization = ACTION_UNDEFINED, AuthorizationData *data = 0);
+ int SetActionAuthorization(const wchar_t *group, const wchar_t *action, const wchar_t *authorization_key, int authorization);
+ void Associate(const wchar_t *authorization_key, HWND hwnd);
+ HWND GetAssociation(const wchar_t *authorization_key);
+ int SecurityPrompt(HWND hwnd, const wchar_t *title_string, const wchar_t *display_string, int flags);
+ void AssociateName(const wchar_t *authorization_key, const wchar_t *name);
+ const wchar_t *GetAssociatedName(const wchar_t *authorization_key);
+ void ResetAuthorization(const wchar_t *authorization_key);
+ void SetBypass(const wchar_t *authorization_key, bool enable_bypass);
+
+ protected:
+ bool IsAuthorizationBypassed(const wchar_t *authorization_key);
+
+ protected:
+ RECVS_DISPATCH;
+
+
+ private:
+ typedef std::map<uint32_t, wchar_t*> NameMap;
+ typedef std::map<uint32_t, void*> AssociationMap;
+ typedef std::vector<uint32_t> BypassList;
+ AssociationMap associations;
+ NameMap names;
+ BypassList bypassList;
+ };
+
+ extern Security security;
+} \ No newline at end of file