partimage
J:\portage\sys-block\partimage\partimage-0.6.9.chm::/index.html
#服务端
root/src/server/partimaged-main.cpp
main
350 Initialize();
416 try { g_Server = new CNetServer(nServerPort); }
425 g_Window = new CPartimagedInterfaceNewt();
while(1)
432 try { client = g_Server->AcceptClient(); }
partimaged(&client); // child process, 服务进程
mess = new CMessages;
97 case MSG_NEWOPTIONS:
99 cid -> set_options(&options);
104 case MSG_GETSPACE:
106 try { cid -> getFreeSpace(&qwAux); }
118 case MSG_WRITE:
131 try { cid -> write(buf, n, &nRes); }
134 mess->setMessage(MSG_ERROR, (DWORD) excep->GetExcept());
146 case MSG_OPENW:
149 try { cid -> openWriting(); }
159 g_Window->SetLocation(nClient, cid->get_szImageFilename());
162 case MSG_READ:
173 try { dwRes = cid -> read(buf, m_size); }
188 case MSG_CLOSE:
190 try { cid -> close(); }
200 case MSG_OPENR:
203 g_Window->SetLocation(nClient, cid->get_szImageFilename());
204 try { cid -> openReading(); }
214 case MSG_DOESFILEEXIST:
217 b = cid -> doesFileExists(buf);
222 case MSG_GETDISKSPACEFILE:
224 cid -> getDiskFreeSpaceForFile(&qwAux, buf);
228 case MSG_GET_C:
230 n = cid -> getCompressionLevelForImage(buf);
235 case MSG_GETFILESIZE:
237 cid -> getFileSize(&qwAux, buf);
241 case MSG_SET_IO:
242 cid -> set_bIsOpened(m_size?true:false);
244 case MSG_SET_P:
253 cid -> set_szPath(buf);
255 case MSG_SET_IF:
264 cid -> set_szImageFilename(buf);
266 case MSG_SET_OF:
275 cid -> set_szOriginalFilename(buf);
278 case MSG_GET_CVS:
279 cid -> get_qwCurrentVolumeSize(&qwAux);
283 case MSG_GET_IO:
284 bAux = cid -> get_bIsOpened();
288 case MSG_GET_P:
289 szAux = cid -> get_szPath();
295 case MSG_GET_IF:
296 szAux = cid -> get_szImageFilename();
302 case MSG_GET_OF:
303 szAux = cid -> get_szOriginalFilename();
309 case MSG_QUIT:
314 case MSG_MOUNTIMAGELOCATION:
346 dwAux = cid -> mountImageLocation(szMountDevice, szMountPoint,
354 case MSG_UMOUNTIMAGELOCATION:
365 dwAux = cid -> umountImageLocation(szMountPoint);
#==========================================================================
客户端 部分, 注册 文件系统 ,
afs base ext2 fat hfs hpfs jfs ntfs reiser ufs xfs
#文件系统的基类是
61 class CFSBase
void saveUsedBlocksToImageFile(COptions *options);
void restoreUsedBlocksToDisk(COptions *options);
void saveToImage(CImage *image, COptions *options, CSavingWindow *gui);
void restoreFromImage(CImage *image, COptions *options, CRestoringWindow *gui);
int getStdInfos(char *szDest, int nMaxLen, bool bShowBlocksInfo);
int readData(void *cBuffer, QWORD qwOffset, DWORD dwLength);
int calculateSpaceFromBitmap();
int checkBitmapInfos();
void setSuperBlockInfos(BOOL bCheckSuperBlockUsedSize, BOOL bCheckSuperBlockFreeSize, QWORD qwSuperBlockUsedSize, QWORD qwSuperBlockFreeSize, BOOL bCanBeMore=false);