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 06-14-2003, 10:57 AM   #1
Mouton
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 1,956
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
FTPServerTools
Senior Member
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: Sep 2002
Posts: 543
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
Mouton
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 1,956
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
phoenixfr
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

Tags
allocate, error, getprocaddresshshell32, memory, shared

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 08:00 PM.

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