svccb.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. #include "syscb/ifc_syscallback.h"
  3. #include "foundation/mkncc.h"
  4. namespace Service
  5. {
  6. // {215CDE06-22A6-424F-9C64-DEDC45D84455}
  7. static const GUID event_type =
  8. { 0x215cde06, 0x22a6, 0x424f, { 0x9c, 0x64, 0xde, 0xdc, 0x45, 0xd8, 0x44, 0x55 } };
  9. static const int on_register = 0;
  10. static const int on_deregister = 1;
  11. class SystemCallback : public ifc_sysCallback
  12. {
  13. protected:
  14. GUID WASABICALL SysCallback_GetEventType() { return event_type; }
  15. int WASABICALL SysCallback_Notify(int msg, intptr_t param1, intptr_t param2)
  16. {
  17. const GUID *service_id;
  18. switch(msg)
  19. {
  20. case on_register:
  21. service_id = (const GUID *)param1;
  22. return ServiceSystemCallback_OnRegister(*service_id, (void *)param2);
  23. case on_deregister:
  24. service_id = (const GUID *)param1;
  25. return ServiceSystemCallback_OnDeregister(*service_id, (void *)param2);
  26. default:
  27. return NErr_Success;
  28. }
  29. }
  30. virtual int WASABICALL ServiceSystemCallback_OnRegister(GUID service_id, void *service) { return NErr_Success; }
  31. virtual int WASABICALL ServiceSystemCallback_OnDeregister(GUID service_id, void *service) { return NErr_Success; }
  32. };
  33. }