Commit a0a2b25a authored by Alexandre Julliard's avatar Alexandre Julliard

kernel32: Move Get/SetDllDirectory() implementation to ntdll.

parent 6113c468
...@@ -56,7 +56,6 @@ struct dll_dir_entry ...@@ -56,7 +56,6 @@ struct dll_dir_entry
}; };
static struct list dll_dir_list = LIST_INIT( dll_dir_list ); /* extra dirs from AddDllDirectory */ static struct list dll_dir_list = LIST_INIT( dll_dir_list ); /* extra dirs from AddDllDirectory */
static WCHAR *dll_directory; /* extra path for SetDllDirectoryW */
static DWORD default_search_flags; /* default flags set by SetDefaultDllDirectories */ static DWORD default_search_flags; /* default flags set by SetDefaultDllDirectories */
/* to keep track of LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE file handles */ /* to keep track of LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE file handles */
...@@ -82,21 +81,40 @@ static CRITICAL_SECTION dlldir_section = { &critsect_debug, -1, 0, 0, 0, 0 }; ...@@ -82,21 +81,40 @@ static CRITICAL_SECTION dlldir_section = { &critsect_debug, -1, 0, 0, 0, 0 };
*/ */
DWORD WINAPI GetDllDirectoryA( DWORD buf_len, LPSTR buffer ) DWORD WINAPI GetDllDirectoryA( DWORD buf_len, LPSTR buffer )
{ {
UNICODE_STRING str;
NTSTATUS status;
WCHAR data[MAX_PATH];
DWORD len; DWORD len;
RtlEnterCriticalSection( &dlldir_section ); str.Buffer = data;
len = dll_directory ? FILE_name_WtoA( dll_directory, strlenW(dll_directory), NULL, 0 ) : 0; str.MaximumLength = sizeof(data);
for (;;)
{
status = LdrGetDllDirectory( &str );
if (status != STATUS_BUFFER_TOO_SMALL) break;
if (str.Buffer != data) HeapFree( GetProcessHeap(), 0, str.Buffer );
str.MaximumLength = str.Length;
if (!(str.Buffer = HeapAlloc( GetProcessHeap(), 0, str.MaximumLength )))
{
status = STATUS_NO_MEMORY;
break;
}
}
if (!set_ntstatus( status )) return 0;
len = FILE_name_WtoA( str.Buffer, str.Length / sizeof(WCHAR), NULL, 0 );
if (buffer && buf_len > len) if (buffer && buf_len > len)
{ {
if (dll_directory) FILE_name_WtoA( dll_directory, -1, buffer, buf_len ); FILE_name_WtoA( str.Buffer, -1, buffer, buf_len );
else *buffer = 0;
} }
else else
{ {
len++; /* for terminating null */ len++; /* for terminating null */
if (buffer) *buffer = 0; if (buffer) *buffer = 0;
} }
RtlLeaveCriticalSection( &dlldir_section ); if (str.Buffer != data) HeapFree( GetProcessHeap(), 0, str.Buffer );
return len; return len;
} }
...@@ -106,22 +124,15 @@ DWORD WINAPI GetDllDirectoryA( DWORD buf_len, LPSTR buffer ) ...@@ -106,22 +124,15 @@ DWORD WINAPI GetDllDirectoryA( DWORD buf_len, LPSTR buffer )
*/ */
DWORD WINAPI GetDllDirectoryW( DWORD buf_len, LPWSTR buffer ) DWORD WINAPI GetDllDirectoryW( DWORD buf_len, LPWSTR buffer )
{ {
DWORD len; UNICODE_STRING str;
NTSTATUS status;
RtlEnterCriticalSection( &dlldir_section ); str.Buffer = buffer;
len = dll_directory ? strlenW( dll_directory ) : 0; str.MaximumLength = min( buf_len, UNICODE_STRING_MAX_CHARS ) * sizeof(WCHAR);
if (buffer && buf_len > len) status = LdrGetDllDirectory( &str );
{ if (status == STATUS_BUFFER_TOO_SMALL) status = STATUS_SUCCESS;
if (dll_directory) memcpy( buffer, dll_directory, (len + 1) * sizeof(WCHAR) ); if (!set_ntstatus( status )) return 0;
else *buffer = 0; return str.Length / sizeof(WCHAR);
}
else
{
len++; /* for terminating null */
if (buffer) *buffer = 0;
}
RtlLeaveCriticalSection( &dlldir_section );
return len;
} }
...@@ -145,24 +156,10 @@ BOOL WINAPI SetDllDirectoryA( LPCSTR dir ) ...@@ -145,24 +156,10 @@ BOOL WINAPI SetDllDirectoryA( LPCSTR dir )
*/ */
BOOL WINAPI SetDllDirectoryW( LPCWSTR dir ) BOOL WINAPI SetDllDirectoryW( LPCWSTR dir )
{ {
WCHAR *newdir = NULL; UNICODE_STRING str;
if (dir)
{
DWORD len = (strlenW(dir) + 1) * sizeof(WCHAR);
if (!(newdir = HeapAlloc( GetProcessHeap(), 0, len )))
{
SetLastError( ERROR_NOT_ENOUGH_MEMORY );
return FALSE;
}
memcpy( newdir, dir, len );
}
RtlEnterCriticalSection( &dlldir_section ); RtlInitUnicodeString( &str, dir );
HeapFree( GetProcessHeap(), 0, dll_directory ); return set_ntstatus( LdrSetDllDirectory( &str ));
dll_directory = newdir;
RtlLeaveCriticalSection( &dlldir_section );
return TRUE;
} }
...@@ -508,7 +505,7 @@ WCHAR *MODULE_get_dll_load_path( LPCWSTR module, int safe_mode ) ...@@ -508,7 +505,7 @@ WCHAR *MODULE_get_dll_load_path( LPCWSTR module, int safe_mode )
const WCHAR *mod_end = NULL; const WCHAR *mod_end = NULL;
UNICODE_STRING name, value; UNICODE_STRING name, value;
WCHAR *p, *ret; WCHAR *p, *ret;
int len = 0, path_len = 0; int len = 0, path_len = 0, dlldir_len;
/* adjust length for module name */ /* adjust length for module name */
...@@ -534,22 +531,27 @@ WCHAR *MODULE_get_dll_load_path( LPCWSTR module, int safe_mode ) ...@@ -534,22 +531,27 @@ WCHAR *MODULE_get_dll_load_path( LPCWSTR module, int safe_mode )
if (RtlQueryEnvironmentVariable_U( NULL, &name, &value ) == STATUS_BUFFER_TOO_SMALL) if (RtlQueryEnvironmentVariable_U( NULL, &name, &value ) == STATUS_BUFFER_TOO_SMALL)
path_len = value.Length; path_len = value.Length;
RtlEnterCriticalSection( &dlldir_section ); dlldir_len = GetDllDirectoryW( 0, NULL );
if (safe_mode == -1) safe_mode = get_dll_safe_mode(); if (safe_mode == -1) safe_mode = get_dll_safe_mode();
if (dll_directory) len += strlenW(dll_directory) + 1; if (dlldir_len > 1) len += dlldir_len;
else len += 2; /* current directory */ else len += 2; /* current directory */
if ((p = ret = HeapAlloc( GetProcessHeap(), 0, path_len + len * sizeof(WCHAR) ))) if ((p = ret = HeapAlloc( GetProcessHeap(), 0, path_len + len * sizeof(WCHAR) )))
{ {
if (module) p = append_path_len( p, module, mod_end - module ); if (module) p = append_path_len( p, module, mod_end - module );
if (dll_directory) p = append_path( p, dll_directory ); if (dlldir_len > 1)
{
GetDllDirectoryW( len - (p - ret), p );
p += strlenW(p);
*p++ = ';';
}
else if (!safe_mode) p = append_path( p, dotW ); else if (!safe_mode) p = append_path( p, dotW );
p = append_path( p, system_path ); p = append_path( p, system_path );
if (!dll_directory && safe_mode) p = append_path( p, dotW ); if (dlldir_len <= 1 && safe_mode) p = append_path( p, dotW );
} }
RtlLeaveCriticalSection( &dlldir_section );
if (!ret) return NULL; if (!ret) return NULL;
value.Buffer = p; value.Buffer = p;
...@@ -616,7 +618,7 @@ static WCHAR *get_dll_load_path_search_flags( LPCWSTR module, DWORD flags ) ...@@ -616,7 +618,7 @@ static WCHAR *get_dll_load_path_search_flags( LPCWSTR module, DWORD flags )
{ {
LIST_FOR_EACH_ENTRY( dir, &dll_dir_list, struct dll_dir_entry, entry ) LIST_FOR_EACH_ENTRY( dir, &dll_dir_list, struct dll_dir_entry, entry )
len += strlenW( dir->dir ) + 1; len += strlenW( dir->dir ) + 1;
if (dll_directory) len += strlenW(dll_directory) + 1; len += GetDllDirectoryW( 0, NULL );
} }
if (flags & LOAD_LIBRARY_SEARCH_SYSTEM32) len += GetSystemDirectoryW( NULL, 0 ); if (flags & LOAD_LIBRARY_SEARCH_SYSTEM32) len += GetSystemDirectoryW( NULL, 0 );
...@@ -629,7 +631,12 @@ static WCHAR *get_dll_load_path_search_flags( LPCWSTR module, DWORD flags ) ...@@ -629,7 +631,12 @@ static WCHAR *get_dll_load_path_search_flags( LPCWSTR module, DWORD flags )
{ {
LIST_FOR_EACH_ENTRY( dir, &dll_dir_list, struct dll_dir_entry, entry ) LIST_FOR_EACH_ENTRY( dir, &dll_dir_list, struct dll_dir_entry, entry )
p = append_path( p, dir->dir ); p = append_path( p, dir->dir );
if (dll_directory) p = append_path( p, dll_directory ); GetDllDirectoryW( ret + len - p, p );
if (*p)
{
p += strlenW(p);
*p++ = ';';
}
} }
if (flags & LOAD_LIBRARY_SEARCH_SYSTEM32) GetSystemDirectoryW( p, ret + len - p ); if (flags & LOAD_LIBRARY_SEARCH_SYSTEM32) GetSystemDirectoryW( p, ret + len - p );
else else
......
...@@ -18,10 +18,15 @@ ...@@ -18,10 +18,15 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "wine/test.h"
#include <windows.h>
#include <stdio.h> #include <stdio.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winternl.h"
#include <psapi.h> #include <psapi.h>
#include "wine/test.h"
static DWORD (WINAPI *pGetDllDirectoryA)(DWORD,LPSTR); static DWORD (WINAPI *pGetDllDirectoryA)(DWORD,LPSTR);
static DWORD (WINAPI *pGetDllDirectoryW)(DWORD,LPWSTR); static DWORD (WINAPI *pGetDllDirectoryW)(DWORD,LPWSTR);
...@@ -32,6 +37,9 @@ static BOOL (WINAPI *pSetDefaultDllDirectories)(DWORD); ...@@ -32,6 +37,9 @@ static BOOL (WINAPI *pSetDefaultDllDirectories)(DWORD);
static BOOL (WINAPI *pK32GetModuleInformation)(HANDLE process, HMODULE module, static BOOL (WINAPI *pK32GetModuleInformation)(HANDLE process, HMODULE module,
MODULEINFO *modinfo, DWORD cb); MODULEINFO *modinfo, DWORD cb);
static NTSTATUS (WINAPI *pLdrGetDllDirectory)(UNICODE_STRING*);
static NTSTATUS (WINAPI *pLdrSetDllDirectory)(UNICODE_STRING*);
static BOOL is_unicode_enabled = TRUE; static BOOL is_unicode_enabled = TRUE;
static BOOL cmpStrAW(const char* a, const WCHAR* b, DWORD lenA, DWORD lenB) static BOOL cmpStrAW(const char* a, const WCHAR* b, DWORD lenA, DWORD lenB)
...@@ -601,11 +609,14 @@ static void test_LoadLibraryEx_search_flags(void) ...@@ -601,11 +609,14 @@ static void test_LoadLibraryEx_search_flags(void)
ok( !mod, "LoadLibrary succeeded\n" ); ok( !mod, "LoadLibrary succeeded\n" );
ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() ); ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() );
if (0) /* crashes on win10 */
{
SetLastError( 0xdeadbeef ); SetLastError( 0xdeadbeef );
mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_USER_DIRS ); mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_USER_DIRS );
ok( !mod, "LoadLibrary succeeded\n" ); ok( !mod, "LoadLibrary succeeded\n" );
ok( GetLastError() == ERROR_MOD_NOT_FOUND || broken(GetLastError() == ERROR_NOT_ENOUGH_MEMORY), ok( GetLastError() == ERROR_MOD_NOT_FOUND || broken(GetLastError() == ERROR_NOT_ENOUGH_MEMORY),
"wrong error %u\n", GetLastError() ); "wrong error %u\n", GetLastError() );
}
SetLastError( 0xdeadbeef ); SetLastError( 0xdeadbeef );
mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32 ); mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32 );
...@@ -753,8 +764,8 @@ static void testGetDllDirectory(void) ...@@ -753,8 +764,8 @@ static void testGetDllDirectory(void)
bufferW[0] = 'A'; bufferW[0] = 'A';
ret = pGetDllDirectoryW(0, bufferW); ret = pGetDllDirectoryW(0, bufferW);
ok(ret == length + 1, "i=%d, Expected %u, got %u\n", i, length + 1, ret); ok(ret == length + 1, "i=%d, Expected %u, got %u\n", i, length + 1, ret);
ok(bufferW[0] == 0 || /* XP, 2003 */ ok(bufferW[0] == 'A' || broken(bufferW[0] == 0), /* XP, 2003 */
broken(bufferW[0] == 'A'), "i=%d, Buffer overflow\n", i); "i=%d, Buffer overflow\n", i);
/* buffer just one too short */ /* buffer just one too short */
bufferA[0] = 'A'; bufferA[0] = 'A';
...@@ -766,8 +777,8 @@ static void testGetDllDirectory(void) ...@@ -766,8 +777,8 @@ static void testGetDllDirectory(void)
bufferW[0] = 'A'; bufferW[0] = 'A';
ret = pGetDllDirectoryW(length, bufferW); ret = pGetDllDirectoryW(length, bufferW);
ok(ret == length + 1, "i=%d, Expected %u, got %u\n", i, length + 1, ret); ok(ret == length + 1, "i=%d, Expected %u, got %u\n", i, length + 1, ret);
ok(bufferW[0] == 0 || /* XP, 2003 */ if (length != 0)
broken(bufferW[0] == 'A'), "i=%d, Buffer overflow\n", i); ok(bufferW[0] == 0, "i=%d, Buffer overflow\n", i);
if (0) if (0)
{ {
...@@ -779,6 +790,30 @@ static void testGetDllDirectory(void) ...@@ -779,6 +790,30 @@ static void testGetDllDirectory(void)
ret = pGetDllDirectoryW(length, NULL); ret = pGetDllDirectoryW(length, NULL);
ok(ret == length + 1, "i=%d, Expected %u, got %u\n", i, length + 1, ret); ok(ret == length + 1, "i=%d, Expected %u, got %u\n", i, length + 1, ret);
} }
if (pLdrGetDllDirectory)
{
UNICODE_STRING str;
NTSTATUS status;
str.Buffer = bufferW;
str.MaximumLength = sizeof(bufferW);
status = pLdrGetDllDirectory( &str );
ok( !status, "LdrGetDllDirectory failed %x\n", status );
ok( cmpStrAW( dll_directories[i], bufferW, strlen(dll_directories[i]),
str.Length / sizeof(WCHAR) ), "%u: got %s instead of %s\n",
i, wine_dbgstr_w(bufferW), dll_directories[i] );
if (dll_directories[i][0])
{
memset( bufferW, 0xcc, sizeof(bufferW) );
str.MaximumLength = (strlen( dll_directories[i] ) - 1) * sizeof(WCHAR);
status = pLdrGetDllDirectory( &str );
ok( status == STATUS_BUFFER_TOO_SMALL, "%u: LdrGetDllDirectory failed %x\n", i, status );
ok( bufferW[0] == 0 && bufferW[1] == 0xcccc,
"%u: buffer %x %x\n", i, bufferW[0], bufferW[1] );
length = (strlen( dll_directories[i] ) + 1) * sizeof(WCHAR);
ok( str.Length == length, "%u: wrong len %u / %u\n", i, str.Length, length );
}
}
} }
/* unset whatever we did so following tests won't be affected */ /* unset whatever we did so following tests won't be affected */
...@@ -787,9 +822,9 @@ static void testGetDllDirectory(void) ...@@ -787,9 +822,9 @@ static void testGetDllDirectory(void)
static void init_pointers(void) static void init_pointers(void)
{ {
HMODULE hKernel32 = GetModuleHandleA("kernel32.dll"); HMODULE mod = GetModuleHandleA("kernel32.dll");
#define MAKEFUNC(f) (p##f = (void*)GetProcAddress(hKernel32, #f)) #define MAKEFUNC(f) (p##f = (void*)GetProcAddress(mod, #f))
MAKEFUNC(GetDllDirectoryA); MAKEFUNC(GetDllDirectoryA);
MAKEFUNC(GetDllDirectoryW); MAKEFUNC(GetDllDirectoryW);
MAKEFUNC(SetDllDirectoryA); MAKEFUNC(SetDllDirectoryA);
...@@ -797,6 +832,9 @@ static void init_pointers(void) ...@@ -797,6 +832,9 @@ static void init_pointers(void)
MAKEFUNC(RemoveDllDirectory); MAKEFUNC(RemoveDllDirectory);
MAKEFUNC(SetDefaultDllDirectories); MAKEFUNC(SetDefaultDllDirectories);
MAKEFUNC(K32GetModuleInformation); MAKEFUNC(K32GetModuleInformation);
mod = GetModuleHandleA( "ntdll.dll" );
MAKEFUNC(LdrGetDllDirectory);
MAKEFUNC(LdrSetDllDirectory);
#undef MAKEFUNC #undef MAKEFUNC
/* before Windows 7 this was not exported in kernel32 */ /* before Windows 7 this was not exported in kernel32 */
......
...@@ -78,6 +78,7 @@ static BOOL imports_fixup_done = FALSE; /* set once the imports have been fixed ...@@ -78,6 +78,7 @@ static BOOL imports_fixup_done = FALSE; /* set once the imports have been fixed
static BOOL process_detaching = FALSE; /* set on process detach to avoid deadlocks with thread detach */ static BOOL process_detaching = FALSE; /* set on process detach to avoid deadlocks with thread detach */
static int free_lib_count; /* recursion depth of LdrUnloadDll calls */ static int free_lib_count; /* recursion depth of LdrUnloadDll calls */
static ULONG path_safe_mode; /* path mode set by RtlSetSearchPathMode */ static ULONG path_safe_mode; /* path mode set by RtlSetSearchPathMode */
static UNICODE_STRING dll_directory; /* extra path for LdrSetDllDirectory */
struct ldr_notification struct ldr_notification
{ {
...@@ -137,6 +138,15 @@ static RTL_CRITICAL_SECTION_DEBUG critsect_debug = ...@@ -137,6 +138,15 @@ static RTL_CRITICAL_SECTION_DEBUG critsect_debug =
}; };
static RTL_CRITICAL_SECTION loader_section = { &critsect_debug, -1, 0, 0, 0, 0 }; static RTL_CRITICAL_SECTION loader_section = { &critsect_debug, -1, 0, 0, 0, 0 };
static CRITICAL_SECTION dlldir_section;
static CRITICAL_SECTION_DEBUG dlldir_critsect_debug =
{
0, 0, &dlldir_section,
{ &dlldir_critsect_debug.ProcessLocksList, &dlldir_critsect_debug.ProcessLocksList },
0, 0, { (DWORD_PTR)(__FILE__ ": dlldir_section") }
};
static CRITICAL_SECTION dlldir_section = { &dlldir_critsect_debug, -1, 0, 0, 0, 0 };
static WINE_MODREF *cached_modref; static WINE_MODREF *cached_modref;
static WINE_MODREF *current_modref; static WINE_MODREF *current_modref;
static WINE_MODREF *last_failed_modref; static WINE_MODREF *last_failed_modref;
...@@ -3827,6 +3837,45 @@ PVOID WINAPI RtlPcToFileHeader( PVOID pc, PVOID *address ) ...@@ -3827,6 +3837,45 @@ PVOID WINAPI RtlPcToFileHeader( PVOID pc, PVOID *address )
} }
/****************************************************************************
* LdrGetDllDirectory (NTDLL.@)
*/
NTSTATUS WINAPI LdrGetDllDirectory( UNICODE_STRING *dir )
{
NTSTATUS status = STATUS_SUCCESS;
RtlEnterCriticalSection( &dlldir_section );
dir->Length = dll_directory.Length + sizeof(WCHAR);
if (dir->MaximumLength >= dir->Length) RtlCopyUnicodeString( dir, &dll_directory );
else
{
status = STATUS_BUFFER_TOO_SMALL;
if (dir->MaximumLength) dir->Buffer[0] = 0;
}
RtlLeaveCriticalSection( &dlldir_section );
return status;
}
/****************************************************************************
* LdrSetDllDirectory (NTDLL.@)
*/
NTSTATUS WINAPI LdrSetDllDirectory( const UNICODE_STRING *dir )
{
NTSTATUS status = STATUS_SUCCESS;
UNICODE_STRING new;
if (!dir->Buffer) RtlInitUnicodeString( &new, NULL );
else if ((status = RtlDuplicateUnicodeString( 1, dir, &new ))) return status;
RtlEnterCriticalSection( &dlldir_section );
RtlFreeUnicodeString( &dll_directory );
dll_directory = new;
RtlLeaveCriticalSection( &dlldir_section );
return status;
}
/************************************************************************* /*************************************************************************
* RtlSetSearchPathMode (NTDLL.@) * RtlSetSearchPathMode (NTDLL.@)
*/ */
......
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
@ stub LdrFlushAlternateResourceModules @ stub LdrFlushAlternateResourceModules
@ stdcall LdrGetDllHandle(wstr long ptr ptr) @ stdcall LdrGetDllHandle(wstr long ptr ptr)
# @ stub LdrGetDllHandleEx # @ stub LdrGetDllHandleEx
@ stdcall LdrGetDllDirectory(ptr)
@ stdcall LdrGetProcedureAddress(ptr ptr long ptr) @ stdcall LdrGetProcedureAddress(ptr ptr long ptr)
# @ stub LdrHotPatchRoutine # @ stub LdrHotPatchRoutine
@ stub LdrInitShimEngineDynamic @ stub LdrInitShimEngineDynamic
...@@ -99,6 +100,7 @@ ...@@ -99,6 +100,7 @@
@ stdcall LdrRegisterDllNotification(long ptr ptr ptr) @ stdcall LdrRegisterDllNotification(long ptr ptr ptr)
@ stdcall LdrResolveDelayLoadedAPI(ptr ptr ptr ptr ptr long) @ stdcall LdrResolveDelayLoadedAPI(ptr ptr ptr ptr ptr long)
@ stub LdrSetAppCompatDllRedirectionCallback @ stub LdrSetAppCompatDllRedirectionCallback
@ stdcall LdrSetDllDirectory(ptr)
@ stub LdrSetDllManifestProber @ stub LdrSetDllManifestProber
@ stdcall LdrShutdownProcess() @ stdcall LdrShutdownProcess()
@ stdcall LdrShutdownThread() @ stdcall LdrShutdownThread()
......
...@@ -2310,10 +2310,11 @@ NTSYSAPI void WINAPI DbgUiRemoteBreakin(void*); ...@@ -2310,10 +2310,11 @@ NTSYSAPI void WINAPI DbgUiRemoteBreakin(void*);
NTSYSAPI void WINAPI DbgUserBreakPoint(void); NTSYSAPI void WINAPI DbgUserBreakPoint(void);
NTSYSAPI NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG); NTSYSAPI NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
NTSYSAPI NTSTATUS WINAPI LdrAddRefDll(ULONG,HMODULE); NTSYSAPI NTSTATUS WINAPI LdrAddRefDll(ULONG,HMODULE);
NTSYSAPI NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**);
NTSYSAPI NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**);
NTSYSAPI NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE); NTSYSAPI NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE);
NTSYSAPI NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_MODULE*); NTSYSAPI NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_MODULE*);
NTSYSAPI NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**);
NTSYSAPI NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**);
NTSYSAPI NTSTATUS WINAPI LdrGetDllDirectory(UNICODE_STRING*);
NTSYSAPI NTSTATUS WINAPI LdrGetDllHandle(LPCWSTR, ULONG, const UNICODE_STRING*, HMODULE*); NTSYSAPI NTSTATUS WINAPI LdrGetDllHandle(LPCWSTR, ULONG, const UNICODE_STRING*, HMODULE*);
NTSYSAPI NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, ULONG, void**); NTSYSAPI NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, ULONG, void**);
NTSYSAPI NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*); NTSYSAPI NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
...@@ -2321,6 +2322,7 @@ NTSYSAPI NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG_PTR*); ...@@ -2321,6 +2322,7 @@ NTSYSAPI NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG_PTR*);
IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock(void*,UINT,USHORT*,INT_PTR); IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock(void*,UINT,USHORT*,INT_PTR);
NTSYSAPI NTSTATUS WINAPI LdrQueryImageFileExecutionOptions(const UNICODE_STRING*,LPCWSTR,ULONG,void*,ULONG,ULONG*); NTSYSAPI NTSTATUS WINAPI LdrQueryImageFileExecutionOptions(const UNICODE_STRING*,LPCWSTR,ULONG,void*,ULONG,ULONG*);
NTSYSAPI NTSTATUS WINAPI LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION*, ULONG, ULONG*); NTSYSAPI NTSTATUS WINAPI LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION*, ULONG, ULONG*);
NTSYSAPI NTSTATUS WINAPI LdrSetDllDirectory(const UNICODE_STRING*);
NTSYSAPI void WINAPI LdrShutdownProcess(void); NTSYSAPI void WINAPI LdrShutdownProcess(void);
NTSYSAPI void WINAPI LdrShutdownThread(void); NTSYSAPI void WINAPI LdrShutdownThread(void);
NTSYSAPI NTSTATUS WINAPI LdrUnloadDll(HMODULE); NTSYSAPI NTSTATUS WINAPI LdrUnloadDll(HMODULE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment