2000-07-01 11:51:55 +08:00
|
|
|
/* attach_dll.cc: crt0 for attaching cygwin DLL from a non-cygwin app.
|
|
|
|
|
2013-01-21 12:38:31 +08:00
|
|
|
Copyright 2000, 2001, 2007, 2010 Red Hat, Inc.
|
2000-07-01 11:51:55 +08:00
|
|
|
|
|
|
|
This file is part of Cygwin.
|
|
|
|
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
2000-07-08 12:36:27 +08:00
|
|
|
#undef __INSIDE_CYGWIN__
|
2010-08-30 09:57:37 +08:00
|
|
|
#include "winlean.h"
|
2007-08-02 22:30:17 +08:00
|
|
|
#include <time.h> /* Needed since call to sys/time.h via sys/cygwin.h
|
|
|
|
complains otherwise */
|
2000-07-08 12:36:27 +08:00
|
|
|
#include <sys/cygwin.h>
|
2000-07-01 11:51:55 +08:00
|
|
|
#include "crt0.h"
|
|
|
|
|
|
|
|
/* for a loaded dll */
|
|
|
|
int
|
|
|
|
cygwin_attach_dll (HMODULE h, MainFunc f)
|
|
|
|
{
|
2000-07-18 03:18:21 +08:00
|
|
|
static struct per_process u;
|
2000-07-15 10:48:11 +08:00
|
|
|
(void) _cygwin_crt0_common (f, &u);
|
2000-07-01 11:51:55 +08:00
|
|
|
|
|
|
|
/* jump into the dll. */
|
2000-07-15 10:48:11 +08:00
|
|
|
return dll_dllcrt0 (h, &u);
|
2000-07-01 11:51:55 +08:00
|
|
|
}
|