本文整理汇总了C++中RealHandle函数的典型用法代码示例。如果您正苦于以下问题:C++ RealHandle函数的具体用法?C++ RealHandle怎么用?C++ RealHandle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RealHandle函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: DOS_FCBWrite
Bit8u DOS_FCBWrite(Bit16u seg,Bit16u offset,Bit16u recno) {
DOS_FCB fcb(seg,offset);
Bit8u fhandle,cur_rec;Bit16u cur_block,rec_size;
fcb.GetSeqData(fhandle,rec_size);
if (fhandle==0xff && rec_size!=0) {
if (!DOS_FCBOpen(seg,offset)) return FCB_READ_NODATA;
LOG(LOG_FCB,LOG_WARN)("Reopened closed FCB");
fcb.GetSeqData(fhandle,rec_size);
}
fcb.GetRecord(cur_block,cur_rec);
Bit32u pos=((cur_block*128)+cur_rec)*rec_size;
if (!DOS_SeekFile(fhandle,&pos,DOS_SEEK_SET)) return FCB_ERR_WRITE;
MEM_BlockRead(Real2Phys(dos.dta())+recno*rec_size,dos_copybuf,rec_size);
Bit16u towrite=rec_size;
if (!DOS_WriteFile(fhandle,dos_copybuf,&towrite)) return FCB_ERR_WRITE;
Bit32u size;Bit16u date,time;
fcb.GetSizeDateTime(size,date,time);
if (pos+towrite>size) size=pos+towrite;
//time doesn't keep track of endofday
date = DOS_PackDate(dos.date.year,dos.date.month,dos.date.day);
Bit32u ticks = mem_readd(BIOS_TIMER);
Bit32u seconds = (ticks*10)/182;
Bit16u hour = (Bit16u)(seconds/3600);
Bit16u min = (Bit16u)((seconds % 3600)/60);
Bit16u sec = (Bit16u)(seconds % 60);
time = DOS_PackTime(hour,min,sec);
Bit8u temp=RealHandle(fhandle);
Files[temp]->time=time;
Files[temp]->date=date;
fcb.SetSizeDateTime(size,date,time);
if (++cur_rec>127) { cur_block++;cur_rec=0; }
fcb.SetRecord(cur_block,cur_rec);
return FCB_SUCCESS;
}
开发者ID:alivesay,项目名称:dosbox-r3910-glsl,代码行数:34,代码来源:dos_files.cpp
示例2: DOS_FCBIncreaseSize
Bit8u DOS_FCBIncreaseSize(Bit16u seg,Bit16u offset) {
DOS_FCB fcb(seg,offset);
Bit8u fhandle,cur_rec;Bit16u cur_block,rec_size;
fcb.GetSeqData(fhandle,rec_size);
fcb.GetRecord(cur_block,cur_rec);
Bit32u pos=((cur_block*128)+cur_rec)*rec_size;
if (!DOS_SeekFile(fhandle,&pos,DOS_SEEK_SET)) return FCB_ERR_WRITE;
Bit16u towrite=0;
if (!DOS_WriteFile(fhandle,dos_copybuf,&towrite)) return FCB_ERR_WRITE;
Bit32u size;Bit16u date,time;
fcb.GetSizeDateTime(size,date,time);
if (pos+towrite>size) size=pos+towrite;
//time doesn't keep track of endofday
date = DOS_PackDate(dos.date.year,dos.date.month,dos.date.day);
Bit32u ticks = mem_readd(BIOS_TIMER);
Bit32u seconds = (ticks*10)/182;
Bit16u hour = (Bit16u)(seconds/3600);
Bit16u min = (Bit16u)((seconds % 3600)/60);
Bit16u sec = (Bit16u)(seconds % 60);
time = DOS_PackTime(hour,min,sec);
Bit8u temp=RealHandle(fhandle);
Files[temp]->time=time;
Files[temp]->date=date;
fcb.SetSizeDateTime(size,date,time);
fcb.SetRecord(cur_block,cur_rec);
return FCB_SUCCESS;
}
开发者ID:Avin15,项目名称:dospad,代码行数:27,代码来源:dos_files.cpp
示例3: DOS_DuplicateEntry
bool DOS_DuplicateEntry(Bit16u entry,Bit16u * newentry) {
// Dont duplicate console handles
/* if (entry<=STDPRN) {
*newentry = entry;
return true;
};
*/
Bit8u handle=RealHandle(entry);
if (handle>=DOS_FILES) {
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
};
if (!Files[handle] || !Files[handle]->IsOpen()) {
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
};
DOS_PSP psp(dos.psp());
*newentry = psp.FindFreeFileEntry();
if (*newentry==0xff) {
DOS_SetError(DOSERR_TOO_MANY_OPEN_FILES);
return false;
}
Files[handle]->AddRef();
psp.SetFileHandle(*newentry,handle);
return true;
}
开发者ID:svn2github,项目名称:dosbox,代码行数:26,代码来源:dos_files.cpp
示例4: BeforeHandle
void BasicHandler::Run()
{
BeforeHandle();
RealHandle(m_request_data, &m_response_data);
AfterHandler();
m_done->Run();
}
开发者ID:kanxue,项目名称:horoscope,代码行数:8,代码来源:basic_handler.cpp
示例5: DOS_GetSTDINStatus
bool DOS_GetSTDINStatus(void)
{
Bit32u handle = RealHandle(STDIN);
if (handle == 0xFF)
return false;
if (Files[handle] && (Files[handle]->GetInformation() & 64))
return false;
return true;
}
开发者ID:rhenssel,项目名称:vDos,代码行数:9,代码来源:dos_ioctl.cpp
示例6: DOS_FlushFile
bool DOS_FlushFile(Bit16u entry)
{
Bit32u handle = RealHandle(entry);
if (handle >= DOS_FILES || !Files[handle])
{
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
}
return true;
}
开发者ID:rhenssel,项目名称:vDos,代码行数:10,代码来源:dos_files.cpp
示例7: DOS_LockFile
bool DOS_LockFile(Bit16u entry, Bit8u mode, Bit32u pos, Bit32u size)
{
Bit32u handle = RealHandle(entry);
if (handle >= DOS_FILES || !Files[handle])
{
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
}
return Files[handle]->LockFile(mode, pos, size);
}
开发者ID:rhenssel,项目名称:vDos,代码行数:10,代码来源:dos_files.cpp
示例8: DOS_SeekFile
bool DOS_SeekFile(Bit16u entry, Bit32u* pos, Bit32u type)
{
Bit32u handle = RealHandle(entry);
if (handle >= DOS_FILES || !Files[handle])
{
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
}
return Files[handle]->Seek(pos, type);
}
开发者ID:rhenssel,项目名称:vDos,代码行数:10,代码来源:dos_files.cpp
示例9: DOS_ReadFile
bool DOS_ReadFile(Bit16u entry, Bit8u* data, Bit16u* amount)
{
Bit32u handle = RealHandle(entry);
if (handle >= DOS_FILES || !Files[handle])
{
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
}
return Files[handle]->Read(data, amount);
}
开发者ID:rhenssel,项目名称:vDos,代码行数:10,代码来源:dos_files.cpp
示例10: DOS_SeekFile
bool DOS_SeekFile(Bit16u entry,Bit32u * pos,Bit32u type,bool fcb) {
Bit32u handle = fcb?entry:RealHandle(entry);
if (handle>=DOS_FILES) {
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
};
if (!Files[handle] || !Files[handle]->IsOpen()) {
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
};
return Files[handle]->Seek(pos,type);
}
开发者ID:svn2github,项目名称:dosbox,代码行数:12,代码来源:dos_files.cpp
示例11: DOS_ForceDuplicateEntry
bool DOS_ForceDuplicateEntry(Bit16u entry, Bit16u newentry)
{
if (entry == newentry)
{
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
}
Bit8u orig = RealHandle(entry);
if (orig >= DOS_FILES || !Files[orig])
{
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
}
Bit8u newone = RealHandle(newentry);
if (newone < DOS_FILES && Files[newone])
DOS_CloseFile(newentry);
DOS_PSP psp(dos.psp());
Files[orig]->AddRef();
psp.SetFileHandle(newentry, orig);
return true;
}
开发者ID:rhenssel,项目名称:vDos,代码行数:21,代码来源:dos_files.cpp
示例12: DOS_FlushFile
bool DOS_FlushFile(Bit16u entry) {
Bit32u handle=RealHandle(entry);
if (handle>=DOS_FILES) {
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
};
if (!Files[handle] || !Files[handle]->IsOpen()) {
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
};
LOG(LOG_DOSMISC,LOG_NORMAL)("FFlush used.");
return true;
}
开发者ID:svn2github,项目名称:dosbox,代码行数:13,代码来源:dos_files.cpp
示例13: DOS_GetFileDate
bool DOS_GetFileDate(Bit16u entry, Bit16u* otime, Bit16u* odate)
{
Bit32u handle = RealHandle(entry);
if (handle >= DOS_FILES || !Files[handle])
{
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
}
Files[handle]->UpdateDateTimeFromHost();
*otime = Files[handle]->time;
*odate = Files[handle]->date;
return true;
}
开发者ID:rhenssel,项目名称:vDos,代码行数:13,代码来源:dos_files.cpp
示例14: DOS_FCBGetFileSize
bool DOS_FCBGetFileSize(Bit16u seg,Bit16u offset) {
char shortname[DOS_PATHLENGTH];Bit16u entry;Bit8u handle;Bit16u rec_size;
DOS_FCB fcb(seg,offset);
fcb.GetName(shortname);
if (!DOS_OpenFile(shortname,OPEN_READ,&entry)) return false;
handle = RealHandle(entry);
Bit32u size = 0;
Files[handle]->Seek(&size,DOS_SEEK_END);
DOS_CloseFile(entry);fcb.GetSeqData(handle,rec_size);
Bit32u random=(size/rec_size);
if (size % rec_size) random++;
fcb.SetRandom(random);
return true;
}
开发者ID:Avin15,项目名称:dospad,代码行数:14,代码来源:dos_files.cpp
示例15: sSave
void DOS_FCB::FileOpen(Bit8u _fhandle) {
sSave(sFCB,drive,GetDrive()+1);
sSave(sFCB,file_handle,_fhandle);
sSave(sFCB,cur_block,0);
sSave(sFCB,rec_size,128);
// sSave(sFCB,rndm,0); // breaks Jewels of darkness.
Bit8u temp = RealHandle(_fhandle);
Bit32u size = 0;
Files[temp]->Seek(&size,DOS_SEEK_END);
sSave(sFCB,filesize,size);
size = 0;
Files[temp]->Seek(&size,DOS_SEEK_SET);
sSave(sFCB,time,Files[temp]->time);
sSave(sFCB,date,Files[temp]->date);
}
开发者ID:dborth,项目名称:dosbox-wii,代码行数:15,代码来源:dos_classes.cpp
示例16: DOS_WriteFile
bool DOS_WriteFile(Bit16u entry, Bit8u* data, Bit16u* amount)
{
Bit32u handle = RealHandle(entry);
if (handle >= DOS_FILES || !Files[handle])
{
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
}
/*
if ((Files[handle]->flags & 0x0f) == OPEN_READ)) {
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
}
*/
return Files[handle]->Write(data, amount);
}
开发者ID:rhenssel,项目名称:vDos,代码行数:16,代码来源:dos_files.cpp
示例17: DOS_CloseFile
bool DOS_CloseFile(Bit16u entry)
{
Bit32u handle = RealHandle(entry);
if (handle >= DOS_FILES || !Files[handle])
{
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
}
Files[handle]->Close();
DOS_PSP psp(dos. psp());
psp.SetFileHandle(entry, 0xff);
if (Files[handle]->RemoveRef() <= 0)
{
delete Files[handle];
Files[handle] = 0;
}
return true;
}
开发者ID:rhenssel,项目名称:vDos,代码行数:19,代码来源:dos_files.cpp
示例18: DOS_WriteFile
bool DOS_WriteFile(Bit16u entry,Bit8u * data,Bit16u * amount,bool fcb) {
Bit32u handle = fcb?entry:RealHandle(entry);
if (handle>=DOS_FILES) {
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
};
if (!Files[handle] || !Files[handle]->IsOpen()) {
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
};
/*
if ((Files[handle]->flags & 0x0f) == OPEN_READ)) {
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
}
*/
Bit16u towrite=*amount;
bool ret=Files[handle]->Write(data,&towrite);
*amount=towrite;
return ret;
}
开发者ID:svn2github,项目名称:dosbox,代码行数:21,代码来源:dos_files.cpp
示例19: DOS_ReadFile
bool DOS_ReadFile(Bit16u entry,Bit8u * data,Bit16u * amount) {
Bit32u handle=RealHandle(entry);
if (handle>=DOS_FILES) {
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
};
if (!Files[handle] || !Files[handle]->IsOpen()) {
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
};
/*
if ((Files[handle]->flags & 0x0f) == OPEN_WRITE)) {
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
}
*/
Bit16u toread=*amount;
bool ret=Files[handle]->Read(data,&toread);
*amount=toread;
return ret;
}
开发者ID:Avin15,项目名称:dospad,代码行数:21,代码来源:dos_files.cpp
示例20: DOS_CloseFile
bool DOS_CloseFile(Bit16u entry, bool fcb) {
Bit32u handle = fcb?entry:RealHandle(entry);
if (handle>=DOS_FILES) {
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
};
if (!Files[handle]) {
DOS_SetError(DOSERR_INVALID_HANDLE);
return false;
};
if (Files[handle]->IsOpen()) {
Files[handle]->Close();
}
DOS_PSP psp(dos.psp());
if (!fcb) psp.SetFileHandle(entry,0xff);
if (Files[handle]->RemoveRef()<=0) {
delete Files[handle];
Files[handle]=0;
}
return true;
}
开发者ID:svn2github,项目名称:dosbox,代码行数:23,代码来源:dos_files.cpp
注:本文中的RealHandle函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论