File tree Expand file tree Collapse file tree 1 file changed +43
-3
lines changed Expand file tree Collapse file tree 1 file changed +43
-3
lines changed Original file line number Diff line number Diff line change @@ -1326,16 +1326,56 @@ MmProtectMdlSystemAddress(IN PMDL MemoryDescriptorList,
1326
1326
}
1327
1327
1328
1328
/*
1329
- * @unimplemented
1329
+ * @implemented
1330
1330
*/
1331
1331
VOID
1332
1332
NTAPI
1333
- MmProbeAndLockProcessPages (IN OUT PMDL MemoryDescriptorList ,
1333
+ MmProbeAndLockProcessPages (IN OUT PMDL Mdl ,
1334
1334
IN PEPROCESS Process ,
1335
1335
IN KPROCESSOR_MODE AccessMode ,
1336
1336
IN LOCK_OPERATION Operation )
1337
1337
{
1338
- UNIMPLEMENTED ;
1338
+ PVOID Address ;
1339
+ NTSTATUS Status = STATUS_SUCCESS ;
1340
+
1341
+ BOOLEAN Attach ;
1342
+ KAPC_STATE ApcState ;
1343
+
1344
+ DPRINT ("Probing MDL: %p for process %p\n" , Mdl , Process );
1345
+ //
1346
+ // Get address information, to see if we really need to attach
1347
+ //
1348
+ Address = (PVOID )((ULONG_PTR )Mdl -> StartVa + Mdl -> ByteOffset );
1349
+
1350
+ Attach = ((Process != PsGetCurrentProcess ()) && (Address <= (PVOID )MM_USER_PROBE_ADDRESS ));
1351
+ if (Attach )
1352
+ {
1353
+ KeStackAttachProcess (& Process -> Pcb , & ApcState );
1354
+ }
1355
+
1356
+ _SEH2_TRY
1357
+ {
1358
+ MmProbeAndLockPages (Mdl , AccessMode , Operation );
1359
+ }
1360
+ _SEH2_EXCEPT (EXCEPTION_EXECUTE_HANDLER )
1361
+ {
1362
+ //
1363
+ // Oops :(
1364
+ //
1365
+ Status = _SEH2_GetExceptionCode ();
1366
+ }
1367
+ _SEH2_END ;
1368
+
1369
+ if (Attach )
1370
+ {
1371
+ KeUnstackDetachProcess (& ApcState );
1372
+ }
1373
+
1374
+ if (!NT_SUCCESS (Status ))
1375
+ {
1376
+ /* If the operation failed while we were attached, forward it to the caller */
1377
+ ExRaiseStatus (Status );
1378
+ }
1339
1379
}
1340
1380
1341
1381
You can’t perform that action at this time.
0 commit comments