View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000676 | Far Manager | Plugins API.Old API Wrapper | public | 2008-12-19 10:12 | 2008-12-19 19:48 |
Reporter | samlyukov | Assigned To | alexy | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Fixed in Version | 2.0 | ||||
Summary | 0000676: сделаем тогда уж и FarGetPluginDirListA() | ||||
Description | сабж, собственно. | ||||
Tags | No tags attached. | ||||
Build | 672 | ||||
2008-12-19 10:12
|
!work.diff (1,468 bytes)
Index: wrap.cpp =================================================================== --- wrap.cpp (revision 2311) +++ wrap.cpp (working copy) @@ -2465,7 +2465,49 @@ int WINAPI FarGetPluginDirListA(INT_PTR PluginNumber,HANDLE hPlugin,const char *Dir,struct oldfar::PluginPanelItem **pPanelItem,int *pItemsNumber) { - return FALSE; + if (!Dir || !*Dir || !pPanelItem || !pItemsNumber) + return FALSE; + + *pPanelItem=NULL; + *pItemsNumber=0; + + wchar_t *DirW=AnsiToUnicode(Dir); + if (!DirW) + return FALSE; + + PluginPanelItem *pPanelItemW; + int ItemsNumber; + int ret=FarGetPluginDirList(PluginNumber, hPlugin, DirW, &pPanelItemW, &ItemsNumber); + + xf_free(DirW); + + if (ret && ItemsNumber) + { + //+sizeof(int) ���� ������ ItemsNumber ��� � FarFreeDirListA ��� �� ���� ���� + *pPanelItem=(oldfar::PluginPanelItem *)xf_malloc(ItemsNumber*sizeof(oldfar::PluginPanelItem)+sizeof(int)); + + if (*pPanelItem) + { + *pItemsNumber = ItemsNumber; + + **((int **)pPanelItem) = ItemsNumber; + (*((int **)pPanelItem))++; + + memset(*pPanelItem,0,ItemsNumber*sizeof(oldfar::PluginPanelItem)); + + for (int i=0; i<ItemsNumber; i++) + { + ConvertPanelItemToAnsi(pPanelItemW[i],(*pPanelItem)[i]); + } + } + else + { + ret = FALSE; + } + + FarFreePluginDirList(pPanelItemW, ItemsNumber); + } + return ret; } void WINAPI FarFreeDirListA(const struct oldfar::PluginPanelItem *PanelItem) |
Date Modified | Username | Field | Change |
---|---|---|---|
2008-12-19 10:12 | samlyukov | New Issue | |
2008-12-19 10:12 | samlyukov | Status | new => assigned |
2008-12-19 10:12 | samlyukov | Assigned To | => alexy |
2008-12-19 10:12 | samlyukov | File Added: !work.diff | |
2008-12-19 19:48 | alexy | Build | => 672 |
2008-12-19 19:48 | alexy | Status | assigned => closed |
2008-12-19 19:48 | alexy | Resolution | open => fixed |
2008-12-19 19:48 | alexy | Fixed in Version | => 2.0 |