* exceptions.cc: Remove unneeded include.
* dcrt0.cc: Wrap LoadDLLfunc stuff in dummy function. * init.cc: Ditto. * uinfo.cc: Ditto.
This commit is contained in:
parent
b55cc84266
commit
51859b536e
@ -1,6 +1,9 @@
|
||||
Thu Jun 1 01:40:20 2000 Christopher Faylor <cgf@cygnus.com>
|
||||
Thu Jun 1 01:55:45 2000 Christopher Faylor <cgf@cygnus.com>
|
||||
|
||||
* autoload.h: Put each info block in its own dummy static function.
|
||||
* exceptions.cc: Remove unneeded include.
|
||||
* dcrt0.cc: Wrap LoadDLLfunc stuff in dummy function.
|
||||
* init.cc: Ditto.
|
||||
* uinfo.cc: Ditto.
|
||||
|
||||
2000-05-31 DJ Delorie <dj@cygnus.com>
|
||||
|
||||
|
@ -281,7 +281,7 @@ dll_init.o: $(WINSUP_H) include/exceptions.h dll_init.h
|
||||
dll_main.o:
|
||||
environ.o: $(WINSUP_H)
|
||||
errno.o: $(WINSUP_H)
|
||||
exceptions.o: $(WINSUP_H) include/exceptions.h sync.h autoload.h
|
||||
exceptions.o: $(WINSUP_H) include/exceptions.h sync.h
|
||||
exec.o: $(WINSUP_H)
|
||||
external.o: $(WINSUP_H)
|
||||
fcntl.o: $(WINSUP_H)
|
||||
@ -338,7 +338,7 @@ termios.o: $(WINSUP_H)
|
||||
test.o: $(WINSUP_H)
|
||||
times.o: $(WINSUP_H)
|
||||
tty.o: $(WINSUP_H)
|
||||
uinfo.o: $(WINSUP_H)
|
||||
uinfo.o: $(WINSUP_H) autoload.h
|
||||
uname.o: $(WINSUP_H)
|
||||
wait.o: $(WINSUP_H)
|
||||
window.o: $(WINSUP_H)
|
||||
|
@ -65,10 +65,6 @@ static int dllname ## _init ()
|
||||
#define LoadDLLmangle(name, n) #name "@" #n
|
||||
#define LoadDLLfunc(name, n, dllname) LoadDLLfuncEx (name, n, dllname, 0)
|
||||
#define LoadDLLfuncEx(name, n, dllname, notimp) \
|
||||
extern "C" { \
|
||||
static void name##_dummy () __attribute__ ((noreturn)) __attribute__ ((unused)) __attribute__ ((stdcall)); \
|
||||
static void name##_dummy () \
|
||||
{ \
|
||||
__asm__ (".section .data_cygwin_nocopy,\"w\""); \
|
||||
__asm__ (".global _" LoadDLLmangle (name, n)); \
|
||||
__asm__ (".global _win32_" LoadDLLmangle (name, n)); \
|
||||
@ -82,7 +78,5 @@ __asm__ (" .long _" #dllname "_handle"); \
|
||||
__asm__ (" .long " #n "+" #notimp); \
|
||||
__asm__ (".asciz \"" #name "\""); \
|
||||
__asm__ (".text"); \
|
||||
} \
|
||||
}
|
||||
|
||||
extern "C" void cygwin_dll_func_load () __asm__ ("cygwin_dll_func_load");
|
||||
|
@ -1039,7 +1039,6 @@ gotit:
|
||||
movl %eax,(%ecx) # Point dispatch to address loaded above
|
||||
jmp *%eax
|
||||
");
|
||||
}
|
||||
|
||||
LoadDLLinitfunc (user32)
|
||||
{
|
||||
@ -1053,6 +1052,22 @@ LoadDLLinitfunc (user32)
|
||||
return 0; /* Already done by another thread? */
|
||||
}
|
||||
|
||||
LoadDLLinitfunc (advapi32)
|
||||
{
|
||||
HANDLE h;
|
||||
|
||||
if ((h = LoadLibrary ("advapi32.dll")) != NULL)
|
||||
advapi32_handle = h;
|
||||
else if (!advapi32_handle)
|
||||
api_fatal ("could not load advapi32.dll, %E");
|
||||
|
||||
return 0; /* Already done by another thread? */
|
||||
}
|
||||
|
||||
static void dummy_autoload (void) __attribute__ ((unused));
|
||||
static void
|
||||
dummy_autoload (void)
|
||||
{
|
||||
LoadDLLinit (user32)
|
||||
LoadDLLfunc (CharToOemA, 8, user32)
|
||||
LoadDLLfunc (CreateWindowExA, 48, user32)
|
||||
@ -1076,18 +1091,6 @@ LoadDLLfunc (SendMessageA, 16, user32)
|
||||
LoadDLLfunc (SetTimer, 16, user32)
|
||||
LoadDLLfunc (SetUserObjectSecurity, 12, user32)
|
||||
|
||||
LoadDLLinitfunc (advapi32)
|
||||
{
|
||||
HANDLE h;
|
||||
|
||||
if ((h = LoadLibrary ("advapi32.dll")) != NULL)
|
||||
advapi32_handle = h;
|
||||
else if (!advapi32_handle)
|
||||
api_fatal ("could not load advapi32.dll, %E");
|
||||
|
||||
return 0; /* Already done by another thread? */
|
||||
}
|
||||
|
||||
LoadDLLinit (advapi32)
|
||||
LoadDLLfunc (AddAccessAllowedAce, 16, advapi32)
|
||||
LoadDLLfunc (AddAccessDeniedAce, 16, advapi32)
|
||||
@ -1132,3 +1135,5 @@ LoadDLLfunc (SetKernelObjectSecurity, 12, advapi32)
|
||||
LoadDLLfunc (SetSecurityDescriptorDacl, 16, advapi32)
|
||||
LoadDLLfunc (SetSecurityDescriptorGroup, 12, advapi32)
|
||||
LoadDLLfunc (SetSecurityDescriptorOwner, 12, advapi32)
|
||||
}
|
||||
}
|
||||
|
@ -14,10 +14,7 @@ details. */
|
||||
#define Win32_Winsock
|
||||
#include "winsup.h"
|
||||
#include "exceptions.h"
|
||||
#undef DECLSPEC_IMPORT
|
||||
#define DECLSPEC_IMPORT
|
||||
#include <imagehlp.h>
|
||||
#include "autoload.h"
|
||||
|
||||
char debugger_command[2 * MAX_PATH + 20];
|
||||
|
||||
|
@ -1782,6 +1782,7 @@ fhandler_socket::ioctl (unsigned int cmd, void *p)
|
||||
return res;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
/* Initialize WinSock */
|
||||
LoadDLLinitfunc (wsock32)
|
||||
{
|
||||
@ -1815,6 +1816,10 @@ LoadDLLinitfunc (wsock32)
|
||||
|
||||
LoadDLLinit (wsock32)
|
||||
|
||||
static void dummy_autoload (void) __attribute__ ((unused));
|
||||
static void
|
||||
dummy_autoload (void)
|
||||
{
|
||||
LoadDLLfunc (WSAAsyncSelect, 16, wsock32)
|
||||
LoadDLLfunc (WSACleanup, 0, wsock32)
|
||||
LoadDLLfunc (WSAGetLastError, 0, wsock32)
|
||||
@ -1850,3 +1855,5 @@ LoadDLLfunc (sendto, 24, wsock32)
|
||||
LoadDLLfunc (setsockopt, 20, wsock32)
|
||||
LoadDLLfunc (shutdown, 8, wsock32)
|
||||
LoadDLLfunc (socket, 12, wsock32)
|
||||
}
|
||||
}
|
||||
|
@ -179,6 +179,7 @@ cuserid (char *src)
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
LoadDLLinitfunc (netapi32)
|
||||
{
|
||||
HANDLE h;
|
||||
@ -189,8 +190,14 @@ LoadDLLinitfunc (netapi32)
|
||||
api_fatal ("could not load netapi32.dll. %d", GetLastError ());
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void dummy_autoload (void) __attribute__ ((unused));
|
||||
static void
|
||||
dummy_autoload (void)
|
||||
{
|
||||
LoadDLLinit (netapi32)
|
||||
LoadDLLfunc (NetWkstaUserGetInfo, 12, netapi32)
|
||||
LoadDLLfunc (NetGetDCName, 12, netapi32)
|
||||
LoadDLLfunc (NetApiBufferFree, 4, netapi32)
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user