Jungo WinDriver  
Official Documentation
wds_lib.h
Go to the documentation of this file.
1 /* @JUNGO_COPYRIGHT@ */
2 
3 #ifndef _WDS_LIB_H_
4 #define _WDS_LIB_H_
5 
6 /*********************************************************************
7 * File: wds_lib.h - WD Shared (WDS) library header. *
8 * This file defines the WDS library's high-level *
9 * interface *
10 **********************************************************************/
11 
12 #if defined(__KERNEL__)
13  #include "kpstdlib.h"
14 #endif
15 
16 #include "windrvr.h"
17 #include "wdc_lib.h"
18 
19 #ifdef __cplusplus
20  extern "C" {
21 #endif
22 
23 /**************************************************************
24  General definitions
25  **************************************************************/
26 
27 /* -------------------------------------------------------------------------
28  IPC
29  ------------------------------------------------------------------------- */
30 /* IPC API functions are not part of the standard WinDriver API, and not
31  * included in the standard version of WinDriver. The functions are part of
32  * "WinDriver for Server" API and require "WinDriver for Server" license.
33  * Note that "WinDriver for Server" APIs are included in WinDriver evaluation
34  * version. */
35 
37 typedef struct {
38  DWORD dwNumProcs;
41 
43 typedef struct {
44  DWORD dwSenderUID;
45  DWORD dwMsgID;
53 
54 
67 typedef void (*IPC_MSG_RX_HANDLER)(_In_ WDS_IPC_MSG_RX *pIpcRxMsg,
68  _In_ void *pData);
69 
79 
124 DWORD DLLCALLCONV WDS_IpcRegister(_In_ const CHAR *pcProcessName,
125  _In_ DWORD dwGroupID, _In_ DWORD dwSubGroupID, _In_ DWORD dwAction,
126  _In_ IPC_MSG_RX_HANDLER pFunc, _In_ void *pData);
127 
139 
156  _Outptr_ WDS_IPC_SCAN_RESULT *pIpcScanResult);
157 
158 
183 DWORD DLLCALLCONV WDS_IpcUidUnicast(_In_ DWORD dwRecipientUID,
184  _In_ DWORD dwMsgID, _In_ UINT64 qwMsgData);
185 
208 DWORD DLLCALLCONV WDS_IpcSubGroupMulticast(_In_ DWORD dwRecipientSubGroupID,
209  _In_ DWORD dwMsgID, _In_ UINT64 qwMsgData);
210 
229 DWORD DLLCALLCONV WDS_IpcMulticast(_In_ DWORD dwMsgID, _In_ UINT64 qwMsgData);
230 
231 /* -------------------------------------------------------------------------
232  Shared Buffers (User-Mode <-> Kernel Mode) / (User-Mode <-> User-Mode)
233  ------------------------------------------------------------------------- */
234 /*
235  * Kernel buffers can be used to share data between:
236  * 1) User-mode application and a Kernel PlugIn driver.
237  * 2) Multiple user-mode applications.
238  */
239 
274  _In_ DWORD dwOptions, _Outptr_ WD_KERNEL_BUFFER **ppKerBuf);
275 
276 
287 #define WDS_SharedBufferGetGlobalHandle(pKerBuf) ((pKerBuf)->hKerBuf)
288 
301  _Outptr_ WD_KERNEL_BUFFER **ppKerBuf);
302 
303 
323 
360 DWORD DLLCALLCONV WDS_SharedIntEnable(_In_ const CHAR *pcProcessName,
361  _In_ DWORD dwGroupID, _In_ DWORD dwSubGroupID, _In_ DWORD dwAction,
362  _In_ IPC_MSG_RX_HANDLER pFunc, _In_ void *pData);
363 
374 
375 
390 
391 
401 
402 #ifdef __cplusplus
403 }
404 #endif
405 
406 #endif /* _WDS_LIB_H_ */
407 
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 dwNumProcs
Number of matching processes.
Definition: wds_lib.h:38
IPC scan processes results.
Definition: wds_lib.h:37
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_IsIpcRegistered(void)
Enables the application to check if it is already registered with WinDriver IPC.
DWORD DLLCALLCONV WDS_SharedIntDisableGlobal(void)
Disables the Shared Interrupts mechanism of WinDriver for all processes.
DWORD DLLCALLCONV WDS_SharedIntDisableLocal(void)
Disables the Shared Interrupts mechanism of WinDriver for the current process.
DWORD DLLCALLCONV WDS_SharedBufferAlloc(_In_ UINT64 qwBytes, _In_ DWORD dwOptions, _Outptr_ WD_KERNEL_BUFFER **ppKerBuf)
Allocates a memory buffer that can be shared between the user mode and the kernel mode ("shared buffe...
DWORD DLLCALLCONV WDS_IpcRegister(_In_ const CHAR *pcProcessName, _In_ DWORD dwGroupID, _In_ DWORD dwSubGroupID, _In_ DWORD dwAction, _In_ IPC_MSG_RX_HANDLER pFunc, _In_ void *pData)
Registers an application with WinDriver IPC.
DWORD DLLCALLCONV WDS_IpcUidUnicast(_In_ DWORD dwRecipientUID, _In_ DWORD dwMsgID, _In_ UINT64 qwMsgData)
Sends a message to a specific process with WinDriver IPC unique ID.
BOOL DLLCALLCONV WDS_IsSharedIntsEnabledLocally(void)
Check and returns whether shared interrupts are enabled for the current process.
void DLLCALLCONV WDS_IpcUnRegister(void)
This function enables the user application to unregister with WinDriver IPC.
DWORD DLLCALLCONV WDS_SharedBufferGet(_In_ DWORD hKerBuf, _Outptr_ WD_KERNEL_BUFFER **ppKerBuf)
Retrieves a shared buffer which was allocated by another process.
void(* IPC_MSG_RX_HANDLER)(_In_ WDS_IPC_MSG_RX *pIpcRxMsg, _In_ void *pData)
WinDriver IPC message handler callback.
Definition: wds_lib.h:67
DWORD DLLCALLCONV WDS_IpcMulticast(_In_ DWORD dwMsgID, _In_ UINT64 qwMsgData)
Sends a message to all processes that were registered with the same group ID as the sending process.
DWORD DLLCALLCONV WDS_SharedBufferFree(_In_ WD_KERNEL_BUFFER *pKerBuf)
Frees a shared buffer that was allocated by a previous call to WDS_SharedBufferAlloc().
DWORD DLLCALLCONV WDS_IpcScanProcs(_Outptr_ WDS_IPC_SCAN_RESULT *pIpcScanResult)
Scans and returns information of all registered processes that share the application process groupID ...
DWORD DLLCALLCONV WDS_IpcSubGroupMulticast(_In_ DWORD dwRecipientSubGroupID, _In_ DWORD dwMsgID, _In_ UINT64 qwMsgData)
Sends a message to all processes that registered with the same sub-group ID.
#define _Outptr_
Definition: windrvr.h:40
@ WD_IPC_MAX_PROCS
Definition: windrvr.h:801
#define _In_
Definition: windrvr.h:37
unsigned __int64 UINT64
Definition: windrvr.h:314
#define DLLCALLCONV
Definition: windrvr.h:32