extern VOID STDMETHODCALLTYPE TLS_FreeMasterSlotIndex();
-DLLEXPORT
-EXTERN_C BOOL WINAPI
-DllMain(HANDLE instance, DWORD reason, LPVOID reserved)
+#if FEATURE_PAL
+DLLEXPORT // For Win32 PAL LoadLibrary emulation
+#endif
+EXTERN_C BOOL WINAPI DllMain(HANDLE instance, DWORD reason, LPVOID reserved)
{
static bool g_procInitialized = false;
// The main dll entry point for this module. This routine is called by the
// OS when the dll gets loaded. Control is simply deferred to the main code.
//*****************************************************************************
-DLLEXPORT extern "C"
-BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
+#ifdef FEATURE_PAL
+DLLEXPORT // For Win32 PAL LoadLibrary emulation
+#endif
+extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
// Defer to the main debugging code.
return DbgDllMain(hInstance, dwReason, lpReserved);
extern "C" BOOL WINAPI _CRT_INIT(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved);
#endif
-extern "C" DLLEXPORT BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved);
+extern "C" BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved);
// For the CoreClr, this is the real DLL entrypoint. We make ourselves the first entrypoint as
// we need to capture coreclr's hInstance before the C runtime initializes. This function
// will capture hInstance, let the C runtime initialize and then invoke the "classic"
// DllMain that initializes everything else.
-extern "C" DLLEXPORT BOOL WINAPI CoreDllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved)
+#ifdef FEATURE_PAL
+DLLEXPORT // For Win32 PAL LoadLibrary emulation
+#endif
+extern "C" BOOL WINAPI CoreDllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved)
{
STATIC_CONTRACT_NOTHROW;
return result;
}
-extern "C"
-DLLEXPORT BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved)
+#ifdef FEATURE_PAL
+DLLEXPORT // For Win32 PAL LoadLibrary emulation
+#endif
+extern "C" BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved)
{
STATIC_CONTRACT_NOTHROW;
DllMain
GetCLRRuntimeHost
-; Win32 API and other PAL functions used by the mscorlib
+; Win32 API and other PAL functions used by the System.Private.CoreLib
CloseHandle
CoTaskMemAlloc
CoTaskMemRealloc
CreateMutexExW
CreateSemaphoreW
CreateSemaphoreExW
-DuplicateHandle
FormatMessageW
FreeEnvironmentStringsW
-GetACP
GetCurrentProcessId
GetCurrentThreadId
GetEnvironmentStringsW
GetEnvironmentVariableW
-GetProcAddress
GetStdHandle
GetSystemInfo
LocalAlloc
LocalReAlloc
LocalFree
-MetaDataGetDispenser
-MultiByteToWideChar
OpenEventW
OpenMutexW
OpenSemaphoreW
OutputDebugStringW
QueryPerformanceCounter
QueryPerformanceFrequency
-RaiseException
ReleaseMutex
ReleaseSemaphore
ResetEvent
SysAllocStringByteLen
SysAllocStringLen
SysFreeString
-SysStringByteLen
SysStringLen
-VirtualAlloc
-VirtualFree
-GlobalMemoryStatusEx
-VirtualQuery
-WideCharToMultiByte
WriteFile
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-//+------------------------------------------------------------------------
-//
-// Declare DLL entry points for Cor API to threadpool
-//
-//-------------------------------------------------------------------------
-
-#ifdef EXPORTING_THREADPOOL_API
-#define DllExportOrImport extern "C" __declspec (dllexport)
-#else
-#define DllExportOrImport extern "C"
-#endif
-
-typedef VOID (__stdcall *WAITORTIMERCALLBACK)(PVOID, BOOL);
-
-DllExportOrImport BOOL __cdecl CorRegisterWaitForSingleObject(PHANDLE phNewWaitObject,
- HANDLE hWaitObject,
- WAITORTIMERCALLBACK Callback,
- PVOID Context,
- ULONG timeout,
- BOOL executeOnlyOnce );
-
-
-
-DllExportOrImport BOOL __cdecl CorUnregisterWait(HANDLE hWaitObject,HANDLE CompletionEvent);
-
-DllExportOrImport BOOL __cdecl CorQueueUserWorkItem(LPTHREAD_START_ROUTINE Function,
- PVOID Context,
- BOOL executeOnlyOnce );
-
-
-DllExportOrImport BOOL __cdecl CorCreateTimer(PHANDLE phNewTimer,
- WAITORTIMERCALLBACK Callback,
- PVOID Parameter,
- DWORD DueTime,
- DWORD Period);
-
-DllExportOrImport BOOL __cdecl CorChangeTimer(HANDLE Timer,
- ULONG DueTime,
- ULONG Period);
-
-DllExportOrImport BOOL __cdecl CorDeleteTimer(HANDLE Timer,
- HANDLE CompletionEvent);
-
-DllExportOrImport VOID __cdecl CorBindIoCompletionCallback(HANDLE fileHandle, LPOVERLAPPED_COMPLETION_ROUTINE callback);
-
-
-DllExportOrImport VOID __cdecl CorDoDelegateInvocation(int cookie);
#include <wchar.h>
#include <stdio.h>
-#ifndef DLLEXPORT
-// DLLEXPORT is defined to influence method visibility for some compilers.
+#ifndef FEATURE_PAL
+// CoreCLR.dll uses linker .def files to control the exported symbols.
+// Define DLLEXPORT macro as empty on Windows.
#define DLLEXPORT
-#endif // !DLLEXPORT
+#endif
#endif // __CrtWrap_h__
#ifndef FEATURE_MERGE_JIT_AND_ENGINE
-extern "C" DLLEXPORT BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID pvReserved)
+#ifdef FEATURE_PAL
+DLLEXPORT // For Win32 PAL LoadLibrary emulation
+#endif
+ extern "C" BOOL WINAPI
+ DllMain(HANDLE hInstance, DWORD dwReason, LPVOID pvReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
--*/
EXTERN_C
PALIMPORT
+DLLEXPORT
void *PAL_memcpy (void *dest, const void *src, size_t count);
PALIMPORT void * __cdecl memcpy(void *, const void *, size_t) THROW_DECL;
PALIMPORT PAL_NORETURN void __cdecl exit(int);
int __cdecl atexit(void (__cdecl *function)(void));
-PALIMPORT DLLEXPORT void __cdecl qsort(void *, size_t, size_t, int (__cdecl *)(const void *, const void *));
-PALIMPORT void * __cdecl bsearch(const void *, const void *, size_t, size_t,
-int (__cdecl *)(const void *, const void *));
-
PALIMPORT char * __cdecl _fullpath(char *, const char *, size_t);
#ifndef PAL_STDCPP_COMPAT
+
+PALIMPORT DLLEXPORT void __cdecl qsort(void *, size_t, size_t, int(__cdecl *)(const void *, const void *));
+PALIMPORT DLLEXPORT void * __cdecl bsearch(const void *, const void *, size_t, size_t,
+ int(__cdecl *)(const void *, const void *));
+
PALIMPORT time_t __cdecl time(time_t *);
struct tm {
#define errno (*PAL_errno(PAL_get_caller))
#endif // PAL_STDCPP_COMPAT
-PALIMPORT char * __cdecl getenv(const char *);
-PALIMPORT int __cdecl _putenv(const char *);
+PALIMPORT DLLEXPORT char * __cdecl getenv(const char *);
+PALIMPORT DLLEXPORT int __cdecl _putenv(const char *);
#define ERANGE 34
/******************* OLE, BSTR, VARIANT *************************/
-STDAPI_(LPVOID) CoTaskMemAlloc(SIZE_T cb);
-STDAPI_(LPVOID) CoTaskMemRealloc(LPVOID pv, SIZE_T cb);
-STDAPI_(void) CoTaskMemFree(LPVOID pv);
+DLLEXPORT STDAPI_(LPVOID) CoTaskMemAlloc(SIZE_T cb);
+DLLEXPORT STDAPI_(LPVOID) CoTaskMemRealloc(LPVOID pv, SIZE_T cb);
+DLLEXPORT STDAPI_(void) CoTaskMemFree(LPVOID pv);
typedef SHORT VARIANT_BOOL;
#define VARIANT_TRUE ((VARIANT_BOOL)-1)
typedef WCHAR *BSTR;
-STDAPI_(BSTR) SysAllocString(const OLECHAR*);
-STDAPI_(BSTR) SysAllocStringLen(const OLECHAR*, UINT);
+DLLEXPORT STDAPI_(BSTR) SysAllocString(const OLECHAR*);
+DLLEXPORT STDAPI_(BSTR) SysAllocStringLen(const OLECHAR*, UINT);
DLLEXPORT STDAPI_(BSTR) SysAllocStringByteLen(const char *, UINT);
-STDAPI_(void) SysFreeString(BSTR);
-STDAPI_(UINT) SysStringLen(BSTR);
+DLLEXPORT STDAPI_(void) SysFreeString(BSTR);
+DLLEXPORT STDAPI_(UINT) SysStringLen(BSTR);
DLLEXPORT STDAPI_(UINT) SysStringByteLen(BSTR);
typedef double DATE;
PERF_EXIT(qsort);
}
-DLLEXPORT
PALIMPORT
void * __cdecl
PAL_bsearch(const void *key, const void *base, size_t nmemb, size_t size,
Overlapping buffer-safe version of memcpy.
See MSDN doc for memcpy
--*/
-DLLEXPORT
EXTERN_C
PALIMPORT
void *PAL_memcpy (void *dest, const void *src, size_t count)
Note: The BSD implementation can cause
memory leaks. See man pages for more details.
--*/
-DLLEXPORT
int
__cdecl
_putenv( const char * envstring )
See MSDN for more details.
--*/
-DLLEXPORT char * __cdecl PAL_getenv(const char *varname)
+char * __cdecl PAL_getenv(const char *varname)
{
char *retval;
* return value = BSTR, NULL if the allocation failed.
*
***********************************************************************/
-DLLEXPORT STDAPI_(BSTR) SysAllocStringLen(const OLECHAR *psz, UINT len)
+STDAPI_(BSTR) SysAllocStringLen(const OLECHAR *psz, UINT len)
{
BSTR bstr;
* None
*
***********************************************************************/
-DLLEXPORT STDAPI_(void) SysFreeString(BSTR bstr)
+STDAPI_(void) SysFreeString(BSTR bstr)
{
if(bstr == NULL)
return;
* return value = unsigned int, length in characters.
*
***********************************************************************/
-DLLEXPORT STDAPI_(unsigned int)
+STDAPI_(unsigned int)
SysStringLen(BSTR bstr)
{
if(bstr == NULL)
#include "common.h"
-DLLEXPORT STDAPI_(LPVOID) CoTaskMemAlloc(SIZE_T cb)
+STDAPI_(LPVOID) CoTaskMemAlloc(SIZE_T cb)
{
return LocalAlloc(LMEM_FIXED, cb);
}
-DLLEXPORT STDAPI_(LPVOID) CoTaskMemRealloc(LPVOID pv, SIZE_T cb)
+STDAPI_(LPVOID) CoTaskMemRealloc(LPVOID pv, SIZE_T cb)
{
return LocalReAlloc(pv, cb, LMEM_MOVEABLE);
}
-DLLEXPORT STDAPI_(void) CoTaskMemFree(LPVOID pv)
+STDAPI_(void) CoTaskMemFree(LPVOID pv)
{
LocalFree(pv);
}
pThis->Enter();
}
- DLLEXPORT DEBUG_NOINLINE static void HolderLeave(PEFileListLock *pThis)
+ DEBUG_NOINLINE static void HolderLeave(PEFileListLock *pThis)
{
WRAPPER_NO_CONTRACT;
ANNOTATION_SPECIAL_HOLDER_CALLER_NEEDS_DYNAMIC_CONTRACT;
c->Enter();
}
- DLLEXPORT DEBUG_NOINLINE static void ReleaseLock(CrstBase *c) {
+ DEBUG_NOINLINE static void ReleaseLock(CrstBase *c) {
WRAPPER_NO_CONTRACT;
ANNOTATION_SPECIAL_HOLDER_CALLER_NEEDS_DYNAMIC_CONTRACT;
c->Leave();
// Argument:
// input: c - the lock to be checked.
// Note: Throws
- DLLEXPORT static void AcquireLock(CrstBase * c)
+ static void AcquireLock(CrstBase * c)
{
SUPPORTS_DAC;
if (c->GetEnterCount() != 0)
}
};
- DLLEXPORT static void ReleaseLock(CrstBase *c)
+ static void ReleaseLock(CrstBase *c)
{
SUPPORTS_DAC;
};
// LockHolder holds the lock of the element, not the element itself
- DLLEXPORT DEBUG_NOINLINE static void LockHolderEnter(Entry_t *pThis)
+ DEBUG_NOINLINE static void LockHolderEnter(Entry_t *pThis)
{
WRAPPER_NO_CONTRACT;
ANNOTATION_SPECIAL_HOLDER_CALLER_NEEDS_DYNAMIC_CONTRACT;
pThis->Enter();
}
- DLLEXPORT DEBUG_NOINLINE static void LockHolderLeave(Entry_t *pThis)
+ DEBUG_NOINLINE static void LockHolderLeave(Entry_t *pThis)
{
WRAPPER_NO_CONTRACT;
ANNOTATION_SPECIAL_HOLDER_CALLER_NEEDS_DYNAMIC_CONTRACT;