delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/01/21/22:08:04

From: rdong AT newport DOT com (Rui-Tao Dong)
Subject: Re: DLL fun
21 Jan 1999 22:08:04 -0800 :
Message-ID: <834spks2so.fsf.cygnus.gnu-win32@apollo.int.newport.com>
To: gnu-win32 AT cygnus DOT com

 dj> Nice try, but I don't think this will do what you expect.  The
 dj> problem is that when DLLs are build against the import libraries
 dj> of other DLLs, the final link is done.  By the time you link your
 dj> application against that DLL, it's too late to override functions
 dj> like that.  Each DLL has an "import list" that defines not only
 dj> the functions it needs, but which other DLLs they come from.  The
 dj> only way to override the function call (like you're trying to do
 dj> above) is to create a new DLL with the same name as the one that
 dj> function is in (like gdi32.dll), but then you'd have to replicate
 dj> *all* the functions.
 dj> 
 dj> Overriding the function like you're trying to do would only work
 dj> for the application in which your override exists.  It won't
 dj> override other DLLs your application links against.
 dj> 

Thanks for the explanation.  Is there a sensible way to achieve what I
wanted to do?  I created a dll (user32) with these functions and
pexports reports the same symbols as the real user32.dll (minus a lot
other symbols.)  I put the dll in the current directory (my PATH looks
like .:dir1:dir2 ...) and still no go.  BTW, when I run nm on the
*.lib file, it reports

.....
00000000 ? user32_NULL_THUNK_DATA
nm: user32.dll: File format not recognized
.....

Is my nm too old?  Is there a book or something I can read about these 
stuff?

-- 
Regards,

	Rui-Tao Dong			Newport Corporation
	rdong AT newport DOT com		1791 Deere Avenue
	(949)253-1679(Voice)		Irvine, CA 92606 USA
	(949)253-1240(Fax)		http://www.newport.com

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019