Jungo WinDriver  
Official Documentation

◆ WDS_SharedIntEnable()

DWORD DLLCALLCONV WDS_SharedIntEnable ( _In_ const CHAR *  pcProcessName,
_In_ DWORD  dwGroupID,
_In_ DWORD  dwSubGroupID,
_In_ DWORD  dwAction,
_In_ IPC_MSG_RX_HANDLER  pFunc,
_In_ void *  pData 
)

Enables the shared interrupts mechanism of WinDriver.

If the mechanism is already enabled globally (for all processes) then the mechanism is enabled for the current process.

Parameters
[in]pcProcessNameOptional process name string
[in]dwGroupIDA unique group ID represent the specific application. Must be a positive ID
[in]dwSubGroupIDSub-group ID that should identify your user application type in case you have several types that may work simultaneously. Must be a positive ID
[in]dwActionIPC message type to receive, which can consist one of the enumeration values listed below: WD_IPC_UNICAST_MSG: Receive a message to a specific process with WinDriver IPC unique ID WD_IPC_MULTICAST_MSG: Receive a message from all processes that were registered with the same group ID as this process WD_IPC_ALL_MSG: Receive both types of the messages above
[in]pFuncA user-mode IPC message handler callback function, which will be called when a message was received by WinDriver from Shared Interrupts IPC process occurs. (See IPC_MSG_RX_HANDLER())
[in]pDataData for the user-mode IPC message handler callback routine (pFunc)
Returns
Returns WD_STATUS_SUCCESS (0) on success, or an appropriate error code otherwise
static void ipc_shared_int_msg_event_cb(WDS_IPC_MSG_RX *pIpcRxMsg, void *pData)
{
printf("Shared Interrupt via IPC arrived:\nmsgID [0x%lx], msgData [0x%llx]"
" from process [0x%lx]\n\n", pIpcRxMsg->dwMsgID, pIpcRxMsg->qwMsgData,
pIpcRxMsg->dwSenderUID);
}
static DWORD IpcSharedIntsEnable(void)
{
DWORD dwSubGroupID = 0; // Or any other you choose
DWORD dwStatus;
{
printf("%s: Shared interrupts already enabled locally.\n",
}
/* WDS_SharedIntEnable() is called in this sample with pFunc=
ipc_shared_int_msg_event_cb. This will cause a shared interrupt to invoke
both this callback and the callback passed to WDS_IpcRegister().
To disable the "general" IPC callback, pass pFunc=NULL in the above
mentioned call.
Note you can replace pFunc here with your own callback especially designed
to handle interrupts */
dwStatus = WDS_SharedIntEnable(DEFAULT_SHARED_INT_NAME,
DEFAULT_PROCESS_GROUP_ID, dwSubGroupID, WD_IPC_ALL_MSG,
ipc_shared_int_msg_event_cb, NULL /* Your cb ctx */);
if (WD_STATUS_SUCCESS != dwStatus)
{
printf("%s: Failed enabling shared interrupts via IPC. "
"Error [0x%lx - %s]\n", __FUNCTION__, dwStatus, Stat2Str(dwStatus));
return 0;
}
printf("Shared interrupts via IPC enabled successfully\n");
return dwSubGroupID;
}
#define NULL
Definition: kpstdlib.h:268
const char *DLLCALLCONV Stat2Str(_In_ DWORD dwStatus)
Retrieves the status string that corresponds to a status code.
DWORD dwSenderUID
WinDriver IPC unique ID of the sending process.
Definition: wds_lib.h:44
DWORD dwMsgID
A 32 bit unique number defined by the user application.
Definition: wds_lib.h:45
UINT64 qwMsgData
Optional - 64 bit additional data from the sending user-application process.
Definition: wds_lib.h:50
IPC message received.
Definition: wds_lib.h:43
DWORD DLLCALLCONV WDS_SharedIntEnable(_In_ const CHAR *pcProcessName, _In_ DWORD dwGroupID, _In_ DWORD dwSubGroupID, _In_ DWORD dwAction, _In_ IPC_MSG_RX_HANDLER pFunc, _In_ void *pData)
Enables the shared interrupts mechanism of WinDriver.
BOOL DLLCALLCONV WDS_IsSharedIntsEnabledLocally(void)
Check and returns whether shared interrupts are enabled for the current process.
#define WD_IPC_ALL_MSG
Definition: windrvr.h:1474
@ WD_STATUS_SUCCESS
[0] Operation completed successfully
Definition: windrvr.h:1061
@ WD_OPERATION_ALREADY_DONE
[0x20000011] Operation Already Done.
Definition: windrvr.h:1141
#define __FUNCTION__
Definition: windrvr.h:52