Archived
1
0
This repository has been archived on 2024-10-17. You can view files and clone it, but cannot push or open issues or pull requests.
winamp/Src/replicant/Wasabi/SysCallbacks.h

32 lines
848 B
C
Raw Normal View History

2024-09-24 12:54:57 +00:00
#pragma once
#include "syscb/api_syscb.h"
#include <vector>
#include "nu/AutoLock.h"
#include "service/types.h"
#include "nx/nxstring.h"
#include "nswasabi/ServiceName.h"
class SysCallbacks : public api_syscb
{
public:
WASABI_SERVICE_NAME("System Callbacks API");
public:
SysCallbacks();
int WASABICALL SysCallbacks_RegisterCallback(ifc_sysCallback *cb);
int WASABICALL SysCallbacks_UnregisterCallback(ifc_sysCallback *cb);
int WASABICALL SysCallbacks_IssueCallback(GUID eventtype, int msg, intptr_t param1 = 0, intptr_t param2 = 0);
ifc_sysCallback *WASABICALL SysCallbacks_Enum(GUID eventtype, size_t n);
private:
nu::LockGuard callbackGuard;
std::vector<ifc_sysCallback*> callbacks;
std::vector<ifc_sysCallback*> deleteMeAfterCallbacks;
bool inCallback;
volatile int reentry;
};
extern SysCallbacks system_callbacks;