Associated homework and completion port

xiaoxiao2021-03-06  118

// Completion Keys for the completion port

#define compKey_JobObject ((uint_ptr) 2)

Handle hjob = NULL;

Handle Hiocp;

hjob = createjobbject (null, text ("joblab")); // Create a job

Hiocp = createioCompletionPort (Invalid_Handle_Value, NULL, 0, 0); // Create a completed port

JobObject_associate_completion_port joacp; // Declaration Job Object Association Complete Port Structure

Joacp.completionKey = (pvoid) CompKey_JobObject; // Fill in the unique value in a job

Joacp.completionport = hiocp; / / Fill in the port handle

SetInformationJobiBject (hjob,

JobiCTASSociateCompletionPortInformation, & Joacp, SizeOf (JOACP))))

转载请注明原文地址:https://www.9cbs.com/read-98223.html

New Post(0)