include vkd.inc VxDcall VKD_Start_Paste |
The VKD_Start_Paste service puts a virtual machine into paste mode by simulating keyboard activity with key strokes taken from the specified paste buffer. Depending on the mode set with the VKD_Define_Paste_Mode service, VKD waits for the virtual machine to poll the keyboard BIOS through its Interrupt 16h interface. If the virtual machine does keyboard input through the BIOS, then VKD simulates the keyboard input at this high level (plugging in ASCII codes). If the virtual machine fails to perform any Interrupt 16h within in a time-out period, or the mode has been set to avoid Interrupt 16h pasting, the VKD simulates the necessary hardware interrupts to perform the pasting. Hot keys are still processed while pasting is in progress.
EAX
Points to the paste buffer containing an array of key structures having the following form:
OEM_ASCII_value db ?
scan_code db ?
shift_state dw ?
The shift_state field is 02h if a shift key is down and 04h is a CTRL key is down.
The scan_code is 0FFh and the shift_state 0FFFFh, if the VKD should convert the key to a ALT+numpad sequence. This information is identical to what is given by the Window's keyboard routine OEMKeyScan.
EBX
Specifies the virtual machine handle.
ECX
Specifies the number of paste entries in the paste buffer.
ESI
Points to callback procedure. This parameter can be 0. For more information about the callback procedure, see the following “Comments” section.
EDX
Points to reference data to pass to the callback procedure.
The carry flag is clear if the paste is started. Otherwise, the carry flag is set to indicate an error, such as insufficient memory to copy from the buffer.
The callback procedure is called when the paste is complete or canceled. The callback receives the following input parameters:
EAX ; Completion flags
; Paste_Complete - paste completed successfully
; Paste_Aborted - paste canceled by user
; Paste_VM_Term - paste canceled because virtual machine
; terminated
EBX ; handle of virtual machine receiving the paste
EDX ; reference data
The procedure can modify EAX, EBX, ECX, EDX, ESI, EDI, and Flags.
Flags