... procedure shellmessage(handle, flags : integer; const message, caption : pchar; callback, referencedata : pointer); stdcall; assembler; asm mov ebx, handle // virtual machine handle mov eax, flags // message box flags mov ecx, message // address of message text mov edi, caption // address of caption text mov esi, callback // address of callback mov edx, referencedata // reference data for callback
int 20h // vxdcall dd 170004h // shell_message end;
function sysdynamicdeviceinit : integer; begin shellmessage(0, $10, copyright, ’sysdyninit: hello from delphi vxd !!!’, nil, nil); result := vxd_success; end;
function sysdynamicdeviceexit : integer; begin shellmessage(0, $10, copyright, ’sysdyndevexit: bye from delphi vxd !!!’, nil, nil); result := vxd_success; end;
if (dwservice = dioc_open) then begin result := no_error; end else if (dwservice = dioc_closehandle) then begin result := vxd_success; end else if (dwservice > max_pasvxd_w32_api) then begin result := error_not_supported; end else begin result := vxd_success; end; end; ...
function tvxdtestform.openvxddriver: boolean; begin hvxdhandle := createfile(vxdname,0,0,nil,0,file_flag_delete_on_close,0); result := hvxdhandle <> invalid_handle_value; end;
procedure tvxdtestform.closevxddriver; begin if hvxdhandle <> invalid_handle_value then begin closehandle(hvxdhandle); hvxdhandle := invalid_handle_value; end; end