TC can't use my plugin
Moderators: Hacker, petermad, Stefan2, white
TC can't use my plugin
I have one problem with my plugin made in MSVS .NET 2003.
This is packer plugin, but TC can't use it. I checked exported functions (with fileinfo.wlx plugin), functions (names, calling convention, etc.) and everything is correct, but I can't use it. It doesn't appear in 3rd party packers list in Pack dialog and TC displays "Copy ..." instead of "Pack ..." in that dialog. But even if I press "OK" button, an error message appears.
I recompiled some plugins that were made in MSVS 6.0 and they worked correctly, so it's nothing wrong with compiler/linker.
I tried different compiler/linker settings, but it didn't help. What's wrong?
This is packer plugin, but TC can't use it. I checked exported functions (with fileinfo.wlx plugin), functions (names, calling convention, etc.) and everything is correct, but I can't use it. It doesn't appear in 3rd party packers list in Pack dialog and TC displays "Copy ..." instead of "Pack ..." in that dialog. But even if I press "OK" button, an error message appears.
I recompiled some plugins that were made in MSVS 6.0 and they worked correctly, so it's nothing wrong with compiler/linker.
I tried different compiler/linker settings, but it didn't help. What's wrong?
Sorry for my English. Sometimes it may be very confused. 

2Dinosaur
Hi,
I would really like to help you but you need to provide some more information.
These steps could help:
1) Tell us the content of the displayed error message (In english).
2) Tell us the line which has been added in the [PackerPlugin] section of your Wincmd.ini (if any).
3) Provide a link where to download the current version of your plugin.
Hi,
I would really like to help you but you need to provide some more information.
These steps could help:
1) Tell us the content of the displayed error message (In english).
2) Tell us the line which has been added in the [PackerPlugin] section of your Wincmd.ini (if any).
3) Provide a link where to download the current version of your plugin.
1. If I try to pack files with my plugin, TC displays "Error packing files!" message.
2. Line in wincmd.ini is "dpf=0,F:\TotalCommander\plugins\wcx\dpf\dpf.wcx". Plugin can create and modify archives.
3. Sorry, but I can't provide my plugin for downloading because I don't have my web site and it (plugin) is intended for my own use only (at least, in its current state). I could attach it to this post, but this forum doesn't support attachments.
In fact, some research discovered that plugin is loaded successfully (LoadLibrary() doesn't fail), all existing functions are detected by TC, but TC just doesn't call them.
2. Line in wincmd.ini is "dpf=0,F:\TotalCommander\plugins\wcx\dpf\dpf.wcx". Plugin can create and modify archives.
3. Sorry, but I can't provide my plugin for downloading because I don't have my web site and it (plugin) is intended for my own use only (at least, in its current state). I could attach it to this post, but this forum doesn't support attachments.

In fact, some research discovered that plugin is loaded successfully (LoadLibrary() doesn't fail), all existing functions are detected by TC, but TC just doesn't call them.

Sorry for my English. Sometimes it may be very confused. 

this could be the problem. 0 means the plugin cannot pack files! Could you post your code for GetPackerCaps here?Line in wincmd.ini is "dpf=0,F:\TotalCommander\plugins\wcx\dpf\dpf.wcx"
Make sure you have exported this function.
here is an example
Code: Select all
int __stdcall GetPackerCaps()
{
return PK_CAPS_NEW | PK_CAPS_MODIFY;
}
Here is code of all functions (redundant parts were removed):
After running TC under debugger and some work debug output window contains only:
Code: Select all
#define WIN32_LEAN_AND_MEAN
#define STRICT
#include <windows.h>
#include <crtdbg.h>
#include <wcxhead.h>
#include "DPF.h"
// Data processing progress callback function
tProcessDataProc processData;
BOOL WINAPI DllMain (HINSTANCE, DWORD, void*)
{
_RPT0(_CRT_WARN, "DllMain()\n");
_CrtDumpMemoryLeaks();
return TRUE;
}
HANDLE __stdcall OpenArchive (tOpenArchiveData* archiveData)
{
_RPT1(_CRT_WARN, "OpenArchive(\"%s\")\n", archiveData->ArcName);
return NULL;
}
int __stdcall ReadHeader (HANDLE arcData, tHeaderData* headerData)
{
_RPT0(_CRT_WARN, "ReadHeader()\n");
return E_END_ARCHIVE;
}
int __stdcall ProcessFile (HANDLE arcData, int operation, char* destPath, char* destName)
{
_RPT0(_CRT_WARN, "ProcessFile()\n");
return 0;
}
int __stdcall CloseArchive (HANDLE arcData)
{
_RPT0(_CRT_WARN, "CloseArchive()\n");
return 0;
}
int __stdcall PackFiles (char* packedFile, char* subPath, char* srcPath, char* addList, int flags)
{
_RPT1(_CRT_WARN, "PackFiles(\"%s\", ...)\n", packedFile);
return 0;
}
int __stdcall DeleteFiles (char* packedFile, char* deleteList)
{
_RPT1(_CRT_WARN, "DeleteFiles(\"%s\", ...)\n", packedFile);
return E_NOT_SUPPORTED;
}
int __stdcall GetPackerCaps ()
{
_RPT0(_CRT_WARN, "GetPackerCaps()\n");
return (PK_CAPS_NEW | PK_CAPS_MULTIPLE);
}
void __stdcall ConfigurePacker (HWND parentWnd, HINSTANCE instance)
{
_RPT0(_CRT_WARN, "ConfigurePacker()\n");
}
void __stdcall SetProcessDataProc (HANDLE arcData, tProcessDataProc processDataProc)
{
_RPT0(_CRT_WARN, "SetProcessDataProc()\n");
processData = processDataProc;
}
BOOL __stdcall CanYouHandleThisFile (char* fileName)
{
_RPT1(_CRT_WARN, "CanYouHandleThisFile(\"%s\")\n", fileName);
return TRUE;
}
void __stdcall PackSetDefaultParams (PackDefaultParamStruct*)
{
_RPT0(_CRT_WARN, "PackSetDefaultParams()\n");
}
...
DllMain()
DllMain()
...
Sorry for my English. Sometimes it may be very confused. 

- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
2Dinosaur
Try changing the line in wincmd.ini manually to
dpf=3,F:\TotalCommander\plugins\wcx\dpf\dpf.wcx
and restart TC.
To make GetPackerCaps work, make sure that it is listed in the .def file, otherwise it will be exported with name mangling.
Try changing the line in wincmd.ini manually to
dpf=3,F:\TotalCommander\plugins\wcx\dpf\dpf.wcx
and restart TC.
To make GetPackerCaps work, make sure that it is listed in the .def file, otherwise it will be exported with name mangling.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Yes, TC added my plugin to list of packers, but message "Error packing files!" still appears.ghisler(Author) wrote:Try changing the line in wincmd.ini manually to
dpf=3,F:\TotalCommander\plugins\wcx\dpf\dpf.wcx
and restart TC.
Yes, it's listed. I told that I ran TC under APISpy and monitored all API calls related to DLLs. TC loads and gets all functions addresses successfully, but can't use it. It just doesn't call my functions!ghisler(Author) wrote:To make GetPackerCaps work, make sure that it is listed in the .def file, otherwise it will be exported with name mangling.
Sorry for my English. Sometimes it may be very confused. 

2Dinosaur
I received your plugin, thanks.
---------------------------
PackSetDefaultParams()
---------------------------
If you see this message, then something happened and plugin became useable.
Please let me know about this.
Thank you.
---------------------------
OK
---------------------------
As you see I could solve your problem. Add SetChangeVolProc and it will work. I have tested it.
2ghisler (author)
Maybe the packer plugin sdk should be updated to inform all authors that all callbacks must be exported.
I received your plugin, thanks.
---------------------------
PackSetDefaultParams()
---------------------------
If you see this message, then something happened and plugin became useable.
Please let me know about this.
Thank you.
---------------------------
OK
---------------------------
As you see I could solve your problem. Add SetChangeVolProc and it will work. I have tested it.
2ghisler (author)
Maybe the packer plugin sdk should be updated to inform all authors that all callbacks must be exported.
2Lefteous
Oh, thank you very very much!
I spent so much time and nerves on searching source of problem and this source was to trivial...
2ghisler(Author)
You may do as Lefteous said, but my suggestion is just to ignore callbacks that aren't exported.
Oh, thank you very very much!
I spent so much time and nerves on searching source of problem and this source was to trivial...

2ghisler(Author)
You may do as Lefteous said, but my suggestion is just to ignore callbacks that aren't exported.
Sorry for my English. Sometimes it may be very confused. 
