| 195 | } |
| 196 | |
| 197 | VOID |
| 198 | loaderEvtIoStop(_In_ WDFQUEUE Queue, _In_ WDFREQUEST Request, _In_ ULONG ActionFlags) |
| 199 | /*++ |
| 200 | |
| 201 | Routine Description: |
| 202 | |
| 203 | This event is invoked for a power-managed queue before the device leaves the working state (D0). |
| 204 | |
| 205 | Arguments: |
| 206 | |
| 207 | Queue - Handle to the framework queue object that is associated with the |
| 208 | I/O request. |
| 209 | |
| 210 | Request - Handle to a framework request object. |
| 211 | |
| 212 | ActionFlags - A bitwise OR of one or more WDF_REQUEST_STOP_ACTION_FLAGS-typed flags |
| 213 | that identify the reason that the callback function is being called |
| 214 | and whether the request is cancelable. |
| 215 | |
| 216 | Return Value: |
| 217 | |
| 218 | VOID |
| 219 | |
| 220 | --*/ |
| 221 | { |
| 222 | TraceEvents( |
| 223 | TRACE_LEVEL_INFORMATION, |
| 224 | TRACE_QUEUE, |
| 225 | "%!FUNC! Queue 0x%p, Request 0x%p ActionFlags %d", |
| 226 | Queue, |
| 227 | Request, |
| 228 | ActionFlags); |
| 229 | |
| 230 | // |
| 231 | // In most cases, the EvtIoStop callback function completes, cancels, or postpones |
| 232 | // further processing of the I/O request. |
| 233 | // |
| 234 | // Typically, the driver uses the following rules: |
| 235 | // |
| 236 | // - If the driver owns the I/O request, it calls WdfRequestUnmarkCancelable |
| 237 | // (if the request is cancelable) and either calls WdfRequestStopAcknowledge |
| 238 | // with a Requeue value of TRUE, or it calls WdfRequestComplete with a |
| 239 | // completion status value of STATUS_SUCCESS or STATUS_CANCELLED. |
| 240 | // |
| 241 | // Before it can call these methods safely, the driver must make sure that |
| 242 | // its implementation of EvtIoStop has exclusive access to the request. |
| 243 | // |
| 244 | // In order to do that, the driver must synchronize access to the request |
| 245 | // to prevent other threads from manipulating the request concurrently. |
| 246 | // The synchronization method you choose will depend on your driver's design. |
| 247 | // |
| 248 | // For example, if the request is held in a shared context, the EvtIoStop callback |
| 249 | // might acquire an internal driver lock, take the request from the shared context, |
| 250 | // and then release the lock. At this point, the EvtIoStop callback owns the request |
| 251 | // and can safely complete or requeue the request. |
| 252 | // |
| 253 | // - If the driver has forwarded the I/O request to an I/O target, it either calls |
| 254 | // WdfRequestCancelSentRequest to attempt to cancel the request, or it postpones |
nothing calls this directly
no outgoing calls
no test coverage detected