mirror of
https://github.com/reactos/reactos.git
synced 2025-01-10 05:33:37 +08:00
[SDK] Fix 64 bit issues
This commit is contained in:
parent
ae9e9eaef3
commit
e39876dab7
@ -226,7 +226,7 @@ static LPITEMIDLIST _GetDocumentsPidl()
|
||||
* SHExplorerParseCmdLine [BROWSEUI.107]
|
||||
*/
|
||||
extern "C"
|
||||
UINT
|
||||
UINT_PTR
|
||||
WINAPI
|
||||
SHExplorerParseCmdLine(ExplorerCommandLineParseResults * pInfo)
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user