Go Back   FlashFXP Forums > Community Chatter > Programming

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

Closed Thread
 
Thread Tools Rate Thread
Old 06-14-2003, 10:57 AM   #1
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 2,022
Default shared memory not working ?

on ioftpd 4.9.4r
to use shared memory, in the initialisation, i do:

Code:
hShell32	= LoadLibrary("shell32.dll");
if ( Target && hShell32 )
{
  Allocate	= GetProcAddress(hShell32, "SHAllocShared");
  Free	= GetProcAddress(hShell32, "SHFreeShared");
  Unlock	= GetProcAddress(hShell32, "SHUnlockShared");
  Lock	= GetProcAddress(hShell32, "SHLockShared");

  if ( Allocate && Free && Lock && Unlock && hTarget )
  { ... }
  else {
  LPVOID lpMsgBuf;
    FormatMessage( 
    FORMAT_MESSAGE_ALLOCATE_BUFFER | 
    FORMAT_MESSAGE_FROM_SYSTEM | 
    FORMAT_MESSAGE_IGNORE_INSERTS,
    NULL,
    GetLastError(),
    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
    (LPTSTR) &lpMsgBuf,
    0,
    NULL );
  printf("Error on Allocate. Error: %lX - %s\n",GetLastError(),lpMsgBuf); fflush(stdout);
  }
}
this works ok on some pc, but on others:

Error on Allocate. Error: 7F - Kan opgegeven procedure niet vinden.

(means "Can't find the procedure that you filled in.")

Wasn't shared memory supposed to work on all WinNT kernel based OS now ..?
I get this on Win2k and some else reported this happening on WinXP SP1 too :\
While on another SP1, it works ok...
Mouton is offline  
Old 06-14-2003, 04:24 PM   #2
Senior Member
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: Sep 2002
Posts: 558
Default

Use call by ordinal for win2k.
Shared memory works for all but it isnt defined that way for all shell32.dll versions.
FTPServerTools is offline  
Old 06-16-2003, 07:26 PM   #3
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 2,022
Default

Thx.

Off the record, for those who that might interest:

Code:
//Allocate  = GetProcAddress(hShell32, "SHAllocShared");
Allocate  = GetProcAddress(hShell32, (char *)520);
//Free    = GetProcAddress(hShell32, "SHFreeShared");
Free    = GetProcAddress(hShell32, (char *)523);
//Unlock    = GetProcAddress(hShell32, "SHUnlockShared");
Unlock    = GetProcAddress(hShell32, (char *)522);
//Lock    = GetProcAddress(hShell32, "SHLockShared");
Lock    = GetProcAddress(hShell32, (char *)521);
Mouton is offline  
Old 06-17-2003, 07:20 AM   #4
Senior Member
 
Join Date: Nov 2001
Posts: 149
Default

thanks Mouton , im thinking about plmaying a bit with it on win2k
phoenixfr is offline  
Closed Thread
Create a free account to browse our forums without ads



Thread Tools
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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -5. The time now is 11:42 AM.