File tree 2 files changed +44
-0
lines changed 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -287,6 +287,11 @@ typedef struct _DEVICE_CONTEXT
287
287
//
288
288
HANDLE ConfigurationReloadWaitHandle ;
289
289
290
+ //
291
+ // Handle to shared memory for XInput Bridge DLL IPC
292
+ //
293
+ HANDLE XInputBridgeInputReportHandle ;
294
+
290
295
} DEVICE_CONTEXT , * PDEVICE_CONTEXT ;
291
296
292
297
//
Original file line number Diff line number Diff line change @@ -245,6 +245,40 @@ DMF_DsHidMini_Open(
245
245
//
246
246
numInstances ++ ;
247
247
248
+ //
249
+ // Admins & System: all access
250
+ // Everyone: read access
251
+ //
252
+ PWSTR szSD = L"D:(A;OICI;GA;;;BA)(A;OICI;GA;;;SY)(A;OICI;GR;;;WD)" ;
253
+ SECURITY_ATTRIBUTES sa ;
254
+ sa .nLength = sizeof (SECURITY_ATTRIBUTES );
255
+ sa .bInheritHandle = FALSE;
256
+ ConvertStringSecurityDescriptorToSecurityDescriptorW (
257
+ szSD ,
258
+ SDDL_REVISION_1 ,
259
+ & ((& sa )-> lpSecurityDescriptor ),
260
+ NULL
261
+ );
262
+
263
+ PCWSTR objName = L"Global\\MyFileMappingObject" ;
264
+
265
+ pDevCtx -> XInputBridgeInputReportHandle = CreateFileMappingW (
266
+ INVALID_HANDLE_VALUE ,
267
+ & sa ,
268
+ PAGE_READWRITE ,
269
+ 0 ,
270
+ sizeof (DS3_RAW_INPUT_REPORT ),
271
+ objName
272
+ );
273
+
274
+ if (pDevCtx -> XInputBridgeInputReportHandle == NULL )
275
+ {
276
+ TraceError (
277
+ TRACE_DSHIDMINIDRV ,
278
+ "Failed to create file mapping"
279
+ );
280
+ }
281
+
248
282
FuncExit (TRACE_DSHIDMINIDRV , "status=%!STATUS!" , status );
249
283
250
284
return status ;
@@ -279,6 +313,11 @@ DMF_DsHidMini_Close(
279
313
//
280
314
numInstances -- ;
281
315
316
+ if (pDevCtx -> XInputBridgeInputReportHandle )
317
+ {
318
+ CloseHandle (pDevCtx -> XInputBridgeInputReportHandle );
319
+ }
320
+
282
321
FuncExitNoReturn (TRACE_DSHIDMINIDRV );
283
322
}
284
323
You can’t perform that action at this time.
0 commit comments