[SDK] Fix 64 bit issues

This commit is contained in:
Timo Kreuzer 2018-04-23 11:58:34 +02:00
parent ae9e9eaef3
commit e39876dab7
5 changed files with 23 additions and 23 deletions

View file

@ -226,7 +226,7 @@ static LPITEMIDLIST _GetDocumentsPidl()
* SHExplorerParseCmdLine [BROWSEUI.107] * SHExplorerParseCmdLine [BROWSEUI.107]
*/ */
extern "C" extern "C"
UINT UINT_PTR
WINAPI WINAPI
SHExplorerParseCmdLine(ExplorerCommandLineParseResults * pInfo) SHExplorerParseCmdLine(ExplorerCommandLineParseResults * pInfo)
{ {

View file

@ -310,7 +310,7 @@ C_ASSERT(HEAP_CREATE_VALID_MASK == 0x0007F0FF);
// //
// Activation Contexts // Activation Contexts
// //
#define INVALID_ACTIVATION_CONTEXT (PVOID)0xFFFFFFFF #define INVALID_ACTIVATION_CONTEXT ((PVOID)(LONG_PTR)-1)
// //
// C++ CONST casting // C++ CONST casting

View file

@ -107,7 +107,7 @@ void WINAPI InitOCHostClass(long param8);
long WINAPI SHOpenFolderWindow(PIE_THREAD_PARAM_BLOCK parameters); long WINAPI SHOpenFolderWindow(PIE_THREAD_PARAM_BLOCK parameters);
void WINAPI SHCreateSavedWindows(void); void WINAPI SHCreateSavedWindows(void);
BOOL WINAPI SHCreateFromDesktop(PEXPLORER_CMDLINE_PARSE_RESULTS parseResults); BOOL WINAPI SHCreateFromDesktop(PEXPLORER_CMDLINE_PARSE_RESULTS parseResults);
UINT WINAPI SHExplorerParseCmdLine(PEXPLORER_CMDLINE_PARSE_RESULTS pParseResults); UINT_PTR WINAPI SHExplorerParseCmdLine(PEXPLORER_CMDLINE_PARSE_RESULTS pParseResults);
void WINAPI UEMRegisterNotify(long param8, long paramC); void WINAPI UEMRegisterNotify(long param8, long paramC);
HRESULT WINAPI SHCreateBandForPidl(LPCITEMIDLIST param8, IUnknown *paramC, BOOL param10); HRESULT WINAPI SHCreateBandForPidl(LPCITEMIDLIST param8, IUnknown *paramC, BOOL param10);
HRESULT WINAPI SHPidlFromDataObject(IDataObject *param8, long *paramC, long param10, FILEDESCRIPTORW *param14); HRESULT WINAPI SHPidlFromDataObject(IDataObject *param8, long *paramC, long param10, FILEDESCRIPTORW *param14);

View file

@ -13,11 +13,11 @@
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
static unsigned int static size_t
InfpSubstituteString(PINFCACHE Inf, InfpSubstituteString(PINFCACHE Inf,
const WCHAR *text, const WCHAR *text,
WCHAR *buffer, WCHAR *buffer,
unsigned int size); size_t size);
static void static void
ShortToHex(PWCHAR Buffer, ShortToHex(PWCHAR Buffer,
@ -36,7 +36,7 @@ ShortToHex(PWCHAR Buffer,
static PCWSTR static PCWSTR
InfpGetSubstitutionString(PINFCACHE Inf, InfpGetSubstitutionString(PINFCACHE Inf,
PCWSTR str, PCWSTR str,
unsigned int *len, size_t *len,
BOOL no_trailing_slash) BOOL no_trailing_slash)
{ {
static const WCHAR percent = '%'; static const WCHAR percent = '%';
@ -105,7 +105,7 @@ InfpGetSubstitutionString(PINFCACHE Inf,
if (Status == STATUS_SUCCESS) if (Status == STATUS_SUCCESS)
{ {
*len = strlenW(Data); *len = strlenW(Data);
DPRINT("Substitute: %S Length: %ul\n", Data, *len); DPRINT("Substitute: %S Length: %zu\n", Data, *len);
return Data; return Data;
} }
@ -116,14 +116,14 @@ InfpGetSubstitutionString(PINFCACHE Inf,
/* do string substitutions on the specified text */ /* do string substitutions on the specified text */
/* the buffer is assumed to be large enough */ /* the buffer is assumed to be large enough */
/* returns necessary length not including terminating null */ /* returns necessary length not including terminating null */
static unsigned int static size_t
InfpSubstituteString(PINFCACHE Inf, InfpSubstituteString(PINFCACHE Inf,
PCWSTR text, PCWSTR text,
PWSTR buffer, PWSTR buffer,
unsigned int size) size_t size)
{ {
const WCHAR *start, *subst, *p; const WCHAR *start, *subst, *p;
unsigned int len, total = 0; size_t len, total = 0;
int inside = 0; int inside = 0;
if (!buffer) size = MAX_INF_STRING_LENGTH + 1; if (!buffer) size = MAX_INF_STRING_LENGTH + 1;
@ -133,7 +133,7 @@ InfpSubstituteString(PINFCACHE Inf,
inside = !inside; inside = !inside;
if (inside) /* start of a %xx% string */ if (inside) /* start of a %xx% string */
{ {
len = (unsigned int)(p - start); len = (p - start);
if (len > size - 1) len = size - 1; if (len > size - 1) len = size - 1;
if (buffer) memcpy( buffer + total, start, len * sizeof(WCHAR) ); if (buffer) memcpy( buffer + total, start, len * sizeof(WCHAR) );
total += len; total += len;
@ -142,12 +142,12 @@ InfpSubstituteString(PINFCACHE Inf,
} }
else /* end of the %xx% string, find substitution */ else /* end of the %xx% string, find substitution */
{ {
len = (unsigned int)(p - start - 1); len = (p - start - 1);
subst = InfpGetSubstitutionString( Inf, start + 1, &len, p[1] == '\\' ); subst = InfpGetSubstitutionString( Inf, start + 1, &len, p[1] == '\\' );
if (!subst) if (!subst)
{ {
subst = start; subst = start;
len = (unsigned int)(p - start + 1); len = (p - start + 1);
} }
if (len > size - 1) len = size - 1; if (len > size - 1) len = size - 1;
if (buffer) memcpy( buffer + total, subst, len * sizeof(WCHAR) ); if (buffer) memcpy( buffer + total, subst, len * sizeof(WCHAR) );
@ -546,7 +546,7 @@ InfpGetStringField(PINFCONTEXT Context,
PINFCACHEFIELD CacheField; PINFCACHEFIELD CacheField;
ULONG Index; ULONG Index;
PWCHAR Ptr; PWCHAR Ptr;
ULONG Size; SIZE_T Size;
if (Context == NULL || Context->Line == NULL) if (Context == NULL || Context->Line == NULL)
{ {

View file

@ -31,7 +31,7 @@ DumpSkiplist(PSKIPLIST Skiplist)
for (j = 1; j < pNode->Distance[i]; j++) for (j = 1; j < pNode->Distance[i]; j++)
printf("---"); printf("---");
printf("%02lu", (DWORD)pNode->Next[i]->Element); printf("%02Iu", (DWORD_PTR)pNode->Next[i]->Element);
pNode = pNode->Next[i]; pNode = pNode->Next[i];
} }
@ -51,7 +51,7 @@ MyAlloc(DWORD Size)
int WINAPI int WINAPI
MyCompare(PVOID A, PVOID B) MyCompare(PVOID A, PVOID B)
{ {
return (DWORD)A - (DWORD)B; return (DWORD_PTR)A - (DWORD_PTR)B;
} }
void WINAPI void WINAPI
@ -63,7 +63,7 @@ MyFree(PVOID Ptr)
int int
main() main()
{ {
DWORD Element; PVOID Element;
DWORD ElementIndex; DWORD ElementIndex;
DWORD i; DWORD i;
SKIPLIST Skiplist; SKIPLIST Skiplist;
@ -74,23 +74,23 @@ main()
// Insert some random elements with random numbers. // Insert some random elements with random numbers.
for (i = 0; i < 40; i++) for (i = 0; i < 40; i++)
InsertElementSkiplist(&Skiplist, (PVOID)(rand() % 100)); InsertElementSkiplist(&Skiplist, UlongToPtr(rand() % 100));
// Delete all with index 0 to 29. // Delete all with index 0 to 29.
for (i = 0; i < 30; i++) for (i = 0; i < 30; i++)
DeleteElementSkiplist(&Skiplist, (PVOID)i); DeleteElementSkiplist(&Skiplist, UlongToPtr(i));
// Insert some more random elements. // Insert some more random elements.
for (i = 0; i < 40; i++) for (i = 0; i < 40; i++)
InsertElementSkiplist(&Skiplist, (PVOID)(rand() % 100)); InsertElementSkiplist(&Skiplist, UlongToPtr(rand() % 100));
// Output the third element (with zero-based index 2). // Output the third element (with zero-based index 2).
pNode = LookupNodeByIndexSkiplist(&Skiplist, 2); pNode = LookupNodeByIndexSkiplist(&Skiplist, 2);
printf("Element = %lu for index 2\n", (DWORD)pNode->Element); printf("Element = %Iu for index 2\n", (DWORD_PTR)pNode->Element);
// Check if an element with number 44 is in the list and output its index. // Check if an element with number 44 is in the list and output its index.
Element = (DWORD)LookupElementSkiplist(&Skiplist, (PVOID)44, &ElementIndex); Element = LookupElementSkiplist(&Skiplist, UlongToPtr(44), &ElementIndex);
printf("Element = %lu, ElementIndex = %lu\n\n", Element, ElementIndex); printf("Element = %p, ElementIndex = %lu\n\n", Element, ElementIndex);
DumpSkiplist(&Skiplist); DumpSkiplist(&Skiplist);