kernel32: Remove superfluous pointer casts.
This commit is contained in:
parent
d8b4dd7ab6
commit
9b2730eb88
|
@ -1338,7 +1338,7 @@ BOOL WINAPI ReadConsoleW(HANDLE hConsoleInput, LPVOID lpBuffer,
|
||||||
DWORD nNumberOfCharsToRead, LPDWORD lpNumberOfCharsRead, LPVOID lpReserved)
|
DWORD nNumberOfCharsToRead, LPDWORD lpNumberOfCharsRead, LPVOID lpReserved)
|
||||||
{
|
{
|
||||||
DWORD charsread;
|
DWORD charsread;
|
||||||
LPWSTR xbuf = (LPWSTR)lpBuffer;
|
LPWSTR xbuf = lpBuffer;
|
||||||
DWORD mode;
|
DWORD mode;
|
||||||
|
|
||||||
TRACE("(%p,%p,%d,%p,%p)\n",
|
TRACE("(%p,%p,%d,%p,%p)\n",
|
||||||
|
|
|
@ -92,7 +92,7 @@ BOOL load_winedos(void)
|
||||||
if (hRunOnce == 0)
|
if (hRunOnce == 0)
|
||||||
{
|
{
|
||||||
HANDLE hEvent = CreateEventW( NULL, TRUE, FALSE, NULL );
|
HANDLE hEvent = CreateEventW( NULL, TRUE, FALSE, NULL );
|
||||||
if (InterlockedCompareExchangePointer( (PVOID)&hRunOnce, hEvent, 0 ) == 0)
|
if (InterlockedCompareExchangePointer( &hRunOnce, hEvent, 0 ) == 0)
|
||||||
{
|
{
|
||||||
HMODULE hModule;
|
HMODULE hModule;
|
||||||
|
|
||||||
|
|
|
@ -366,7 +366,7 @@ static int start_debugger_atomic(PEXCEPTION_POINTERS epointers)
|
||||||
/* ask for manual reset, so that once the debugger is started,
|
/* ask for manual reset, so that once the debugger is started,
|
||||||
* every thread will know it */
|
* every thread will know it */
|
||||||
NtCreateEvent( &hEvent, EVENT_ALL_ACCESS, &attr, TRUE, FALSE );
|
NtCreateEvent( &hEvent, EVENT_ALL_ACCESS, &attr, TRUE, FALSE );
|
||||||
if (InterlockedCompareExchangePointer( (PVOID)&hRunOnce, hEvent, 0 ) == 0)
|
if (InterlockedCompareExchangePointer( &hRunOnce, hEvent, 0 ) == 0)
|
||||||
{
|
{
|
||||||
/* ok, our event has been set... we're the winning thread */
|
/* ok, our event has been set... we're the winning thread */
|
||||||
BOOL ret = start_debugger( epointers, hRunOnce );
|
BOOL ret = start_debugger( epointers, hRunOnce );
|
||||||
|
@ -408,7 +408,7 @@ static inline BOOL check_resource_write( void *addr )
|
||||||
|
|
||||||
if (!VirtualQuery( addr, &info, sizeof(info) )) return FALSE;
|
if (!VirtualQuery( addr, &info, sizeof(info) )) return FALSE;
|
||||||
if (info.State == MEM_FREE || !(info.Type & MEM_IMAGE)) return FALSE;
|
if (info.State == MEM_FREE || !(info.Type & MEM_IMAGE)) return FALSE;
|
||||||
if (!(rsrc = RtlImageDirectoryEntryToData( (HMODULE)info.AllocationBase, TRUE,
|
if (!(rsrc = RtlImageDirectoryEntryToData( info.AllocationBase, TRUE,
|
||||||
IMAGE_DIRECTORY_ENTRY_RESOURCE, &size )))
|
IMAGE_DIRECTORY_ENTRY_RESOURCE, &size )))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (addr < rsrc || (char *)addr >= (char *)rsrc + size) return FALSE;
|
if (addr < rsrc || (char *)addr >= (char *)rsrc + size) return FALSE;
|
||||||
|
|
|
@ -347,7 +347,7 @@ static void FILE_InitProcessDosHandles( void )
|
||||||
*/
|
*/
|
||||||
static void WINAPI FILE_ReadWriteApc(void* apc_user, PIO_STATUS_BLOCK io_status, ULONG reserved)
|
static void WINAPI FILE_ReadWriteApc(void* apc_user, PIO_STATUS_BLOCK io_status, ULONG reserved)
|
||||||
{
|
{
|
||||||
LPOVERLAPPED_COMPLETION_ROUTINE cr = (LPOVERLAPPED_COMPLETION_ROUTINE)apc_user;
|
LPOVERLAPPED_COMPLETION_ROUTINE cr = apc_user;
|
||||||
|
|
||||||
cr(RtlNtStatusToDosError(io_status->u.Status), io_status->Information, (LPOVERLAPPED)io_status);
|
cr(RtlNtStatusToDosError(io_status->u.Status), io_status->Information, (LPOVERLAPPED)io_status);
|
||||||
}
|
}
|
||||||
|
@ -1953,7 +1953,7 @@ BOOL WINAPI FindNextFileW( HANDLE handle, WIN32_FIND_DATAW *data )
|
||||||
SetLastError( ERROR_INVALID_HANDLE );
|
SetLastError( ERROR_INVALID_HANDLE );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
info = (FIND_FIRST_INFO *)handle;
|
info = handle;
|
||||||
if (info->magic != FIND_FIRST_MAGIC)
|
if (info->magic != FIND_FIRST_MAGIC)
|
||||||
{
|
{
|
||||||
SetLastError( ERROR_INVALID_HANDLE );
|
SetLastError( ERROR_INVALID_HANDLE );
|
||||||
|
@ -2037,7 +2037,7 @@ BOOL WINAPI FindNextFileW( HANDLE handle, WIN32_FIND_DATAW *data )
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI FindClose( HANDLE handle )
|
BOOL WINAPI FindClose( HANDLE handle )
|
||||||
{
|
{
|
||||||
FIND_FIRST_INFO *info = (FIND_FIRST_INFO *)handle;
|
FIND_FIRST_INFO *info = handle;
|
||||||
|
|
||||||
if (!handle || handle == INVALID_HANDLE_VALUE)
|
if (!handle || handle == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
|
@ -2105,7 +2105,7 @@ HANDLE WINAPI FindFirstFileExA( LPCSTR lpFileName, FINDEX_INFO_LEVELS fInfoLevel
|
||||||
handle = FindFirstFileExW(nameW, fInfoLevelId, &dataW, fSearchOp, lpSearchFilter, dwAdditionalFlags);
|
handle = FindFirstFileExW(nameW, fInfoLevelId, &dataW, fSearchOp, lpSearchFilter, dwAdditionalFlags);
|
||||||
if (handle == INVALID_HANDLE_VALUE) return handle;
|
if (handle == INVALID_HANDLE_VALUE) return handle;
|
||||||
|
|
||||||
dataA = (WIN32_FIND_DATAA *) lpFindFileData;
|
dataA = lpFindFileData;
|
||||||
dataA->dwFileAttributes = dataW.dwFileAttributes;
|
dataA->dwFileAttributes = dataW.dwFileAttributes;
|
||||||
dataA->ftCreationTime = dataW.ftCreationTime;
|
dataA->ftCreationTime = dataW.ftCreationTime;
|
||||||
dataA->ftLastAccessTime = dataW.ftLastAccessTime;
|
dataA->ftLastAccessTime = dataW.ftLastAccessTime;
|
||||||
|
|
|
@ -165,8 +165,8 @@ DWORD WINAPI FormatMessageA(
|
||||||
from = NULL;
|
from = NULL;
|
||||||
if (dwFlags & FORMAT_MESSAGE_FROM_STRING)
|
if (dwFlags & FORMAT_MESSAGE_FROM_STRING)
|
||||||
{
|
{
|
||||||
from = HeapAlloc( GetProcessHeap(), 0, strlen((LPCSTR)lpSource)+1 );
|
from = HeapAlloc( GetProcessHeap(), 0, strlen(lpSource) + 1 );
|
||||||
strcpy( from, (LPCSTR)lpSource );
|
strcpy( from, lpSource );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
from = NULL;
|
from = NULL;
|
||||||
|
@ -384,9 +384,9 @@ DWORD WINAPI FormatMessageW(
|
||||||
FIXME("line wrapping not supported.\n");
|
FIXME("line wrapping not supported.\n");
|
||||||
from = NULL;
|
from = NULL;
|
||||||
if (dwFlags & FORMAT_MESSAGE_FROM_STRING) {
|
if (dwFlags & FORMAT_MESSAGE_FROM_STRING) {
|
||||||
from = HeapAlloc( GetProcessHeap(), 0, (strlenW((LPCWSTR)lpSource) + 1) *
|
from = HeapAlloc( GetProcessHeap(), 0, (strlenW(lpSource) + 1) *
|
||||||
sizeof(WCHAR) );
|
sizeof(WCHAR) );
|
||||||
strcpyW( from, (LPCWSTR)lpSource );
|
strcpyW( from, lpSource );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
from = NULL;
|
from = NULL;
|
||||||
|
|
|
@ -311,7 +311,7 @@ BOOL WINAPI HeapSetInformation( HANDLE heap, HEAP_INFORMATION_CLASS infoclass, P
|
||||||
|
|
||||||
#define MAGIC_GLOBAL_USED 0x5342
|
#define MAGIC_GLOBAL_USED 0x5342
|
||||||
#define HANDLE_TO_INTERN(h) ((PGLOBAL32_INTERN)(((char *)(h))-2))
|
#define HANDLE_TO_INTERN(h) ((PGLOBAL32_INTERN)(((char *)(h))-2))
|
||||||
#define INTERN_TO_HANDLE(i) ((HGLOBAL) &((i)->Pointer))
|
#define INTERN_TO_HANDLE(i) (&((i)->Pointer))
|
||||||
#define POINTER_TO_HANDLE(p) (*(((const HGLOBAL *)(p))-2))
|
#define POINTER_TO_HANDLE(p) (*(((const HGLOBAL *)(p))-2))
|
||||||
#define ISHANDLE(h) (((ULONG_PTR)(h)&2)!=0)
|
#define ISHANDLE(h) (((ULONG_PTR)(h)&2)!=0)
|
||||||
#define ISPOINTER(h) (((ULONG_PTR)(h)&2)==0)
|
#define ISPOINTER(h) (((ULONG_PTR)(h)&2)==0)
|
||||||
|
|
|
@ -1859,7 +1859,7 @@ HANDLE WINAPI Local32Init16( WORD segment, DWORD tableSize,
|
||||||
HeapFree( GetProcessHeap(), 0, oldBase );
|
HeapFree( GetProcessHeap(), 0, oldBase );
|
||||||
}
|
}
|
||||||
|
|
||||||
return (HANDLE)header;
|
return header;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -1957,7 +1957,7 @@ static VOID Local32_FromHandle( LOCAL32HEADER *header, INT16 type,
|
||||||
*/
|
*/
|
||||||
DWORD WINAPI Local32Alloc16( HANDLE heap, DWORD size, INT16 type, DWORD flags )
|
DWORD WINAPI Local32Alloc16( HANDLE heap, DWORD size, INT16 type, DWORD flags )
|
||||||
{
|
{
|
||||||
LOCAL32HEADER *header = (LOCAL32HEADER *)heap;
|
LOCAL32HEADER *header = heap;
|
||||||
LPDWORD handle;
|
LPDWORD handle;
|
||||||
LPBYTE ptr;
|
LPBYTE ptr;
|
||||||
DWORD addr;
|
DWORD addr;
|
||||||
|
@ -2036,7 +2036,7 @@ DWORD WINAPI Local32Alloc16( HANDLE heap, DWORD size, INT16 type, DWORD flags )
|
||||||
DWORD WINAPI Local32ReAlloc16( HANDLE heap, DWORD addr, INT16 type,
|
DWORD WINAPI Local32ReAlloc16( HANDLE heap, DWORD addr, INT16 type,
|
||||||
DWORD size, DWORD flags )
|
DWORD size, DWORD flags )
|
||||||
{
|
{
|
||||||
LOCAL32HEADER *header = (LOCAL32HEADER *)heap;
|
LOCAL32HEADER *header = heap;
|
||||||
LPDWORD handle;
|
LPDWORD handle;
|
||||||
LPBYTE ptr;
|
LPBYTE ptr;
|
||||||
|
|
||||||
|
@ -2069,7 +2069,7 @@ DWORD WINAPI Local32ReAlloc16( HANDLE heap, DWORD addr, INT16 type,
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI Local32Free16( HANDLE heap, DWORD addr, INT16 type )
|
BOOL WINAPI Local32Free16( HANDLE heap, DWORD addr, INT16 type )
|
||||||
{
|
{
|
||||||
LOCAL32HEADER *header = (LOCAL32HEADER *)heap;
|
LOCAL32HEADER *header = heap;
|
||||||
LPDWORD handle;
|
LPDWORD handle;
|
||||||
LPBYTE ptr;
|
LPBYTE ptr;
|
||||||
|
|
||||||
|
@ -2115,7 +2115,7 @@ BOOL WINAPI Local32Free16( HANDLE heap, DWORD addr, INT16 type )
|
||||||
*/
|
*/
|
||||||
DWORD WINAPI Local32Translate16( HANDLE heap, DWORD addr, INT16 type1, INT16 type2 )
|
DWORD WINAPI Local32Translate16( HANDLE heap, DWORD addr, INT16 type1, INT16 type2 )
|
||||||
{
|
{
|
||||||
LOCAL32HEADER *header = (LOCAL32HEADER *)heap;
|
LOCAL32HEADER *header = heap;
|
||||||
LPDWORD handle;
|
LPDWORD handle;
|
||||||
LPBYTE ptr;
|
LPBYTE ptr;
|
||||||
|
|
||||||
|
@ -2131,7 +2131,7 @@ DWORD WINAPI Local32Translate16( HANDLE heap, DWORD addr, INT16 type1, INT16 typ
|
||||||
*/
|
*/
|
||||||
DWORD WINAPI Local32Size16( HANDLE heap, DWORD addr, INT16 type )
|
DWORD WINAPI Local32Size16( HANDLE heap, DWORD addr, INT16 type )
|
||||||
{
|
{
|
||||||
LOCAL32HEADER *header = (LOCAL32HEADER *)heap;
|
LOCAL32HEADER *header = heap;
|
||||||
LPDWORD handle;
|
LPDWORD handle;
|
||||||
LPBYTE ptr;
|
LPBYTE ptr;
|
||||||
|
|
||||||
|
@ -2146,7 +2146,7 @@ DWORD WINAPI Local32Size16( HANDLE heap, DWORD addr, INT16 type )
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI Local32ValidHandle16( HANDLE heap, WORD addr )
|
BOOL WINAPI Local32ValidHandle16( HANDLE heap, WORD addr )
|
||||||
{
|
{
|
||||||
LOCAL32HEADER *header = (LOCAL32HEADER *)heap;
|
LOCAL32HEADER *header = heap;
|
||||||
LPDWORD handle;
|
LPDWORD handle;
|
||||||
LPBYTE ptr;
|
LPBYTE ptr;
|
||||||
|
|
||||||
|
@ -2159,7 +2159,7 @@ BOOL WINAPI Local32ValidHandle16( HANDLE heap, WORD addr )
|
||||||
*/
|
*/
|
||||||
WORD WINAPI Local32GetSegment16( HANDLE heap )
|
WORD WINAPI Local32GetSegment16( HANDLE heap )
|
||||||
{
|
{
|
||||||
LOCAL32HEADER *header = (LOCAL32HEADER *)heap;
|
LOCAL32HEADER *header = heap;
|
||||||
return header->segment;
|
return header->segment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -241,8 +241,8 @@ static const union cptable *get_codepage_table( unsigned int codepage )
|
||||||
*/
|
*/
|
||||||
static int charset_cmp( const void *name, const void *entry )
|
static int charset_cmp( const void *name, const void *entry )
|
||||||
{
|
{
|
||||||
const struct charset_entry *charset = (const struct charset_entry *)entry;
|
const struct charset_entry *charset = entry;
|
||||||
return strcasecmp( (const char *)name, charset->charset_name );
|
return strcasecmp( name, charset->charset_name );
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -621,7 +621,7 @@ static BOOL locale_update_registry( HKEY hkey, const WCHAR *name, LCID lcid,
|
||||||
|
|
||||||
RtlInitUnicodeString( &nameW, name );
|
RtlInitUnicodeString( &nameW, name );
|
||||||
count = sizeof(bufferW);
|
count = sizeof(bufferW);
|
||||||
if (!NtQueryValueKey(hkey, &nameW, KeyValuePartialInformation, (LPBYTE)bufferW, count, &count))
|
if (!NtQueryValueKey(hkey, &nameW, KeyValuePartialInformation, bufferW, count, &count))
|
||||||
{
|
{
|
||||||
const KEY_VALUE_PARTIAL_INFORMATION *info = (KEY_VALUE_PARTIAL_INFORMATION *)bufferW;
|
const KEY_VALUE_PARTIAL_INFORMATION *info = (KEY_VALUE_PARTIAL_INFORMATION *)bufferW;
|
||||||
LPCWSTR text = (LPCWSTR)info->Data;
|
LPCWSTR text = (LPCWSTR)info->Data;
|
||||||
|
@ -3538,7 +3538,7 @@ GEOID WINAPI GetUserGeoID( GEOCLASS GeoClass )
|
||||||
if ((hSubkey = NLS_RegOpenKey(hkey, geoW)))
|
if ((hSubkey = NLS_RegOpenKey(hkey, geoW)))
|
||||||
{
|
{
|
||||||
if((NtQueryValueKey(hSubkey, &keyW, KeyValuePartialInformation,
|
if((NtQueryValueKey(hSubkey, &keyW, KeyValuePartialInformation,
|
||||||
(LPBYTE)bufferW, count, &count) == STATUS_SUCCESS ) && info->DataLength)
|
bufferW, count, &count) == STATUS_SUCCESS ) && info->DataLength)
|
||||||
ret = strtolW((LPCWSTR)info->Data, &end, 10);
|
ret = strtolW((LPCWSTR)info->Data, &end, 10);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -224,7 +224,7 @@ void __wine_dll_unregister_16( const IMAGE_DOS_HEADER *header )
|
||||||
*/
|
*/
|
||||||
NE_MODULE *NE_GetPtr( HMODULE16 hModule )
|
NE_MODULE *NE_GetPtr( HMODULE16 hModule )
|
||||||
{
|
{
|
||||||
return (NE_MODULE *)GlobalLock16( GetExePtr(hModule) );
|
return GlobalLock16( GetExePtr(hModule) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1250,7 +1250,7 @@ HINSTANCE16 WINAPI LoadModule16( LPCSTR name, LPVOID paramBlock )
|
||||||
* in the meantime), or else to a stub module which contains only header
|
* in the meantime), or else to a stub module which contains only header
|
||||||
* information.
|
* information.
|
||||||
*/
|
*/
|
||||||
params = (LOADPARAMS16 *)paramBlock;
|
params = paramBlock;
|
||||||
if (params->showCmd)
|
if (params->showCmd)
|
||||||
cmdShow = ((WORD *)MapSL( params->showCmd ))[1];
|
cmdShow = ((WORD *)MapSL( params->showCmd ))[1];
|
||||||
cmdline = MapSL( params->cmdLine );
|
cmdline = MapSL( params->cmdLine );
|
||||||
|
|
|
@ -146,11 +146,11 @@ static void create_scsi_entry( PSCSI_ADDRESS scsi_addr, LPCSTR lpDriver, UINT uD
|
||||||
|
|
||||||
RtlCreateUnicodeStringFromAsciiz( &nameW, "Driver" );
|
RtlCreateUnicodeStringFromAsciiz( &nameW, "Driver" );
|
||||||
RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &sizeW, lpDriver, strlen(lpDriver)+1);
|
RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &sizeW, lpDriver, strlen(lpDriver)+1);
|
||||||
NtSetValueKey( portKey, &nameW, 0, REG_SZ, (BYTE*)dataW, sizeW );
|
NtSetValueKey( portKey, &nameW, 0, REG_SZ, dataW, sizeW );
|
||||||
RtlFreeUnicodeString( &nameW );
|
RtlFreeUnicodeString( &nameW );
|
||||||
value = 10;
|
value = 10;
|
||||||
RtlCreateUnicodeStringFromAsciiz( &nameW, "FirstBusTimeScanInMs" );
|
RtlCreateUnicodeStringFromAsciiz( &nameW, "FirstBusTimeScanInMs" );
|
||||||
NtSetValueKey( portKey,&nameW, 0, REG_DWORD, (BYTE *)&value, sizeof(DWORD));
|
NtSetValueKey( portKey,&nameW, 0, REG_DWORD, &value, sizeof(DWORD) );
|
||||||
RtlFreeUnicodeString( &nameW );
|
RtlFreeUnicodeString( &nameW );
|
||||||
|
|
||||||
value = 0;
|
value = 0;
|
||||||
|
@ -167,7 +167,7 @@ static void create_scsi_entry( PSCSI_ADDRESS scsi_addr, LPCSTR lpDriver, UINT uD
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
RtlCreateUnicodeStringFromAsciiz( &nameW, "DMAEnabled" );
|
RtlCreateUnicodeStringFromAsciiz( &nameW, "DMAEnabled" );
|
||||||
NtSetValueKey( portKey,&nameW, 0, REG_DWORD, (BYTE *)&value, sizeof(DWORD));
|
NtSetValueKey( portKey,&nameW, 0, REG_DWORD, &value, sizeof(DWORD) );
|
||||||
RtlFreeUnicodeString( &nameW );
|
RtlFreeUnicodeString( &nameW );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,25 +234,25 @@ static void create_scsi_entry( PSCSI_ADDRESS scsi_addr, LPCSTR lpDriver, UINT uD
|
||||||
}
|
}
|
||||||
RtlCreateUnicodeStringFromAsciiz( &nameW, "Type" );
|
RtlCreateUnicodeStringFromAsciiz( &nameW, "Type" );
|
||||||
RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &sizeW, data, strlen(data)+1);
|
RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &sizeW, data, strlen(data)+1);
|
||||||
NtSetValueKey( lunKey, &nameW, 0, REG_SZ, (BYTE*)dataW, sizeW );
|
NtSetValueKey( lunKey, &nameW, 0, REG_SZ, dataW, sizeW );
|
||||||
RtlFreeUnicodeString( &nameW );
|
RtlFreeUnicodeString( &nameW );
|
||||||
|
|
||||||
RtlCreateUnicodeStringFromAsciiz( &nameW, "Identifier" );
|
RtlCreateUnicodeStringFromAsciiz( &nameW, "Identifier" );
|
||||||
RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &sizeW, lpDriveName, strlen(lpDriveName)+1);
|
RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &sizeW, lpDriveName, strlen(lpDriveName)+1);
|
||||||
NtSetValueKey( lunKey, &nameW, 0, REG_SZ, (BYTE*)dataW, sizeW );
|
NtSetValueKey( lunKey, &nameW, 0, REG_SZ, dataW, sizeW );
|
||||||
RtlFreeUnicodeString( &nameW );
|
RtlFreeUnicodeString( &nameW );
|
||||||
|
|
||||||
if (uDriveType == DRIVE_CDROM || uDriveType == DRIVE_REMOVABLE)
|
if (uDriveType == DRIVE_CDROM || uDriveType == DRIVE_REMOVABLE)
|
||||||
{
|
{
|
||||||
RtlCreateUnicodeStringFromAsciiz( &nameW, "DeviceName" );
|
RtlCreateUnicodeStringFromAsciiz( &nameW, "DeviceName" );
|
||||||
RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &sizeW, buffer, strlen(buffer)+1);
|
RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &sizeW, buffer, strlen(buffer)+1);
|
||||||
NtSetValueKey( lunKey, &nameW, 0, REG_SZ, (BYTE*)dataW, sizeW );
|
NtSetValueKey( lunKey, &nameW, 0, REG_SZ, dataW, sizeW );
|
||||||
RtlFreeUnicodeString( &nameW );
|
RtlFreeUnicodeString( &nameW );
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlCreateUnicodeStringFromAsciiz( &nameW, "UnixDeviceName" );
|
RtlCreateUnicodeStringFromAsciiz( &nameW, "UnixDeviceName" );
|
||||||
RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &sizeW, lpUnixDeviceName, strlen(lpUnixDeviceName)+1);
|
RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &sizeW, lpUnixDeviceName, strlen(lpUnixDeviceName)+1);
|
||||||
NtSetValueKey( lunKey, &nameW, 0, REG_SZ, (BYTE*)dataW, sizeW );
|
NtSetValueKey( lunKey, &nameW, 0, REG_SZ, dataW, sizeW );
|
||||||
RtlFreeUnicodeString( &nameW );
|
RtlFreeUnicodeString( &nameW );
|
||||||
|
|
||||||
NtClose( lunKey );
|
NtClose( lunKey );
|
||||||
|
|
|
@ -122,7 +122,7 @@ static void PROFILE_CopyEntry( LPWSTR buffer, LPCWSTR value, int len,
|
||||||
static inline void PROFILE_ByteSwapShortBuffer(WCHAR * buffer, int len)
|
static inline void PROFILE_ByteSwapShortBuffer(WCHAR * buffer, int len)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
USHORT * shortbuffer = (USHORT *)buffer;
|
USHORT * shortbuffer = buffer;
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
shortbuffer[i] = RtlUshortByteSwap(shortbuffer[i]);
|
shortbuffer[i] = RtlUshortByteSwap(shortbuffer[i]);
|
||||||
}
|
}
|
||||||
|
@ -345,37 +345,37 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding)
|
||||||
case ENCODING_ANSI:
|
case ENCODING_ANSI:
|
||||||
TRACE("ANSI encoding\n");
|
TRACE("ANSI encoding\n");
|
||||||
|
|
||||||
len = MultiByteToWideChar(CP_ACP, 0, (char *)pBuffer, dwFileSize, NULL, 0);
|
len = MultiByteToWideChar(CP_ACP, 0, pBuffer, dwFileSize, NULL, 0);
|
||||||
szFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
szFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
||||||
if (!szFile)
|
if (!szFile)
|
||||||
{
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, buffer_base);
|
HeapFree(GetProcessHeap(), 0, buffer_base);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
MultiByteToWideChar(CP_ACP, 0, (char *)pBuffer, dwFileSize, szFile, len);
|
MultiByteToWideChar(CP_ACP, 0, pBuffer, dwFileSize, szFile, len);
|
||||||
szEnd = szFile + len;
|
szEnd = szFile + len;
|
||||||
break;
|
break;
|
||||||
case ENCODING_UTF8:
|
case ENCODING_UTF8:
|
||||||
TRACE("UTF8 encoding\n");
|
TRACE("UTF8 encoding\n");
|
||||||
|
|
||||||
len = MultiByteToWideChar(CP_UTF8, 0, (char *)pBuffer, dwFileSize, NULL, 0);
|
len = MultiByteToWideChar(CP_UTF8, 0, pBuffer, dwFileSize, NULL, 0);
|
||||||
szFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
szFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
||||||
if (!szFile)
|
if (!szFile)
|
||||||
{
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, buffer_base);
|
HeapFree(GetProcessHeap(), 0, buffer_base);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
MultiByteToWideChar(CP_UTF8, 0, (char *)pBuffer, dwFileSize, szFile, len);
|
MultiByteToWideChar(CP_UTF8, 0, pBuffer, dwFileSize, szFile, len);
|
||||||
szEnd = szFile + len;
|
szEnd = szFile + len;
|
||||||
break;
|
break;
|
||||||
case ENCODING_UTF16LE:
|
case ENCODING_UTF16LE:
|
||||||
TRACE("UTF16 Little Endian encoding\n");
|
TRACE("UTF16 Little Endian encoding\n");
|
||||||
szFile = (WCHAR *)pBuffer;
|
szFile = pBuffer;
|
||||||
szEnd = (WCHAR *)((char *)pBuffer + dwFileSize);
|
szEnd = (WCHAR *)((char *)pBuffer + dwFileSize);
|
||||||
break;
|
break;
|
||||||
case ENCODING_UTF16BE:
|
case ENCODING_UTF16BE:
|
||||||
TRACE("UTF16 Big Endian encoding\n");
|
TRACE("UTF16 Big Endian encoding\n");
|
||||||
szFile = (WCHAR *)pBuffer;
|
szFile = pBuffer;
|
||||||
szEnd = (WCHAR *)((char *)pBuffer + dwFileSize);
|
szEnd = (WCHAR *)((char *)pBuffer + dwFileSize);
|
||||||
PROFILE_ByteSwapShortBuffer(szFile, dwFileSize / sizeof(WCHAR));
|
PROFILE_ByteSwapShortBuffer(szFile, dwFileSize / sizeof(WCHAR));
|
||||||
break;
|
break;
|
||||||
|
@ -1708,7 +1708,7 @@ BOOL WINAPI GetPrivateProfileStructW (LPCWSTR section, LPCWSTR key,
|
||||||
{
|
{
|
||||||
BOOL highnibble = TRUE;
|
BOOL highnibble = TRUE;
|
||||||
BYTE b = 0, val;
|
BYTE b = 0, val;
|
||||||
LPBYTE binbuf = (LPBYTE)buf;
|
LPBYTE binbuf = buf;
|
||||||
|
|
||||||
end -= 2; /* don't include checksum in output data */
|
end -= 2; /* don't include checksum in output data */
|
||||||
/* translate ASCII hex format into binary data */
|
/* translate ASCII hex format into binary data */
|
||||||
|
|
|
@ -73,7 +73,7 @@ HANDLE get_BaseNamedObjects_handle(void)
|
||||||
InitializeObjectAttributes(&attr, &str, 0, 0, NULL);
|
InitializeObjectAttributes(&attr, &str, 0, 0, NULL);
|
||||||
NtOpenDirectoryObject(&dir, DIRECTORY_CREATE_OBJECT|DIRECTORY_TRAVERSE,
|
NtOpenDirectoryObject(&dir, DIRECTORY_CREATE_OBJECT|DIRECTORY_TRAVERSE,
|
||||||
&attr);
|
&attr);
|
||||||
if (InterlockedCompareExchangePointer( (PVOID)&handle, dir, 0 ) != 0)
|
if (InterlockedCompareExchangePointer( &handle, dir, 0 ) != 0)
|
||||||
{
|
{
|
||||||
/* someone beat us here... */
|
/* someone beat us here... */
|
||||||
CloseHandle( dir );
|
CloseHandle( dir );
|
||||||
|
|
|
@ -343,8 +343,8 @@ static TDB *TASK_Create( NE_MODULE *pModule, UINT16 cmdShow, LPCSTR cmdline, BYT
|
||||||
|
|
||||||
/* Allocate a code segment alias for the TDB */
|
/* Allocate a code segment alias for the TDB */
|
||||||
|
|
||||||
pTask->hCSAlias = GLOBAL_CreateBlock( GMEM_FIXED, (void *)pTask,
|
pTask->hCSAlias = GLOBAL_CreateBlock( GMEM_FIXED, pTask, sizeof(TDB),
|
||||||
sizeof(TDB), pTask->hPDB, WINE_LDT_FLAGS_CODE );
|
pTask->hPDB, WINE_LDT_FLAGS_CODE );
|
||||||
|
|
||||||
/* Default DTA overwrites command line */
|
/* Default DTA overwrites command line */
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
static DWORD CALLBACK NotificationThread(LPVOID arg)
|
static DWORD CALLBACK NotificationThread(LPVOID arg)
|
||||||
{
|
{
|
||||||
HANDLE change = (HANDLE) arg;
|
HANDLE change = arg;
|
||||||
BOOL notified = FALSE;
|
BOOL notified = FALSE;
|
||||||
BOOL ret = FALSE;
|
BOOL ret = FALSE;
|
||||||
DWORD status;
|
DWORD status;
|
||||||
|
@ -65,8 +65,7 @@ static HANDLE StartNotificationThread(LPCSTR path, BOOL subtree, DWORD flags)
|
||||||
change = FindFirstChangeNotificationA(path, subtree, flags);
|
change = FindFirstChangeNotificationA(path, subtree, flags);
|
||||||
ok(change != INVALID_HANDLE_VALUE, "FindFirstChangeNotification error: %d\n", GetLastError());
|
ok(change != INVALID_HANDLE_VALUE, "FindFirstChangeNotification error: %d\n", GetLastError());
|
||||||
|
|
||||||
thread = CreateThread(NULL, 0, NotificationThread, (LPVOID)change,
|
thread = CreateThread(NULL, 0, NotificationThread, change, 0, &threadId);
|
||||||
0, &threadId);
|
|
||||||
ok(thread != NULL, "CreateThread error: %d\n", GetLastError());
|
ok(thread != NULL, "CreateThread error: %d\n", GetLastError());
|
||||||
|
|
||||||
return thread;
|
return thread;
|
||||||
|
@ -356,8 +355,8 @@ static void test_ffcnMultipleThreads(void)
|
||||||
* directory object with an empty wine user APC queue for this thread (bug #7286) */
|
* directory object with an empty wine user APC queue for this thread (bug #7286) */
|
||||||
|
|
||||||
/* Create our notification thread */
|
/* Create our notification thread */
|
||||||
handles[1] = CreateThread(NULL, 0, NotificationThread, (LPVOID)handles[0],
|
handles[1] = CreateThread(NULL, 0, NotificationThread, handles[0], 0,
|
||||||
0, &threadId);
|
&threadId);
|
||||||
ok(handles[1] != NULL, "CreateThread error: %d\n", GetLastError());
|
ok(handles[1] != NULL, "CreateThread error: %d\n", GetLastError());
|
||||||
|
|
||||||
status = WaitForMultipleObjects(2, handles, FALSE, 5000);
|
status = WaitForMultipleObjects(2, handles, FALSE, 5000);
|
||||||
|
@ -848,8 +847,8 @@ static void test_ffcn_directory_overlap(void)
|
||||||
ret = FindCloseChangeNotification(parent_watch);
|
ret = FindCloseChangeNotification(parent_watch);
|
||||||
ok(ret, "FindCloseChangeNotification error: %d\n", GetLastError());
|
ok(ret, "FindCloseChangeNotification error: %d\n", GetLastError());
|
||||||
|
|
||||||
child_thread = CreateThread(NULL, 0, NotificationThread,
|
child_thread = CreateThread(NULL, 0, NotificationThread, child_watch, 0,
|
||||||
(LPVOID)child_watch, 0, &threadId);
|
&threadId);
|
||||||
ok(child_thread != NULL, "CreateThread error: %d\n", GetLastError());
|
ok(child_thread != NULL, "CreateThread error: %d\n", GetLastError());
|
||||||
|
|
||||||
/* Create a file in child */
|
/* Create a file in child */
|
||||||
|
|
|
@ -205,7 +205,7 @@ static void test_overlapped_buffers(void)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
memcpy((WCHAR *)(buf + 1), strW, sizeof(strW));
|
memcpy(buf + 1, strW, sizeof(strW));
|
||||||
ret = WideCharToMultiByte(CP_ACP, 0, (WCHAR *)(buf + 1), -1, buf, sizeof(buf), NULL, NULL);
|
ret = WideCharToMultiByte(CP_ACP, 0, (WCHAR *)(buf + 1), -1, buf, sizeof(buf), NULL, NULL);
|
||||||
ok(ret == sizeof(strA), "unexpected ret %d\n", ret);
|
ok(ret == sizeof(strA), "unexpected ret %d\n", ret);
|
||||||
ok(!memcmp(buf, strA, sizeof(strA)), "conversion failed: %s\n", buf);
|
ok(!memcmp(buf, strA, sizeof(strA)), "conversion failed: %s\n", buf);
|
||||||
|
|
|
@ -1161,7 +1161,7 @@ static void test_WaitRx(HANDLE hcom)
|
||||||
*/
|
*/
|
||||||
static DWORD CALLBACK toggle_ctlLine(LPVOID arg)
|
static DWORD CALLBACK toggle_ctlLine(LPVOID arg)
|
||||||
{
|
{
|
||||||
DWORD_PTR *args = (DWORD_PTR *) arg;
|
DWORD_PTR *args = arg;
|
||||||
DWORD timeout = args[0];
|
DWORD timeout = args[0];
|
||||||
DWORD ctl = args[1];
|
DWORD ctl = args[1];
|
||||||
HANDLE hcom = (HANDLE) args[2];
|
HANDLE hcom = (HANDLE) args[2];
|
||||||
|
@ -1264,7 +1264,7 @@ static void test_WaitCts(HANDLE hcom)
|
||||||
*/
|
*/
|
||||||
static DWORD CALLBACK reset_CommMask(LPVOID arg)
|
static DWORD CALLBACK reset_CommMask(LPVOID arg)
|
||||||
{
|
{
|
||||||
DWORD_PTR *args = (DWORD_PTR *) arg;
|
DWORD_PTR *args = arg;
|
||||||
DWORD timeout = args[0];
|
DWORD timeout = args[0];
|
||||||
HANDLE hcom = (HANDLE) args[1];
|
HANDLE hcom = (HANDLE) args[1];
|
||||||
|
|
||||||
|
@ -1565,7 +1565,7 @@ static void test_WaitDcd(HANDLE hcom)
|
||||||
*/
|
*/
|
||||||
static DWORD CALLBACK set_CommBreak(LPVOID arg)
|
static DWORD CALLBACK set_CommBreak(LPVOID arg)
|
||||||
{
|
{
|
||||||
DWORD_PTR *args = (DWORD_PTR *) arg;
|
DWORD_PTR *args = arg;
|
||||||
DWORD timeout = args[0];
|
DWORD timeout = args[0];
|
||||||
HANDLE hcom = (HANDLE) args[1];
|
HANDLE hcom = (HANDLE) args[1];
|
||||||
|
|
||||||
|
|
|
@ -402,7 +402,7 @@ static void test_Loader(void)
|
||||||
"%d: VirtualQuery error %d\n", i, GetLastError());
|
"%d: VirtualQuery error %d\n", i, GetLastError());
|
||||||
if (nt_header.OptionalHeader.SectionAlignment < si.dwPageSize)
|
if (nt_header.OptionalHeader.SectionAlignment < si.dwPageSize)
|
||||||
{
|
{
|
||||||
ok(info.BaseAddress == (char *)hlib, "%d: got %p != expected %p\n", i, info.BaseAddress, (char *)hlib);
|
ok(info.BaseAddress == hlib, "%d: got %p != expected %p\n", i, info.BaseAddress, hlib);
|
||||||
ok(info.RegionSize == ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, si.dwPageSize), "%d: got %lx != expected %x\n",
|
ok(info.RegionSize == ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, si.dwPageSize), "%d: got %lx != expected %x\n",
|
||||||
i, info.RegionSize, ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, si.dwPageSize));
|
i, info.RegionSize, ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, si.dwPageSize));
|
||||||
ok(info.Protect == PAGE_EXECUTE_WRITECOPY, "%d: %x != PAGE_EXECUTE_WRITECOPY\n", i, info.Protect);
|
ok(info.Protect == PAGE_EXECUTE_WRITECOPY, "%d: %x != PAGE_EXECUTE_WRITECOPY\n", i, info.Protect);
|
||||||
|
|
|
@ -946,7 +946,7 @@ struct named_pipe_client_params
|
||||||
|
|
||||||
static DWORD CALLBACK named_pipe_client_func(LPVOID p)
|
static DWORD CALLBACK named_pipe_client_func(LPVOID p)
|
||||||
{
|
{
|
||||||
struct named_pipe_client_params *params = (struct named_pipe_client_params *)p;
|
struct named_pipe_client_params *params = p;
|
||||||
HANDLE pipe;
|
HANDLE pipe;
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
const char message[] = "Test";
|
const char message[] = "Test";
|
||||||
|
@ -1391,7 +1391,7 @@ static DWORD CALLBACK overlapped_server(LPVOID arg)
|
||||||
OVERLAPPED ol;
|
OVERLAPPED ol;
|
||||||
HANDLE pipe;
|
HANDLE pipe;
|
||||||
int ret, err;
|
int ret, err;
|
||||||
struct overlapped_server_args *a = (struct overlapped_server_args*)arg;
|
struct overlapped_server_args *a = arg;
|
||||||
DWORD num;
|
DWORD num;
|
||||||
char buf[100];
|
char buf[100];
|
||||||
|
|
||||||
|
|
|
@ -490,7 +490,7 @@ static void test_iocp_callback(void)
|
||||||
ok(retb == TRUE, "BindIoCompletionCallback failed\n");
|
ok(retb == TRUE, "BindIoCompletionCallback failed\n");
|
||||||
|
|
||||||
memset(&overlapped, 0, sizeof(overlapped));
|
memset(&overlapped, 0, sizeof(overlapped));
|
||||||
retb = WriteFile(hFile, (const void *) buffer, 4, &bytesWritten, &overlapped);
|
retb = WriteFile(hFile, buffer, 4, &bytesWritten, &overlapped);
|
||||||
ok(retb == TRUE || GetLastError() == ERROR_IO_PENDING, "WriteFile failed, lastError = %d\n", GetLastError());
|
ok(retb == TRUE || GetLastError() == ERROR_IO_PENDING, "WriteFile failed, lastError = %d\n", GetLastError());
|
||||||
|
|
||||||
ret = WaitForSingleObject(sem, 5000);
|
ret = WaitForSingleObject(sem, 5000);
|
||||||
|
@ -534,7 +534,7 @@ static void test_iocp_callback(void)
|
||||||
|
|
||||||
static void CALLBACK timer_queue_cb1(PVOID p, BOOLEAN timedOut)
|
static void CALLBACK timer_queue_cb1(PVOID p, BOOLEAN timedOut)
|
||||||
{
|
{
|
||||||
int *pn = (int *) p;
|
int *pn = p;
|
||||||
ok(timedOut, "Timer callbacks should always time out\n");
|
ok(timedOut, "Timer callbacks should always time out\n");
|
||||||
++*pn;
|
++*pn;
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,7 +183,7 @@ INT obeying_ars = 0; /* -1 == no, 0 == dunno yet, 1 == yes */
|
||||||
*/
|
*/
|
||||||
static DWORD WINAPI threadFunc1(LPVOID p)
|
static DWORD WINAPI threadFunc1(LPVOID p)
|
||||||
{
|
{
|
||||||
t1Struct *tstruct = (t1Struct *)p;
|
t1Struct *tstruct = p;
|
||||||
int i;
|
int i;
|
||||||
/* write our thread # into shared memory */
|
/* write our thread # into shared memory */
|
||||||
tstruct->threadmem[tstruct->threadnum]=GetCurrentThreadId();
|
tstruct->threadmem[tstruct->threadnum]=GetCurrentThreadId();
|
||||||
|
@ -225,7 +225,7 @@ static DWORD WINAPI threadFunc3(LPVOID p)
|
||||||
|
|
||||||
static DWORD WINAPI threadFunc4(LPVOID p)
|
static DWORD WINAPI threadFunc4(LPVOID p)
|
||||||
{
|
{
|
||||||
HANDLE event = (HANDLE)p;
|
HANDLE event = p;
|
||||||
if(event != NULL) {
|
if(event != NULL) {
|
||||||
SetEvent(event);
|
SetEvent(event);
|
||||||
}
|
}
|
||||||
|
@ -236,7 +236,7 @@ static DWORD WINAPI threadFunc4(LPVOID p)
|
||||||
#if CHECK_STACK
|
#if CHECK_STACK
|
||||||
static DWORD WINAPI threadFunc5(LPVOID p)
|
static DWORD WINAPI threadFunc5(LPVOID p)
|
||||||
{
|
{
|
||||||
DWORD *exitCode = (DWORD *)p;
|
DWORD *exitCode = p;
|
||||||
SYSTEM_INFO sysInfo;
|
SYSTEM_INFO sysInfo;
|
||||||
sysInfo.dwPageSize=0;
|
sysInfo.dwPageSize=0;
|
||||||
GetSystemInfo(&sysInfo);
|
GetSystemInfo(&sysInfo);
|
||||||
|
@ -255,13 +255,13 @@ static DWORD WINAPI threadFunc5(LPVOID p)
|
||||||
|
|
||||||
static DWORD WINAPI threadFunc_SetEvent(LPVOID p)
|
static DWORD WINAPI threadFunc_SetEvent(LPVOID p)
|
||||||
{
|
{
|
||||||
SetEvent((HANDLE) p);
|
SetEvent(p);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DWORD WINAPI threadFunc_CloseHandle(LPVOID p)
|
static DWORD WINAPI threadFunc_CloseHandle(LPVOID p)
|
||||||
{
|
{
|
||||||
CloseHandle((HANDLE) p);
|
CloseHandle(p);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -550,8 +550,7 @@ static VOID test_TerminateThread(void)
|
||||||
HANDLE thread,access_thread,event;
|
HANDLE thread,access_thread,event;
|
||||||
DWORD threadId,exitCode;
|
DWORD threadId,exitCode;
|
||||||
event=CreateEventA(NULL,TRUE,FALSE,NULL);
|
event=CreateEventA(NULL,TRUE,FALSE,NULL);
|
||||||
thread = CreateThread(NULL,0,threadFunc4,
|
thread = CreateThread(NULL,0,threadFunc4,event,0,&threadId);
|
||||||
(LPVOID)event, 0,&threadId);
|
|
||||||
ok(thread!=NULL,"Create Thread failed\n");
|
ok(thread!=NULL,"Create Thread failed\n");
|
||||||
/* TerminateThread has a race condition in Wine. If the thread is terminated
|
/* TerminateThread has a race condition in Wine. If the thread is terminated
|
||||||
before it starts, it leaves a process behind. Therefore, we wait for the
|
before it starts, it leaves a process behind. Therefore, we wait for the
|
||||||
|
|
|
@ -44,7 +44,7 @@ static BOOL (WINAPI *pThread32Next)(HANDLE, LPTHREADENTRY32);
|
||||||
|
|
||||||
static DWORD WINAPI sub_thread(void* pmt)
|
static DWORD WINAPI sub_thread(void* pmt)
|
||||||
{
|
{
|
||||||
DWORD w = WaitForSingleObject((HANDLE)pmt, WAIT_TIME);
|
DWORD w = WaitForSingleObject(pmt, WAIT_TIME);
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1304,7 +1304,7 @@ void WINAPI __regs_K32Thk1632Prolog( CONTEXT86 *context )
|
||||||
DWORD argSize = context->Ebp - context->Esp;
|
DWORD argSize = context->Ebp - context->Esp;
|
||||||
char *stack16 = (char *)context->Esp - 4;
|
char *stack16 = (char *)context->Esp - 4;
|
||||||
STACK16FRAME *frame16 = (STACK16FRAME *)stack16 - 1;
|
STACK16FRAME *frame16 = (STACK16FRAME *)stack16 - 1;
|
||||||
STACK32FRAME *frame32 = (STACK32FRAME *)NtCurrentTeb()->WOW32Reserved;
|
STACK32FRAME *frame32 = NtCurrentTeb()->WOW32Reserved;
|
||||||
char *stack32 = (char *)frame32 - argSize;
|
char *stack32 = (char *)frame32 - argSize;
|
||||||
WORD stackSel = SELECTOROF(frame32->frame16);
|
WORD stackSel = SELECTOROF(frame32->frame16);
|
||||||
DWORD stackBase = GetSelectorBase(stackSel);
|
DWORD stackBase = GetSelectorBase(stackSel);
|
||||||
|
|
|
@ -160,9 +160,9 @@ static void fill_module( struct snapshot* snap, ULONG* offset, ULONG process,
|
||||||
mod->th32ProcessID = process ? process : GetCurrentProcessId();
|
mod->th32ProcessID = process ? process : GetCurrentProcessId();
|
||||||
mod->GlblcntUsage = 0xFFFF; /* FIXME */
|
mod->GlblcntUsage = 0xFFFF; /* FIXME */
|
||||||
mod->ProccntUsage = 0xFFFF; /* FIXME */
|
mod->ProccntUsage = 0xFFFF; /* FIXME */
|
||||||
mod->modBaseAddr = (BYTE*)ldr_mod[i].BaseAddress;
|
mod->modBaseAddr = ldr_mod[i].BaseAddress;
|
||||||
mod->modBaseSize = ldr_mod[i].SizeOfImage;
|
mod->modBaseSize = ldr_mod[i].SizeOfImage;
|
||||||
mod->hModule = (HMODULE)ldr_mod[i].BaseAddress;
|
mod->hModule = ldr_mod[i].BaseAddress;
|
||||||
|
|
||||||
l = min(ldr_mod[i].BaseDllName.Length, sizeof(mod->szModule) - sizeof(WCHAR));
|
l = min(ldr_mod[i].BaseDllName.Length, sizeof(mod->szModule) - sizeof(WCHAR));
|
||||||
memcpy(mod->szModule, ldr_mod[i].BaseDllName.Buffer, l);
|
memcpy(mod->szModule, ldr_mod[i].BaseDllName.Buffer, l);
|
||||||
|
@ -264,7 +264,7 @@ static void fill_thread( struct snapshot* snap, ULONG* offset, LPVOID info, ULON
|
||||||
|
|
||||||
thd_entry = (THREADENTRY32*)&snap->data[*offset];
|
thd_entry = (THREADENTRY32*)&snap->data[*offset];
|
||||||
|
|
||||||
spi = (SYSTEM_PROCESS_INFORMATION*)info;
|
spi = info;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
spi = (SYSTEM_PROCESS_INFORMATION*)((char*)spi + poff);
|
spi = (SYSTEM_PROCESS_INFORMATION*)((char*)spi + poff);
|
||||||
|
|
|
@ -1479,7 +1479,7 @@ HANDLE WINAPI FindFirstVolumeW( LPWSTR volume, DWORD len )
|
||||||
HeapFree( GetProcessHeap(), 0, output );
|
HeapFree( GetProcessHeap(), 0, output );
|
||||||
return INVALID_HANDLE_VALUE;
|
return INVALID_HANDLE_VALUE;
|
||||||
}
|
}
|
||||||
return (HANDLE)output;
|
return output;
|
||||||
}
|
}
|
||||||
CloseHandle( mgr );
|
CloseHandle( mgr );
|
||||||
return INVALID_HANDLE_VALUE;
|
return INVALID_HANDLE_VALUE;
|
||||||
|
|
Loading…
Reference in New Issue