https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e39876dab780fab79d6aa…
commit e39876dab780fab79d6aa061049a098abd3a4ebc
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Mon Apr 23 11:58:34 2018 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Sun Jul 1 14:45:21 2018 +0200
[SDK] Fix 64 bit issues
---
dll/win32/browseui/parsecmdline.cpp | 2 +-
sdk/include/ndk/rtltypes.h | 2 +-
sdk/include/reactos/browseui_undoc.h | 2 +-
sdk/lib/inflib/infget.c | 22 +++++++++++-----------
sdk/lib/skiplist/skiplist_test.c | 18 +++++++++---------
5 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/dll/win32/browseui/parsecmdline.cpp b/dll/win32/browseui/parsecmdline.cpp
index acf617607f..ad2b4fa475 100644
--- a/dll/win32/browseui/parsecmdline.cpp
+++ b/dll/win32/browseui/parsecmdline.cpp
@@ -226,7 +226,7 @@ static LPITEMIDLIST _GetDocumentsPidl()
* SHExplorerParseCmdLine [BROWSEUI.107]
*/
extern "C"
-UINT
+UINT_PTR
WINAPI
SHExplorerParseCmdLine(ExplorerCommandLineParseResults * pInfo)
{
diff --git a/sdk/include/ndk/rtltypes.h b/sdk/include/ndk/rtltypes.h
index b526f9ea04..7070564389 100644
--- a/sdk/include/ndk/rtltypes.h
+++ b/sdk/include/ndk/rtltypes.h
@@ -310,7 +310,7 @@ C_ASSERT(HEAP_CREATE_VALID_MASK == 0x0007F0FF);
//
// Activation Contexts
//
-#define INVALID_ACTIVATION_CONTEXT (PVOID)0xFFFFFFFF
+#define INVALID_ACTIVATION_CONTEXT ((PVOID)(LONG_PTR)-1)
//
// C++ CONST casting
diff --git a/sdk/include/reactos/browseui_undoc.h b/sdk/include/reactos/browseui_undoc.h
index 4ea2dcf605..0bc1d12db6 100644
--- a/sdk/include/reactos/browseui_undoc.h
+++ b/sdk/include/reactos/browseui_undoc.h
@@ -107,7 +107,7 @@ void WINAPI InitOCHostClass(long param8);
long WINAPI SHOpenFolderWindow(PIE_THREAD_PARAM_BLOCK parameters);
void WINAPI SHCreateSavedWindows(void);
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);
HRESULT WINAPI SHCreateBandForPidl(LPCITEMIDLIST param8, IUnknown *paramC, BOOL
param10);
HRESULT WINAPI SHPidlFromDataObject(IDataObject *param8, long *paramC, long param10,
FILEDESCRIPTORW *param14);
diff --git a/sdk/lib/inflib/infget.c b/sdk/lib/inflib/infget.c
index f148c59273..5e1ccdbf3b 100644
--- a/sdk/lib/inflib/infget.c
+++ b/sdk/lib/inflib/infget.c
@@ -13,11 +13,11 @@
#define NDEBUG
#include <debug.h>
-static unsigned int
+static size_t
InfpSubstituteString(PINFCACHE Inf,
const WCHAR *text,
WCHAR *buffer,
- unsigned int size);
+ size_t size);
static void
ShortToHex(PWCHAR Buffer,
@@ -36,7 +36,7 @@ ShortToHex(PWCHAR Buffer,
static PCWSTR
InfpGetSubstitutionString(PINFCACHE Inf,
PCWSTR str,
- unsigned int *len,
+ size_t *len,
BOOL no_trailing_slash)
{
static const WCHAR percent = '%';
@@ -105,7 +105,7 @@ InfpGetSubstitutionString(PINFCACHE Inf,
if (Status == STATUS_SUCCESS)
{
*len = strlenW(Data);
- DPRINT("Substitute: %S Length: %ul\n", Data, *len);
+ DPRINT("Substitute: %S Length: %zu\n", Data, *len);
return Data;
}
@@ -116,14 +116,14 @@ InfpGetSubstitutionString(PINFCACHE Inf,
/* do string substitutions on the specified text */
/* the buffer is assumed to be large enough */
/* returns necessary length not including terminating null */
-static unsigned int
+static size_t
InfpSubstituteString(PINFCACHE Inf,
PCWSTR text,
PWSTR buffer,
- unsigned int size)
+ size_t size)
{
const WCHAR *start, *subst, *p;
- unsigned int len, total = 0;
+ size_t len, total = 0;
int inside = 0;
if (!buffer) size = MAX_INF_STRING_LENGTH + 1;
@@ -133,7 +133,7 @@ InfpSubstituteString(PINFCACHE Inf,
inside = !inside;
if (inside) /* start of a %xx% string */
{
- len = (unsigned int)(p - start);
+ len = (p - start);
if (len > size - 1) len = size - 1;
if (buffer) memcpy( buffer + total, start, len * sizeof(WCHAR) );
total += len;
@@ -142,12 +142,12 @@ InfpSubstituteString(PINFCACHE Inf,
}
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] ==
'\\' );
if (!subst)
{
subst = start;
- len = (unsigned int)(p - start + 1);
+ len = (p - start + 1);
}
if (len > size - 1) len = size - 1;
if (buffer) memcpy( buffer + total, subst, len * sizeof(WCHAR) );
@@ -546,7 +546,7 @@ InfpGetStringField(PINFCONTEXT Context,
PINFCACHEFIELD CacheField;
ULONG Index;
PWCHAR Ptr;
- ULONG Size;
+ SIZE_T Size;
if (Context == NULL || Context->Line == NULL)
{
diff --git a/sdk/lib/skiplist/skiplist_test.c b/sdk/lib/skiplist/skiplist_test.c
index 17d9337463..5413910ea7 100644
--- a/sdk/lib/skiplist/skiplist_test.c
+++ b/sdk/lib/skiplist/skiplist_test.c
@@ -31,7 +31,7 @@ DumpSkiplist(PSKIPLIST Skiplist)
for (j = 1; j < pNode->Distance[i]; j++)
printf("---");
- printf("%02lu", (DWORD)pNode->Next[i]->Element);
+ printf("%02Iu", (DWORD_PTR)pNode->Next[i]->Element);
pNode = pNode->Next[i];
}
@@ -51,7 +51,7 @@ MyAlloc(DWORD Size)
int WINAPI
MyCompare(PVOID A, PVOID B)
{
- return (DWORD)A - (DWORD)B;
+ return (DWORD_PTR)A - (DWORD_PTR)B;
}
void WINAPI
@@ -63,7 +63,7 @@ MyFree(PVOID Ptr)
int
main()
{
- DWORD Element;
+ PVOID Element;
DWORD ElementIndex;
DWORD i;
SKIPLIST Skiplist;
@@ -74,23 +74,23 @@ main()
// Insert some random elements with random numbers.
for (i = 0; i < 40; i++)
- InsertElementSkiplist(&Skiplist, (PVOID)(rand() % 100));
+ InsertElementSkiplist(&Skiplist, UlongToPtr(rand() % 100));
// Delete all with index 0 to 29.
for (i = 0; i < 30; i++)
- DeleteElementSkiplist(&Skiplist, (PVOID)i);
+ DeleteElementSkiplist(&Skiplist, UlongToPtr(i));
// Insert some more random elements.
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).
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.
- Element = (DWORD)LookupElementSkiplist(&Skiplist, (PVOID)44, &ElementIndex);
- printf("Element = %lu, ElementIndex = %lu\n\n", Element, ElementIndex);
+ Element = LookupElementSkiplist(&Skiplist, UlongToPtr(44), &ElementIndex);
+ printf("Element = %p, ElementIndex = %lu\n\n", Element, ElementIndex);
DumpSkiplist(&Skiplist);