Go Back   FlashFXP Forums > >

Programming Need help with C/C++/Delphi? Ask here and make us all laugh.

Closed Thread
 
Thread Tools Rate Thread Display Modes
Old 10-13-2005, 09:15 AM   #1
Jog
Member
ioFTPD Foundation User
 
Join Date: Jul 2003
Posts: 83
Default [REQ] Small Example On How Initialize And Using ioFTP Modules

I search for a small example in c on how initialize and use ioftpd modules.
For example how load user module and how use GetProc for get the procedure "User2Uid".
with no 'LNK2019 ... "int __cdecl User2Uid(char *)" (?User2Uid@@YAHPAD@Z) ...' error during compilation.
I use Visual Studio 2003 for compiling.

Thanks a lot.
Jog is offline  
Old 10-13-2005, 03:47 PM   #2
neoxed
Too much time...
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: May 2003
Posts: 1,326
Default

You have to resolve those functions yourself during module initialisation, using the GetProc function. There are four types of modules and each module has its own specific module structure and initialisation/deinitialisation functions. You have to export the appropriate initialisation functions (UserModuleInit, GroupModuleInit, EventInit, or MessageVariableInit), as well was as the appropriate deinitialisation function. ioFTPD will call the module initialisation function and will pass one of the following data structures:

USER_MODULE for user modules, store user files elsewhere (e.g. a SQL database backend).
GROUP_MODULE for group modules, store group files elsewhere (e.g. a SQL database backend).
EVENT_MODULE for event modules, triggered on events defined in ioFTPD.ini.
VARIABLE_MODULE for variable modules, add custom variables to message files.

Use the GetProc function (pointed to by the GetProc module structure member) to resolve the functions listed in ioFTPD’s headers. None of the functions in the ioFTPD’s headers are documented, although most are fairly self-explanatory. For more information see the following threads:

http://www.inicom.net/forum/showthread.php?t=11952
http://www.inicom.net/forum/showthread.php?t=11567
http://www.inicom.net/forum/showthread.php?t=11422

You should have a good understanding of C before writing an ioFTPD module; otherwise, you will probably be overwhelmed. Not that writing the module is complex, but it requires a fair bit of hacking (i.e. trial and error) and skill sets that beginners lack.
neoxed is offline  
Old 10-14-2005, 02:19 PM   #3
Jog
Member
ioFTPD Foundation User
 
Join Date: Jul 2003
Posts: 83
Default

very thanks for your reply, i try to export the user module initialization routine inserting :

__declspec(dllexport) BOOL User_StandardInit(LPUSER_MODULE);

in user.h and when try to call in main .cpp i recieve an error.
Jog is offline  
Old 10-14-2005, 02:44 PM   #4
neoxed
Too much time...
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: May 2003
Posts: 1,326
Default

First off, the name of the module initialisation is wrong. It must be UserModuleInit for user modules, as I said in my first post (please read it). Secondly, I cannot read your screen or the code you've written, so I have no idea what this error message is.
neoxed is offline  
Old 10-15-2005, 12:17 PM   #5
_panic_
Senior Member
Ultimate Scripter
 
Join Date: Jul 2005
Posts: 153
Default

jog,

i'm actually working on this exact thing, in order to provide a skeleton for people to use writing modules. i'm not ready to publish anything yet. (i haven't even tried to deal with dll export yet, which is what you are trying to figure out.)

if you want to post error messages and other specific issues, i'd be more than happy to try and lend a hand. i'll also try to speed up my own progress on this so i'm in a better position to help you with this particular issue.
_panic_ is offline  
Old 02-20-2006, 11:44 AM   #6
Jog
Member
ioFTPD Foundation User
 
Join Date: Jul 2003
Posts: 83
Default

I have correctly initialized and used group, user and variable modules, but on user module and group module , the only function wich work over the internal ioftpd routine, is the function pointed from lpUserModule->Create and lpGroupModule->Create in LPUSER_MODULE and LPGROUP_MODULE structure; for example this funcs now output a debug string or put a message in a log with no problems. I don't find any way of overwrite the internal ioftpd user/group routines for open,write,read,rename,delete users/group.
The modules is initialized correctly, on initialize put a message in ioFTPD.log.....
I have ask to panic and neoxed but , yours tips do not resolve my Problem (very thanks for support). I use ioftpd 5.8.7r and lastest sources headers included with 5.8.0r. (I have tried with other oldest version but no changes).

I have exported UserModuleInit/GroupModuleInit and filled LPUSER_MODULE and LPGROUP_MODULE , in tszModuleName,DeInitialize,Create,Delete,Rename,Lo ck,Write,Open,Close,Unlock; basically all functions write only a debug log when called, but only the function pointed to lpModule->Create, print this debug log; all other functions works as the user/group module not exist.

I'm wait any tips! Very thanks to anyone can help me.
Jog is offline  
Old 02-22-2006, 05:33 AM   #7
Jog
Member
ioFTPD Foundation User
 
Join Date: Jul 2003
Posts: 83
Default

Nobody can help me ?
Jog is offline  
Old 02-22-2006, 12:41 PM   #8
_panic_
Senior Member
Ultimate Scripter
 
Join Date: Jul 2005
Posts: 153
Default

Quote:
Originally Posted by Jog
Nobody can help me ?
i've still got some windows open looking into this, but nothing obvious is popping up yet. if i don't find anything, you might have to wait for me to catch up with you on module development.

so far, everything you're doing should work. i'm going to have to trace the code in the debugger to figure out why it isn't.
_panic_ is offline  
Old 02-22-2006, 01:42 PM   #9
Jog
Member
ioFTPD Foundation User
 
Join Date: Jul 2003
Posts: 83
Default

You have pm with full test code, i try to do correctly working. Thanks for support.
Jog is offline  
Old 02-22-2006, 01:47 PM   #10
_panic_
Senior Member
Ultimate Scripter
 
Join Date: Jul 2005
Posts: 153
Default

Quote:
Originally Posted by Jog
You have pm with full test code, i try to do correctly working. Thanks for support.
got it! i'll plop it in the debugger and get back to you.
_panic_ is offline  
Closed Thread

Tags
?user2uid@@yahpad@z, error, initialize, modules, small

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 03:33 PM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)