Организация ввода-вывода. Часть 1. Виртуальные драйверы и виртуальное окружение WINDOWS. Рощин А.В. - 74 стр.

UptoLike

Составители: 

74
if (!fh)
{ DPRINTF(buf, "Error %x opening file %s\n", err, "vxdskel.log" );
}
else
{ _Sprintf(buf, "SysVMInit: VM=%x tcb=%x\r\n", hVM, tcb );
count = IFSMgr_Ring0_WriteFile(FALSE, fh, buf, strlen(buf), filepos, &err);
filepos += count;
}
return TRUE;
}
VOID OnSysVmTerminate(VMHANDLE hVM)
{ WORD err;
int count=0;
PTCB tcb;
tcb = Get_Initial_Thread_Handle(hVM);
DPRINTF( buf, "SysVmTerminate VM=%x tcb=%x\r\n", hVM, tcb );
_Sprintf( buf, "SysVmTerminate VM=%x tcb=%x\r\n", hVM, tcb );
count = IFSMgr_Ring0_WriteFile(FALSE, fh, buf, strlen(buf), filepos, &err);
filepos += count;
IFSMgr_Ring0_CloseFile( fh, &err );
}
BOOL OnCreateVm(VMHANDLE hVM)
{ PTCB tcb;
WORD err;
int count=0;
tcb = Get_Initial_Thread_Handle(hVM);
DPRINTF(buf, "Create_VM: VM=%x, tcb=%x\r\n", hVM, tcb);
_Sprintf(buf, "Create_VM: VM=%x, tcb=%x\r\n", hVM, tcb);
count = IFSMgr_Ring0_WriteFile(FALSE, fh, buf, strlen(buf), filepos, &err);
filepos += count;
return TRUE;
}
VOID OnDestroyVm(VMHANDLE hVM)
{ WORD err;
int count;
PTCB tcb;
tcb = Get_Initial_Thread_Handle(hVM);
DPRINTF(buf, "Destroy_VM: VM=%x tcb=%x\r\n", hVM, tcb );
_Sprintf(buf, "Destroy_VM: VM=%x tcb=%x\r\n", hVM, tcb );
count = IFSMgr_Ring0_WriteFile(FALSE, fh, buf, strlen(count), filepos, &err);
filepos += count;
}
                                            74



    if (!fh)
      { DPRINTF(buf, "Error %x opening file %s\n", err, "vxdskel.log" );
      }
    else
      { _Sprintf(buf, "SysVMInit: VM=%x tcb=%x\r\n", hVM, tcb );
         count = IFSMgr_Ring0_WriteFile(FALSE, fh, buf, strlen(buf), filepos, &err);
         filepos += count;
      }
     return TRUE;
}

VOID OnSysVmTerminate(VMHANDLE hVM)
{ WORD err;
  int  count=0;
  PTCB tcb;

    tcb = Get_Initial_Thread_Handle(hVM);
    DPRINTF( buf, "SysVmTerminate VM=%x tcb=%x\r\n", hVM, tcb );
    _Sprintf( buf, "SysVmTerminate VM=%x tcb=%x\r\n", hVM, tcb );
    count = IFSMgr_Ring0_WriteFile(FALSE, fh, buf, strlen(buf), filepos, &err);
    filepos += count;
    IFSMgr_Ring0_CloseFile( fh, &err );
}

BOOL OnCreateVm(VMHANDLE hVM)
{ PTCB tcb;
  WORD err;
  int count=0;

    tcb = Get_Initial_Thread_Handle(hVM);
    DPRINTF(buf, "Create_VM: VM=%x, tcb=%x\r\n", hVM, tcb);
    _Sprintf(buf, "Create_VM: VM=%x, tcb=%x\r\n", hVM, tcb);
    count = IFSMgr_Ring0_WriteFile(FALSE, fh, buf, strlen(buf), filepos, &err);
    filepos += count;
    return TRUE;
}

VOID OnDestroyVm(VMHANDLE hVM)
{ WORD err;
  int  count;
  PTCB tcb;

    tcb = Get_Initial_Thread_Handle(hVM);
    DPRINTF(buf, "Destroy_VM: VM=%x tcb=%x\r\n", hVM, tcb );
    _Sprintf(buf, "Destroy_VM: VM=%x tcb=%x\r\n", hVM, tcb );
    count = IFSMgr_Ring0_WriteFile(FALSE, fh, buf, strlen(count), filepos, &err);
    filepos += count;
}