ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
August 2018
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
32 participants
304 discussions
Start a n
N
ew thread
04/04: [ZIPFLDR] Add 'Extract All' to individual item context menu.
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=572976bb1458d57a97733…
commit 572976bb1458d57a97733a51a709e20f9c97c6e2 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Thu Aug 2 22:36:17 2018 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Aug 5 11:54:56 2018 +0200 [ZIPFLDR] Add 'Extract All' to individual item context menu. --- dll/shellext/zipfldr/CZipFolder.hpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/dll/shellext/zipfldr/CZipFolder.hpp b/dll/shellext/zipfldr/CZipFolder.hpp index 74dc42107b..b541263935 100644 --- a/dll/shellext/zipfldr/CZipFolder.hpp +++ b/dll/shellext/zipfldr/CZipFolder.hpp @@ -356,9 +356,33 @@ public: switch (uMsg) { case DFM_MERGECONTEXTMENU: - DPRINT1("FIXME: Add menu items for DFM_MERGECONTEXTMENU\n"); + { + CComQIIDPtr<I_ID(IContextMenu)> spContextMenu(psf); + if (!spContextMenu) + return E_NOINTERFACE; + + QCMINFO *pqcminfo = (QCMINFO *)lParam; + HRESULT hr = spContextMenu->QueryContextMenu(pqcminfo->hmenu, + pqcminfo->indexMenu, + pqcminfo->idCmdFirst, + pqcminfo->idCmdLast, + CMF_NORMAL); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + pqcminfo->indexMenu += HRESULT_CODE(hr); return S_OK; + } case DFM_INVOKECOMMAND: + { + CComQIIDPtr<I_ID(IContextMenu)> spContextMenu(psf); + if (!spContextMenu) + return E_NOINTERFACE; + + CMINVOKECOMMANDINFO ici = { sizeof(ici) }; + ici.lpVerb = MAKEINTRESOURCEA(wParam); + return spContextMenu->InvokeCommand(&ici); + } case DFM_INVOKECOMMANDEX: case DFM_GETDEFSTATICID: // Required for Windows 7 to pick a default return S_FALSE;
6 years, 4 months
1
0
0
0
03/04: [ZIPFLDR] Add 'Extract All' menu item to the folder context menu.
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=875e58d7818bd569d99be…
commit 875e58d7818bd569d99bebdc4543ee3b3bd37286 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Thu Aug 2 21:36:54 2018 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Aug 5 11:54:56 2018 +0200 [ZIPFLDR] Add 'Extract All' menu item to the folder context menu. --- dll/shellext/zipfldr/CZipFolder.hpp | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/dll/shellext/zipfldr/CZipFolder.hpp b/dll/shellext/zipfldr/CZipFolder.hpp index 2b7010c4fa..74dc42107b 100644 --- a/dll/shellext/zipfldr/CZipFolder.hpp +++ b/dll/shellext/zipfldr/CZipFolder.hpp @@ -301,10 +301,15 @@ public: return hr; } - if (riid == IID_IExplorerCommandProvider) + else if (riid == IID_IExplorerCommandProvider) { return _CExplorerCommandProvider_CreateInstance(this, riid, ppvOut); } + else if (riid == IID_IContextMenu) + { + // Folder context menu + return QueryInterface(riid, ppvOut); + } if (UnknownIID != riid) DbgPrint("%s(%S) UNHANDLED\n", __FUNCTION__, guid2string(riid)); return E_NOTIMPL; @@ -379,6 +384,7 @@ public: } else if (riid == IID_IContextMenu && cidl >= 0) { + // Context menu of an object inside the zip const ZipPidlEntry* zipEntry = _ZipFromIL(*apidl); if (zipEntry) { @@ -473,9 +479,9 @@ public: } STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO pici) { - if (!pici || pici->cbSize != sizeof(*pici)) + if (!pici || (pici->cbSize != sizeof(CMINVOKECOMMANDINFO) && pici->cbSize != sizeof(CMINVOKECOMMANDINFOEX))) return E_INVALIDARG; - + if (pici->lpVerb == MAKEINTRESOURCEA(0) || (HIWORD(pici->lpVerb) && !strcmp(pici->lpVerb, EXTRACT_VERBA))) { BSTR ZipFile = m_ZipFile.AllocSysString(); @@ -495,12 +501,18 @@ public: { int Entries = 0; - CStringW menuText(MAKEINTRESOURCEW(IDS_MENUITEM)); + if (!(uFlags & CMF_DEFAULTONLY)) + { + CStringW menuText(MAKEINTRESOURCEW(IDS_MENUITEM)); - InsertMenuW(hmenu, indexMenu++, MF_BYPOSITION | MF_SEPARATOR, 0, NULL); - Entries++; - InsertMenuW(hmenu, indexMenu++, MF_BYPOSITION | MF_STRING, idCmdFirst++, menuText); - Entries++; + if (indexMenu) + { + InsertMenuW(hmenu, indexMenu++, MF_BYPOSITION | MF_SEPARATOR, 0, NULL); + Entries++; + } + InsertMenuW(hmenu, indexMenu++, MF_BYPOSITION | MF_STRING, idCmdFirst++, menuText); + Entries++; + } return MAKE_HRESULT(SEVERITY_SUCCESS, 0, Entries); }
6 years, 4 months
1
0
0
0
02/04: [ATL] Fix the CComQIIDPtr template.
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=09719d25c42a840bfb7d7…
commit 09719d25c42a840bfb7d77f3319f707cf4e04bb5 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Fri Aug 3 20:45:20 2018 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Aug 5 11:54:56 2018 +0200 [ATL] Fix the CComQIIDPtr template. --- sdk/lib/atl/atlcomcli.h | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/sdk/lib/atl/atlcomcli.h b/sdk/lib/atl/atlcomcli.h index 20151dba9f..229c585fdd 100644 --- a/sdk/lib/atl/atlcomcli.h +++ b/sdk/lib/atl/atlcomcli.h @@ -150,13 +150,16 @@ public: //CComQIIDPtr<I_ID(Itype)> is the gcc compatible version of CComQIPtr<Itype> -#define I_ID(Itype) Itype,IID_##Itype +#define I_ID(Itype) Itype,&IID_##Itype template <class T, const IID* piid> -class CComQIIDPtr : +class CComQIIDPtr : public CComPtr<T> { public: + // Let's tell GCC how to find a symbol. + using CComPtr<T>::p; + CComQIIDPtr() { } @@ -172,37 +175,37 @@ public: { if (lp != NULL) { - if (FAILED(lp->QueryInterface(*piid, (void **)&this.p))) - this.p = NULL; + if (FAILED(lp->QueryInterface(*piid, reinterpret_cast<void **>(&p)))) + p = NULL; } } T *operator = (T *lp) { - if (this.p != NULL) - this.p->Release(); - this.p = lp; - if (this.p != NULL) - this.p->AddRef(); + if (p != NULL) + p->Release(); + p = lp; + if (p != NULL) + p->AddRef(); return *this; } T *operator = (const CComQIIDPtr<T,piid> &lp) { - if (this.p != NULL) - this.p->Release(); - this.p = lp.p; - if (this.p != NULL) - this.p->AddRef(); + if (p != NULL) + p->Release(); + p = lp.p; + if (p != NULL) + p->AddRef(); return *this; } T * operator=(IUnknown* lp) { - if (this.p != NULL) - this.p->Release(); + if (p != NULL) + p->Release(); - if (FAILED(lp->QueryInterface(*piid, (void **)&this.p))) - this.p = NULL; + if (FAILED(lp->QueryInterface(*piid, reinterpret_cast<void **>(&p)))) + p = NULL; return *this; }
6 years, 4 months
1
0
0
0
01/04: [ZIPFLDR] Implement RouteTheCall, so that applications can 'launch' zip files
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=eb324b6a9cc7bfe8f49ac…
commit eb324b6a9cc7bfe8f49acd23fea6f5832fac3a05 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sun Apr 22 00:00:34 2018 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Aug 5 11:54:56 2018 +0200 [ZIPFLDR] Implement RouteTheCall, so that applications can 'launch' zip files --- dll/shellext/zipfldr/zipfldr.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dll/shellext/zipfldr/zipfldr.cpp b/dll/shellext/zipfldr/zipfldr.cpp index 27a354e0a1..2b9e5b6380 100644 --- a/dll/shellext/zipfldr/zipfldr.cpp +++ b/dll/shellext/zipfldr/zipfldr.cpp @@ -109,9 +109,13 @@ BOOL WINAPI RouteTheCall( IN HWND hWndOwner, IN HINSTANCE hInstance, - IN LPWSTR lpNamedPipeName, + IN LPCSTR lpStringArg, IN INT Show) { - UNIMPLEMENTED; - return FALSE; + CStringW path = lpStringArg; + PathRemoveBlanksW(path.GetBuffer()); + path.ReleaseBuffer(); + path = L"\"" + path + L"\""; + ShellExecuteW(NULL, L"open", L"explorer.exe", path.GetString(), NULL, SW_SHOWNORMAL); + return TRUE; }
6 years, 4 months
1
0
0
0
01/01: [HAL] Add NT6-compatible version of HalpMapPhysicalMemory64 and HalpUnmapVirtualAddress
by Denis Malikov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4ea570975cfdaa9d27514…
commit 4ea570975cfdaa9d275143dda29df1983db931f7 Author: Denis Malikov <filedem(a)gmail.com> AuthorDate: Sun Feb 4 22:59:21 2018 +0700 Commit: Thomas Faber <thomas.faber(a)reactos.org> CommitDate: Sun Aug 5 10:14:57 2018 +0200 [HAL] Add NT6-compatible version of HalpMapPhysicalMemory64 and HalpUnmapVirtualAddress --- hal/halx86/acpi/busemul.c | 5 +++++ hal/halx86/generic/memory.c | 29 +++++++++++++++++++++++++---- hal/halx86/include/halp.h | 16 ++++++++++++++++ hal/halx86/legacy/bussupp.c | 5 +++++ 4 files changed, 51 insertions(+), 4 deletions(-) diff --git a/hal/halx86/acpi/busemul.c b/hal/halx86/acpi/busemul.c index 17697a4d3b..87ff519994 100644 --- a/hal/halx86/acpi/busemul.c +++ b/hal/halx86/acpi/busemul.c @@ -26,8 +26,13 @@ HalpRegisterKdSupportFunctions(VOID) /* Register memory functions */ #ifndef _MINIHAL_ +#if (NTDDI_VERSION >= NTDDI_VISTA) + KdMapPhysicalMemory64 = HalpMapPhysicalMemory64Vista; + KdUnmapVirtualAddress = HalpUnmapVirtualAddressVista; +#else KdMapPhysicalMemory64 = HalpMapPhysicalMemory64; KdUnmapVirtualAddress = HalpUnmapVirtualAddress; +#endif #endif /* Register ACPI stub */ diff --git a/hal/halx86/generic/memory.c b/hal/halx86/generic/memory.c index 587503fca1..14b7f67a6b 100644 --- a/hal/halx86/generic/memory.c +++ b/hal/halx86/generic/memory.c @@ -139,6 +139,23 @@ PVOID NTAPI HalpMapPhysicalMemory64(IN PHYSICAL_ADDRESS PhysicalAddress, IN PFN_COUNT PageCount) +{ + return HalpMapPhysicalMemory64Vista(PhysicalAddress, PageCount, TRUE); +} + +VOID +NTAPI +HalpUnmapVirtualAddress(IN PVOID VirtualAddress, + IN PFN_COUNT PageCount) +{ + HalpUnmapVirtualAddressVista(VirtualAddress, PageCount, TRUE); +} + +PVOID +NTAPI +HalpMapPhysicalMemory64Vista(IN PHYSICAL_ADDRESS PhysicalAddress, + IN PFN_COUNT PageCount, + IN BOOLEAN FlushCurrentTLB) { PHARDWARE_PTE PointerPte; PFN_NUMBER UsedPages = 0; @@ -199,14 +216,17 @@ HalpMapPhysicalMemory64(IN PHYSICAL_ADDRESS PhysicalAddress, } /* Flush the TLB and return the address */ - HalpFlushTLB(); + if (FlushCurrentTLB) + HalpFlushTLB(); + return VirtualAddress; } VOID NTAPI -HalpUnmapVirtualAddress(IN PVOID VirtualAddress, - IN PFN_COUNT PageCount) +HalpUnmapVirtualAddressVista(IN PVOID VirtualAddress, + IN PFN_COUNT PageCount, + IN BOOLEAN FlushCurrentTLB) { PHARDWARE_PTE PointerPte; ULONG i; @@ -226,7 +246,8 @@ HalpUnmapVirtualAddress(IN PVOID VirtualAddress, } /* Flush the TLB */ - HalpFlushTLB(); + if (FlushCurrentTLB) + HalpFlushTLB(); /* Put the heap back */ if (HalpHeapStart > VirtualAddress) HalpHeapStart = VirtualAddress; diff --git a/hal/halx86/include/halp.h b/hal/halx86/include/halp.h index ed430910fd..a8e935ff9b 100644 --- a/hal/halx86/include/halp.h +++ b/hal/halx86/include/halp.h @@ -646,6 +646,22 @@ HalpAllocPhysicalMemory( IN BOOLEAN Aligned ); +PVOID +NTAPI +HalpMapPhysicalMemory64Vista( + IN PHYSICAL_ADDRESS PhysicalAddress, + IN PFN_COUNT PageCount, + IN BOOLEAN FlushCurrentTLB +); + +VOID +NTAPI +HalpUnmapVirtualAddressVista( + IN PVOID VirtualAddress, + IN PFN_COUNT NumberPages, + IN BOOLEAN FlushCurrentTLB +); + PVOID NTAPI HalpMapPhysicalMemory64( diff --git a/hal/halx86/legacy/bussupp.c b/hal/halx86/legacy/bussupp.c index 595bdeff53..a37d875ede 100644 --- a/hal/halx86/legacy/bussupp.c +++ b/hal/halx86/legacy/bussupp.c @@ -1228,8 +1228,13 @@ HalpRegisterKdSupportFunctions(VOID) /* Register memory functions */ #ifndef _MINIHAL_ +#if (NTDDI_VERSION >= NTDDI_VISTA) + KdMapPhysicalMemory64 = HalpMapPhysicalMemory64Vista; + KdUnmapVirtualAddress = HalpUnmapVirtualAddressVista; +#else KdMapPhysicalMemory64 = HalpMapPhysicalMemory64; KdUnmapVirtualAddress = HalpUnmapVirtualAddress; +#endif #endif /* Register ACPI stub */
6 years, 4 months
1
0
0
0
01/01: [LSASRV] Implement and call the policy change notification routine
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4e32ad36235ac8608c8f0…
commit 4e32ad36235ac8608c8f0ea302cea7243737db24 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sun Aug 5 01:05:52 2018 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sun Aug 5 01:05:52 2018 +0200 [LSASRV] Implement and call the policy change notification routine --- dll/win32/lsasrv/lsarpc.c | 10 +++++++++ dll/win32/lsasrv/lsasrv.h | 4 ++++ dll/win32/lsasrv/notify.c | 53 ++++++++++++++++++++++++++++++++++++++++------- 3 files changed, 60 insertions(+), 7 deletions(-) diff --git a/dll/win32/lsasrv/lsarpc.c b/dll/win32/lsasrv/lsarpc.c index 5f314e8c2b..987d9701c6 100644 --- a/dll/win32/lsasrv/lsarpc.c +++ b/dll/win32/lsasrv/lsarpc.c @@ -707,21 +707,29 @@ NTSTATUS WINAPI LsarSetInformationPolicy( case PolicyAuditEventsInformation: /* 2 */ Status = LsarSetAuditEvents(PolicyObject, (PLSAPR_POLICY_AUDIT_EVENTS_INFO)PolicyInformation); + if (NT_SUCCESS(Status)) + LsapNotifyPolicyChange(PolicyNotifyAuditEventsInformation); break; case PolicyPrimaryDomainInformation: /* 3 */ Status = LsarSetPrimaryDomain(PolicyObject, (PLSAPR_POLICY_PRIMARY_DOM_INFO)PolicyInformation); + if (NT_SUCCESS(Status)) + LsapNotifyPolicyChange(PolicyNotifyDnsDomainInformation); break; case PolicyAccountDomainInformation: /* 5 */ Status = LsarSetAccountDomain(PolicyObject, (PLSAPR_POLICY_ACCOUNT_DOM_INFO)PolicyInformation); + if (NT_SUCCESS(Status)) + LsapNotifyPolicyChange(PolicyNotifyAccountDomainInformation); break; case PolicyLsaServerRoleInformation: /* 6 */ Status = LsarSetServerRole(PolicyObject, (PPOLICY_LSA_SERVER_ROLE_INFO)PolicyInformation); + if (NT_SUCCESS(Status)) + LsapNotifyPolicyChange(PolicyNotifyServerRoleInformation); break; case PolicyReplicaSourceInformation: /* 7 */ @@ -747,6 +755,8 @@ NTSTATUS WINAPI LsarSetInformationPolicy( case PolicyDnsDomainInformation: /* 12 (0xC) */ Status = LsarSetDnsDomain(PolicyObject, (PLSAPR_POLICY_DNS_DOMAIN_INFO)PolicyInformation); + if (NT_SUCCESS(Status)) + LsapNotifyPolicyChange(PolicyNotifyDnsDomainInformation); break; case PolicyDnsDomainInformationInt: /* 13 (0xD) */ diff --git a/dll/win32/lsasrv/lsasrv.h b/dll/win32/lsasrv/lsasrv.h index cbff5e2b86..174a8fb6f4 100644 --- a/dll/win32/lsasrv/lsasrv.h +++ b/dll/win32/lsasrv/lsasrv.h @@ -217,6 +217,10 @@ NTSTATUS LsapRegisterNotification( PLSA_API_MSG RequestMsg); +VOID +LsapNotifyPolicyChange( + POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass); + /* policy.c */ NTSTATUS LsarQueryAuditLog(PLSA_DB_OBJECT PolicyObject, diff --git a/dll/win32/lsasrv/notify.c b/dll/win32/lsasrv/notify.c index 48f09c7ecf..c5233ce0bc 100644 --- a/dll/win32/lsasrv/notify.c +++ b/dll/win32/lsasrv/notify.c @@ -32,8 +32,9 @@ LsapInitNotificationList(VOID) static PLSA_NOTIFICATION_ENTRY -LsapGetNotificationEntryByHandle( - HANDLE EventHandle) +LsapGetNotificationEntry( + HANDLE EventHandle, + POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass) { PLIST_ENTRY NotificationEntry; PLSA_NOTIFICATION_ENTRY CurrentNotification; @@ -43,7 +44,8 @@ LsapGetNotificationEntryByHandle( { CurrentNotification = CONTAINING_RECORD(NotificationEntry, LSA_NOTIFICATION_ENTRY, Entry); - if (CurrentNotification->EventHandle == EventHandle) + if ((CurrentNotification->EventHandle == EventHandle) && + (CurrentNotification->InformationClass == InformationClass)) return CurrentNotification; NotificationEntry = NotificationEntry->Flink; @@ -67,6 +69,7 @@ LsapRegisterNotification( if (pRequestMsg->PolicyChangeNotify.Request.Register) { + /* Register the notification event */ pEntry = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LSA_NOTIFICATION_ENTRY)); @@ -84,12 +87,17 @@ LsapRegisterNotification( } else { - pEntry = LsapGetNotificationEntryByHandle(pRequestMsg->PolicyChangeNotify.Request.NotificationEventHandle); - if (pEntry) + /* Unregister the notification event */ + pEntry = LsapGetNotificationEntry(pRequestMsg->PolicyChangeNotify.Request.NotificationEventHandle, + pRequestMsg->PolicyChangeNotify.Request.InformationClass); + if (pEntry == NULL) { - RemoveEntryList(&pEntry->Entry); - RtlFreeHeap(RtlGetProcessHeap(), 0, pEntry); + Status = STATUS_INVALID_HANDLE; + goto done; } + + RemoveEntryList(&pEntry->Entry); + RtlFreeHeap(RtlGetProcessHeap(), 0, pEntry); } done: @@ -99,4 +107,35 @@ done: return Status; } + +VOID +LsapNotifyPolicyChange( + POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass) +{ + PLIST_ENTRY NotificationEntry; + PLSA_NOTIFICATION_ENTRY CurrentNotification; + + FIXME("LsapNotifyPolicyChange(%lu)\n", InformationClass); + + /* Acquire the notification list lock shared */ + RtlAcquireResourceShared(&NotificationListLock, TRUE); + + NotificationEntry = NotificationListHead.Flink; + while (NotificationEntry != &NotificationListHead) + { + CurrentNotification = CONTAINING_RECORD(NotificationEntry, LSA_NOTIFICATION_ENTRY, Entry); + + if (CurrentNotification->InformationClass == InformationClass) + { + FIXME("Notify event %p\n", CurrentNotification->EventHandle); + + } + + NotificationEntry = NotificationEntry->Flink; + } + + /* Release the notification list lock */ + RtlReleaseResource(&NotificationListLock); +} + /* EOF */
6 years, 4 months
1
0
0
0
01/01: [LSASRV][SECUR32] Implement LsaRegisterPolicyChangeNotification and LsaUnregisterPolicyChangeNotification
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=620217cec9e3dea4bf6fa…
commit 620217cec9e3dea4bf6fa504044ae616bc130796 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sat Aug 4 22:17:52 2018 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sat Aug 4 22:17:52 2018 +0200 [LSASRV][SECUR32] Implement LsaRegisterPolicyChangeNotification and LsaUnregisterPolicyChangeNotification --- dll/win32/lsasrv/CMakeLists.txt | 1 + dll/win32/lsasrv/authport.c | 5 ++ dll/win32/lsasrv/lsasrv.c | 3 + dll/win32/lsasrv/lsasrv.h | 8 +++ dll/win32/lsasrv/notify.c | 102 +++++++++++++++++++++++++++++++ dll/win32/secur32/lsalpc.c | 88 +++++++++++++++++++++++--- sdk/include/psdk/ntsecapi.h | 4 ++ sdk/include/reactos/subsys/lsass/lsass.h | 20 ++++++ 8 files changed, 221 insertions(+), 10 deletions(-) diff --git a/dll/win32/lsasrv/CMakeLists.txt b/dll/win32/lsasrv/CMakeLists.txt index 9627fe8900..13d3ab4398 100644 --- a/dll/win32/lsasrv/CMakeLists.txt +++ b/dll/win32/lsasrv/CMakeLists.txt @@ -17,6 +17,7 @@ list(APPEND SOURCE lookup.c lsarpc.c lsasrv.c + notify.c policy.c privileges.c registry.c diff --git a/dll/win32/lsasrv/authport.c b/dll/win32/lsasrv/authport.c index 0475969642..8e0b128b0f 100644 --- a/dll/win32/lsasrv/authport.c +++ b/dll/win32/lsasrv/authport.c @@ -242,6 +242,11 @@ AuthPortThreadRoutine(PVOID Param) ReplyMsg = &RequestMsg; break; + case LSASS_REQUEST_POLICY_CHANGE_NOTIFY: + RequestMsg.Status = LsapRegisterNotification(&RequestMsg); + ReplyMsg = &RequestMsg; + break; + default: RequestMsg.Status = STATUS_INVALID_SYSTEM_SERVICE; ReplyMsg = &RequestMsg; diff --git a/dll/win32/lsasrv/lsasrv.c b/dll/win32/lsasrv/lsasrv.c index 206c10ec06..b92e0e6ff9 100644 --- a/dll/win32/lsasrv/lsasrv.c +++ b/dll/win32/lsasrv/lsasrv.c @@ -293,6 +293,9 @@ LsapInitLsa(VOID) /* Initialize logon sessions */ LsapInitLogonSessions(); + /* Initialize the notification list */ + LsapInitNotificationList(); + /* Initialize registered authentication packages */ Status = LsapInitAuthPackages(); if (!NT_SUCCESS(Status)) diff --git a/dll/win32/lsasrv/lsasrv.h b/dll/win32/lsasrv/lsasrv.h index 8a772aba21..cbff5e2b86 100644 --- a/dll/win32/lsasrv/lsasrv.h +++ b/dll/win32/lsasrv/lsasrv.h @@ -209,6 +209,14 @@ LsapLookupSids(PLSAPR_SID_ENUM_BUFFER SidEnumBuffer, NTSTATUS LsarStartRpcServer(VOID); +/* notify.c */ +VOID +LsapInitNotificationList(VOID); + +NTSTATUS +LsapRegisterNotification( + PLSA_API_MSG RequestMsg); + /* policy.c */ NTSTATUS LsarQueryAuditLog(PLSA_DB_OBJECT PolicyObject, diff --git a/dll/win32/lsasrv/notify.c b/dll/win32/lsasrv/notify.c new file mode 100644 index 0000000000..48f09c7ecf --- /dev/null +++ b/dll/win32/lsasrv/notify.c @@ -0,0 +1,102 @@ +/* + * PROJECT: Local Security Authority Server DLL + * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) + * PURPOSE: LSA policy change notifications + * COPYRIGHT: Eric Kohl 2018 + */ + +#include "lsasrv.h" + +typedef struct _LSA_NOTIFICATION_ENTRY +{ + LIST_ENTRY Entry; + POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass; + HANDLE EventHandle; +} LSA_NOTIFICATION_ENTRY, *PLSA_NOTIFICATION_ENTRY; + +/* GLOBALS *****************************************************************/ + +static LIST_ENTRY NotificationListHead; +static RTL_RESOURCE NotificationListLock; + + +/* FUNCTIONS ***************************************************************/ + +VOID +LsapInitNotificationList(VOID) +{ + InitializeListHead(&NotificationListHead); + RtlInitializeResource(&NotificationListLock); +} + + +static +PLSA_NOTIFICATION_ENTRY +LsapGetNotificationEntryByHandle( + HANDLE EventHandle) +{ + PLIST_ENTRY NotificationEntry; + PLSA_NOTIFICATION_ENTRY CurrentNotification; + + NotificationEntry = NotificationListHead.Flink; + while (NotificationEntry != &NotificationListHead) + { + CurrentNotification = CONTAINING_RECORD(NotificationEntry, LSA_NOTIFICATION_ENTRY, Entry); + + if (CurrentNotification->EventHandle == EventHandle) + return CurrentNotification; + + NotificationEntry = NotificationEntry->Flink; + } + + return NULL; +} + + +NTSTATUS +LsapRegisterNotification( + PLSA_API_MSG pRequestMsg) +{ + PLSA_NOTIFICATION_ENTRY pEntry; + NTSTATUS Status = STATUS_SUCCESS; + + FIXME("LsapRegisterNotification(%p)\n", pRequestMsg); + + /* Acquire the notification list lock exclusively */ + RtlAcquireResourceExclusive(&NotificationListLock, TRUE); + + if (pRequestMsg->PolicyChangeNotify.Request.Register) + { + pEntry = RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(LSA_NOTIFICATION_ENTRY)); + if (pEntry == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + pEntry->InformationClass = pRequestMsg->PolicyChangeNotify.Request.InformationClass; + pEntry->EventHandle = pRequestMsg->PolicyChangeNotify.Request.NotificationEventHandle; + + InsertHeadList(&NotificationListHead, + &pEntry->Entry); + } + else + { + pEntry = LsapGetNotificationEntryByHandle(pRequestMsg->PolicyChangeNotify.Request.NotificationEventHandle); + if (pEntry) + { + RemoveEntryList(&pEntry->Entry); + RtlFreeHeap(RtlGetProcessHeap(), 0, pEntry); + } + } + +done: + /* Release the notification list lock */ + RtlReleaseResource(&NotificationListLock); + + return Status; +} + +/* EOF */ diff --git a/dll/win32/secur32/lsalpc.c b/dll/win32/secur32/lsalpc.c index ff44f69063..58a806cbb5 100644 --- a/dll/win32/secur32/lsalpc.c +++ b/dll/win32/secur32/lsalpc.c @@ -322,28 +322,96 @@ LsaGetLogonSessionData( /* - * @unimplemented + * @implemented */ NTSTATUS NTAPI -LsaRegisterPolicyChangeNotification(POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass, - HANDLE NotificationEventHandle) +LsaRegisterPolicyChangeNotification( + POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass, + HANDLE NotificationEventHandle) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + LSA_API_MSG ApiMessage; + NTSTATUS Status; + + TRACE("LsaRegisterPolicyChangeNotification(%lu %p)\n", + InformationClass, NotificationEventHandle); + + Status = LsapOpenLsaPort(); + if (!NT_SUCCESS(Status)) + return Status; + + ApiMessage.ApiNumber = LSASS_REQUEST_POLICY_CHANGE_NOTIFY; + ApiMessage.h.u1.s1.DataLength = LSA_PORT_DATA_SIZE(ApiMessage.PolicyChangeNotify); + ApiMessage.h.u1.s1.TotalLength = LSA_PORT_MESSAGE_SIZE; + ApiMessage.h.u2.ZeroInit = 0; + + ApiMessage.PolicyChangeNotify.Request.InformationClass = InformationClass; + ApiMessage.PolicyChangeNotify.Request.NotificationEventHandle = NotificationEventHandle; + ApiMessage.PolicyChangeNotify.Request.Register = TRUE; + + Status = NtRequestWaitReplyPort(LsaPortHandle, + (PPORT_MESSAGE)&ApiMessage, + (PPORT_MESSAGE)&ApiMessage); + if (!NT_SUCCESS(Status)) + { + ERR("NtRequestWaitReplyPort() failed (Status 0x%08lx)\n", Status); + return Status; + } + + if (!NT_SUCCESS(ApiMessage.Status)) + { + ERR("NtRequestWaitReplyPort() failed (ApiMessage.Status 0x%08lx)\n", ApiMessage.Status); + return ApiMessage.Status; + } + + return Status; } /* - * @unimplemented + * @implemented */ NTSTATUS NTAPI -LsaUnregisterPolicyChangeNotification(POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass, - HANDLE NotificationEventHandle) +LsaUnregisterPolicyChangeNotification( + POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass, + HANDLE NotificationEventHandle) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + LSA_API_MSG ApiMessage; + NTSTATUS Status; + + TRACE("LsaUnregisterPolicyChangeNotification(%lu %p)\n", + InformationClass, NotificationEventHandle); + + Status = LsapOpenLsaPort(); + if (!NT_SUCCESS(Status)) + return Status; + + ApiMessage.ApiNumber = LSASS_REQUEST_POLICY_CHANGE_NOTIFY; + ApiMessage.h.u1.s1.DataLength = LSA_PORT_DATA_SIZE(ApiMessage.PolicyChangeNotify); + ApiMessage.h.u1.s1.TotalLength = LSA_PORT_MESSAGE_SIZE; + ApiMessage.h.u2.ZeroInit = 0; + + ApiMessage.PolicyChangeNotify.Request.InformationClass = InformationClass; + ApiMessage.PolicyChangeNotify.Request.NotificationEventHandle = NotificationEventHandle; + ApiMessage.PolicyChangeNotify.Request.Register = FALSE; + + Status = NtRequestWaitReplyPort(LsaPortHandle, + (PPORT_MESSAGE)&ApiMessage, + (PPORT_MESSAGE)&ApiMessage); + if (!NT_SUCCESS(Status)) + { + ERR("NtRequestWaitReplyPort() failed (Status 0x%08lx)\n", Status); + return Status; + } + + if (!NT_SUCCESS(ApiMessage.Status)) + { + ERR("NtRequestWaitReplyPort() failed (ApiMessage.Status 0x%08lx)\n", ApiMessage.Status); + return ApiMessage.Status; + } + + return Status; } /* EOF */ diff --git a/sdk/include/psdk/ntsecapi.h b/sdk/include/psdk/ntsecapi.h index 13d9d2c8ef..52e9407dc0 100644 --- a/sdk/include/psdk/ntsecapi.h +++ b/sdk/include/psdk/ntsecapi.h @@ -770,6 +770,8 @@ NTSTATUS NTAPI LsaQueryTrustedDomainInfo(LSA_HANDLE,PSID, NTSTATUS NTAPI LsaQueryTrustedDomainInfoByName(LSA_HANDLE,PLSA_UNICODE_STRING, TRUSTED_INFORMATION_CLASS,PVOID*); NTSTATUS NTAPI LsaRegisterLogonProcess(PLSA_STRING,PHANDLE,PLSA_OPERATIONAL_MODE); +NTSTATUS NTAPI LsaRegisterPolicyChangeNotification(POLICY_NOTIFICATION_INFORMATION_CLASS, + HANDLE); NTSTATUS NTAPI LsaRemoveAccountRights(LSA_HANDLE,PSID,BOOLEAN, PLSA_UNICODE_STRING,ULONG); NTSTATUS NTAPI LsaRemovePrivilegesFromAccount(LSA_HANDLE,BOOLEAN,PPRIVILEGE_SET); @@ -790,6 +792,8 @@ NTSTATUS NTAPI LsaSetTrustedDomainInfoByName(LSA_HANDLE,PLSA_UNICODE_STRING, TRUSTED_INFORMATION_CLASS,PVOID); NTSTATUS NTAPI LsaStorePrivateData(LSA_HANDLE,PLSA_UNICODE_STRING, PLSA_UNICODE_STRING); +NTSTATUS NTAPI LsaUnregisterPolicyChangeNotification(POLICY_NOTIFICATION_INFORMATION_CLASS, + HANDLE); typedef NTSTATUS (NTAPI *PSAM_PASSWORD_NOTIFICATION_ROUTINE)(PUNICODE_STRING, ULONG,PUNICODE_STRING); typedef BOOLEAN (NTAPI *PSAM_INIT_NOTIFICATION_ROUTINE)(VOID); diff --git a/sdk/include/reactos/subsys/lsass/lsass.h b/sdk/include/reactos/subsys/lsass/lsass.h index 2004288b01..4d889c0e6c 100644 --- a/sdk/include/reactos/subsys/lsass/lsass.h +++ b/sdk/include/reactos/subsys/lsass/lsass.h @@ -23,6 +23,7 @@ typedef enum _LSA_API_NUMBER LSASS_REQUEST_LOOKUP_AUTHENTICATION_PACKAGE, LSASS_REQUEST_ENUM_LOGON_SESSIONS, LSASS_REQUEST_GET_LOGON_SESSION_DATA, + LSASS_REQUEST_POLICY_CHANGE_NOTIFY, LSASS_REQUEST_MAXIMUM } LSA_API_NUMBER, *PLSA_API_NUMBER; @@ -152,6 +153,24 @@ typedef struct _LSA_GET_LOGON_SESSION_DATA_MSG } LSA_GET_LOGON_SESSION_DATA_MSG, *PLSA_GET_LOGON_SESSION_DATA_MSG; +typedef struct _LSA_POLICY_CHANGE_NOTIFY_MSG +{ + union + { + struct + { + POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass; + HANDLE NotificationEventHandle; + BOOLEAN Register; + } Request; + struct + { + ULONG Dummy; + } Reply; + }; +} LSA_POLICY_CHANGE_NOTIFY_MSG, *PLSA_POLICY_CHANGE_NOTIFY_MSG; + + typedef struct _LSA_API_MSG { PORT_MESSAGE h; @@ -170,6 +189,7 @@ typedef struct _LSA_API_MSG LSA_LOOKUP_AUTHENTICATION_PACKAGE_MSG LookupAuthenticationPackage; LSA_ENUM_LOGON_SESSIONS_MSG EnumLogonSessions; LSA_GET_LOGON_SESSION_DATA_MSG GetLogonSessionData; + LSA_POLICY_CHANGE_NOTIFY_MSG PolicyChangeNotify; }; }; };
6 years, 4 months
1
0
0
0
16/16: [REACTOS] Fix 64 bit issues
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cf77354dceaa68dbcdf07…
commit cf77354dceaa68dbcdf0713a3a0db8a170a1f881 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sat Jul 7 16:09:03 2018 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Aug 4 19:19:34 2018 +0200 [REACTOS] Fix 64 bit issues --- base/services/tcpsvcs/daytime.c | 2 +- base/services/tcpsvcs/log.c | 15 +++++++++++---- base/shell/explorer/startctxmnu.cpp | 2 +- base/shell/explorer/traywnd.cpp | 2 +- base/system/smss/sminit.c | 8 ++++---- hal/halx86/generic/dma.c | 12 ++++++------ sdk/lib/cmlib/hiveinit.c | 4 ++-- sdk/tools/mkhive/rtl.c | 9 ++++++--- subsystems/win32/csrsrv/server.c | 4 ++-- win32ss/drivers/displays/framebuf_new/enable.c | 2 +- win32ss/drivers/miniport/vmx_svga/vmx_svga.c | 2 +- 11 files changed, 36 insertions(+), 26 deletions(-) diff --git a/base/services/tcpsvcs/daytime.c b/base/services/tcpsvcs/daytime.c index b6e4a46b56..75ca525fc3 100644 --- a/base/services/tcpsvcs/daytime.c +++ b/base/services/tcpsvcs/daytime.c @@ -14,7 +14,7 @@ static BOOL SendTime(SOCKET sock, CHAR *time) { - DWORD stringSize = strlen(time) + 1; + SIZE_T stringSize = strlen(time) + 1; if (send(sock, time, stringSize, 0) == SOCKET_ERROR) { LogEvent(L"DayTime: Error sending data", WSAGetLastError(), 0, LOG_ERROR); diff --git a/base/services/tcpsvcs/log.c b/base/services/tcpsvcs/log.c index 2cb0543c32..3b2d467d71 100644 --- a/base/services/tcpsvcs/log.c +++ b/base/services/tcpsvcs/log.c @@ -70,20 +70,20 @@ LogToFile(LPCWSTR lpMsg, UINT flags) { LPWSTR lpFullMsg = NULL; - DWORD msgLen; + SIZE_T msgLen; msgLen = wcslen(lpMsg) + 1; if (flags & LOG_ERROR) { - LPVOID lpSysMsg; + LPWSTR lpSysMsg; DWORD eMsgLen; eMsgLen = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, errNum, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR)&lpSysMsg, + (LPWSTR)&lpSysMsg, 0, NULL); @@ -122,6 +122,13 @@ LogToFile(LPCWSTR lpMsg, } } + /* Make sure the length in bytes doesn't overflow a DWORD */ + msgLen = wcslen(lpFullMsg); + if (msgLen > (MAXDWORD / sizeof(WCHAR))) + { + RaiseException(EXCEPTION_INT_OVERFLOW, 0, 0, NULL); + } + if (lpFullMsg) { DWORD bytesWritten; @@ -130,7 +137,7 @@ LogToFile(LPCWSTR lpMsg, bRet = WriteFile(hLogFile, lpFullMsg, - wcslen(lpFullMsg) * sizeof(WCHAR), + (DWORD)msgLen * sizeof(WCHAR), &bytesWritten, &olWrite); if (!bRet) diff --git a/base/shell/explorer/startctxmnu.cpp b/base/shell/explorer/startctxmnu.cpp index 590ada5062..ba5b766266 100644 --- a/base/shell/explorer/startctxmnu.cpp +++ b/base/shell/explorer/startctxmnu.cpp @@ -182,7 +182,7 @@ public: virtual HRESULT STDMETHODCALLTYPE InvokeCommand(LPCMINVOKECOMMANDINFO lpici) { - UINT uiCmdId = (UINT)lpici->lpVerb; + UINT uiCmdId = PtrToUlong(lpici->lpVerb); if (uiCmdId != 0) { if ((uiCmdId >= ID_SHELL_CMD_FIRST) && (uiCmdId <= ID_SHELL_CMD_LAST)) diff --git a/base/shell/explorer/traywnd.cpp b/base/shell/explorer/traywnd.cpp index 8fd6c55f19..63ece92395 100644 --- a/base/shell/explorer/traywnd.cpp +++ b/base/shell/explorer/traywnd.cpp @@ -3322,7 +3322,7 @@ public: virtual HRESULT STDMETHODCALLTYPE InvokeCommand(LPCMINVOKECOMMANDINFO lpici) { - UINT uiCmdId = (UINT) lpici->lpVerb; + UINT uiCmdId = PtrToUlong(lpici->lpVerb); if (uiCmdId != 0) { if (uiCmdId >= m_idCmdCmFirst) diff --git a/base/system/smss/sminit.c b/base/system/smss/sminit.c index 8fc6ab317d..49141ff2d0 100644 --- a/base/system/smss/sminit.c +++ b/base/system/smss/sminit.c @@ -1536,9 +1536,9 @@ SmpInitializeKnownDllsInternal(IN PUNICODE_STRING Directory, /* Checksum failed, so don't even try going further -- kill SMSS */ RtlInitUnicodeString(&ErrorResponse, L"Verification of a KnownDLL failed."); - ErrorParameters[0] = (ULONG)&ErrorResponse; + ErrorParameters[0] = (ULONG_PTR)&ErrorResponse; ErrorParameters[1] = Status; - ErrorParameters[2] = (ULONG)&RegEntry->Value; + ErrorParameters[2] = (ULONG_PTR)&RegEntry->Value; SmpTerminate(ErrorParameters, 5, RTL_NUMBER_OF(ErrorParameters)); } else if (!(ImageCharacteristics & IMAGE_FILE_DLL)) @@ -1546,9 +1546,9 @@ SmpInitializeKnownDllsInternal(IN PUNICODE_STRING Directory, /* An invalid known DLL entry will also kill SMSS */ RtlInitUnicodeString(&ErrorResponse, L"Non-DLL file included in KnownDLL list."); - ErrorParameters[0] = (ULONG)&ErrorResponse; + ErrorParameters[0] = (ULONG_PTR)&ErrorResponse; ErrorParameters[1] = STATUS_INVALID_IMPORT_OF_NON_DLL; - ErrorParameters[2] = (ULONG)&RegEntry->Value; + ErrorParameters[2] = (ULONG_PTR)&RegEntry->Value; SmpTerminate(ErrorParameters, 5, RTL_NUMBER_OF(ErrorParameters)); } diff --git a/hal/halx86/generic/dma.c b/hal/halx86/generic/dma.c index af3d82351f..48748c7d5a 100644 --- a/hal/halx86/generic/dma.c +++ b/hal/halx86/generic/dma.c @@ -152,8 +152,8 @@ HalpInitDma(VOID) * Check if Extended DMA is available. We're just going to do a random * read and write. */ - WRITE_PORT_UCHAR((PUCHAR)FIELD_OFFSET(EISA_CONTROL, DmaController2Pages.Channel2), 0x2A); - if (READ_PORT_UCHAR((PUCHAR)FIELD_OFFSET(EISA_CONTROL, DmaController2Pages.Channel2)) == 0x2A) + WRITE_PORT_UCHAR(UlongToPtr(FIELD_OFFSET(EISA_CONTROL, DmaController2Pages.Channel2)), 0x2A); + if (READ_PORT_UCHAR(UlongToPtr(FIELD_OFFSET(EISA_CONTROL, DmaController2Pages.Channel2))) == 0x2A) { DPRINT1("Machine supports EISA DMA. Bus type: %lu\n", HalpBusType); HalpEisaDma = TRUE; @@ -479,11 +479,11 @@ HalpDmaInitializeEisaAdapter(IN PADAPTER_OBJECT AdapterObject, if (Controller == 1) { - AdapterBaseVa = (PVOID)FIELD_OFFSET(EISA_CONTROL, DmaController1); + AdapterBaseVa = UlongToPtr(FIELD_OFFSET(EISA_CONTROL, DmaController1)); } else { - AdapterBaseVa = (PVOID)FIELD_OFFSET(EISA_CONTROL, DmaController2); + AdapterBaseVa = UlongToPtr(FIELD_OFFSET(EISA_CONTROL, DmaController2)); } AdapterObject->AdapterNumber = Controller; @@ -517,12 +517,12 @@ HalpDmaInitializeEisaAdapter(IN PADAPTER_OBJECT AdapterObject, if (Controller == 1) { - WRITE_PORT_UCHAR((PUCHAR)FIELD_OFFSET(EISA_CONTROL, DmaExtendedMode1), + WRITE_PORT_UCHAR(UlongToPtr(FIELD_OFFSET(EISA_CONTROL, DmaExtendedMode1)), ExtendedMode.Byte); } else { - WRITE_PORT_UCHAR((PUCHAR)FIELD_OFFSET(EISA_CONTROL, DmaExtendedMode2), + WRITE_PORT_UCHAR(UlongToPtr(FIELD_OFFSET(EISA_CONTROL, DmaExtendedMode2)), ExtendedMode.Byte); } } diff --git a/sdk/lib/cmlib/hiveinit.c b/sdk/lib/cmlib/hiveinit.c index 7aab1797de..ba4e784fbc 100644 --- a/sdk/lib/cmlib/hiveinit.c +++ b/sdk/lib/cmlib/hiveinit.c @@ -231,12 +231,12 @@ HvpInitializeMemoryHive( SIZE_T ChunkSize; ChunkSize = ChunkBase->Length; - DPRINT("ChunkSize: %lx\n", ChunkSize); + DPRINT("ChunkSize: %zx\n", ChunkSize); if (ChunkSize < sizeof(HBASE_BLOCK) || !HvpVerifyHiveHeader(ChunkBase)) { - DPRINT1("Registry is corrupt: ChunkSize %lu < sizeof(HBASE_BLOCK) %lu, " + DPRINT1("Registry is corrupt: ChunkSize 0x%zx < sizeof(HBASE_BLOCK) 0x%zx, " "or HvpVerifyHiveHeader() failed\n", ChunkSize, sizeof(HBASE_BLOCK)); return STATUS_REGISTRY_CORRUPT; } diff --git a/sdk/tools/mkhive/rtl.c b/sdk/tools/mkhive/rtl.c index f2c84c7fde..3bef91da9a 100644 --- a/sdk/tools/mkhive/rtl.c +++ b/sdk/tools/mkhive/rtl.c @@ -166,9 +166,12 @@ KeBugCheckEx( IN ULONG_PTR BugCheckParameter4) { char Buffer[70]; - printf("*** STOP: 0x%08X (0x%08lX, 0x%08lX, 0x%08lX, 0x%08lX)", - BugCheckCode, BugCheckParameter1, BugCheckParameter2, - BugCheckParameter3, BugCheckParameter4); + printf("*** STOP: 0x%08X (0x%p,0x%p,0x%p,0x%p)", + BugCheckCode, + (PVOID)BugCheckParameter1, + (PVOID)BugCheckParameter2, + (PVOID)BugCheckParameter3, + (PVOID)BugCheckParameter4); ASSERT(FALSE); } diff --git a/subsystems/win32/csrsrv/server.c b/subsystems/win32/csrsrv/server.c index 2ac9ba8cd7..c161bb4166 100644 --- a/subsystems/win32/csrsrv/server.c +++ b/subsystems/win32/csrsrv/server.c @@ -338,7 +338,7 @@ CsrSrvCreateSharedSection(IN PCHAR ParameterValue) ULONG Size; NTSTATUS Status; LARGE_INTEGER SectionSize; - ULONG ViewSize = 0; + SIZE_T ViewSize = 0; PPEB Peb = NtCurrentPeb(); /* If there's no parameter, fail */ @@ -457,7 +457,7 @@ CsrSrvAttachSharedSection(IN PCSR_PROCESS CsrProcess OPTIONAL, OUT PCSR_API_CONNECTINFO ConnectInfo) { NTSTATUS Status; - ULONG ViewSize = 0; + SIZE_T ViewSize = 0; /* Check if we have a process */ if (CsrProcess) diff --git a/win32ss/drivers/displays/framebuf_new/enable.c b/win32ss/drivers/displays/framebuf_new/enable.c index 76c06df5ea..f22ef24f76 100644 --- a/win32ss/drivers/displays/framebuf_new/enable.c +++ b/win32ss/drivers/displays/framebuf_new/enable.c @@ -456,7 +456,7 @@ DEVMODEW *pdm) cOutputModes--; - pdm = (LPDEVMODEW) ( ((ULONG)pdm) + sizeof(DEVMODEW) + + pdm = (LPDEVMODEW) ( ((ULONG_PTR)pdm) + sizeof(DEVMODEW) + DRIVER_EXTRA_SIZE); cbOutputSize += (sizeof(DEVMODEW) + DRIVER_EXTRA_SIZE); diff --git a/win32ss/drivers/miniport/vmx_svga/vmx_svga.c b/win32ss/drivers/miniport/vmx_svga/vmx_svga.c index 605c5e5056..0afd883fec 100644 --- a/win32ss/drivers/miniport/vmx_svga/vmx_svga.c +++ b/win32ss/drivers/miniport/vmx_svga/vmx_svga.c @@ -125,7 +125,7 @@ VmxFindAdapter(IN PVOID HwDeviceExtension, } /* Zero the frame buffer */ - VideoPortZeroMemory((PVOID)DeviceExtension->FrameBuffer.LowPart, + VideoPortZeroMemory((PVOID)(ULONG_PTR)DeviceExtension->FrameBuffer.QuadPart, DeviceExtension->VramSize.LowPart); /* Initialize the video modes */
6 years, 4 months
1
0
0
0
15/16: [DLLS] Fix 64 bit issues
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0f8439aa71c3349282eea…
commit 0f8439aa71c3349282eea09e001965744292eaaa Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Mon Apr 23 11:42:32 2018 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Aug 4 19:19:34 2018 +0200 [DLLS] Fix 64 bit issues --- dll/cpl/sysdm/hardprof.c | 2 +- dll/directx/ksuser/ksuser.c | 4 +-- dll/directx/wine/d3dcompiler_43/utils.c | 2 +- dll/ntdll/ldr/ldrapi.c | 2 +- dll/ntdll/ldr/ldrinit.c | 6 ++-- dll/win32/browseui/parsecmdline.cpp | 4 +-- dll/win32/fltlib/fltlib.c | 4 +-- dll/win32/fltlib/message.c | 4 +-- dll/win32/iphlpapi/ifenum_reactos.c | 4 +-- dll/win32/kernel32/client/file/create.c | 10 +++---- dll/win32/kernel32/client/file/lfile.c | 4 +-- dll/win32/kernel32/client/thread.c | 3 +- dll/win32/lsasrv/authpackage.c | 4 +-- dll/win32/lsasrv/session.c | 6 ++-- dll/win32/msafd/misc/dllmain.c | 49 +++++++++++++++++---------------- dll/win32/msafd/msafd.h | 13 +++++---- dll/win32/msgina/shutdown.c | 2 +- dll/win32/mswsock/mswhelper.c | 30 ++++++++++---------- dll/win32/psapi/psapi.c | 4 +-- dll/win32/shimgvw/shimgvw.c | 2 +- dll/win32/uxtheme/nonclient.c | 4 +-- dll/win32/wshtcpip/iflist.c | 4 +-- win32ss/gdi/gdi32/include/gdi32p.h | 2 +- 23 files changed, 88 insertions(+), 81 deletions(-) diff --git a/dll/cpl/sysdm/hardprof.c b/dll/cpl/sysdm/hardprof.c index 328e320b2c..4ecf955bed 100644 --- a/dll/cpl/sysdm/hardprof.c +++ b/dll/cpl/sysdm/hardprof.c @@ -567,7 +567,7 @@ GetProfile( L"PreferenceOrder", NULL, NULL, - (LPBYTE)pProfile->dwPreferenceOrder, + (LPBYTE)&pProfile->dwPreferenceOrder, &dwSize); if (lError == ERROR_SUCCESS) { diff --git a/dll/directx/ksuser/ksuser.c b/dll/directx/ksuser/ksuser.c index 864483908f..12b54e9626 100644 --- a/dll/directx/ksuser/ksuser.c +++ b/dll/directx/ksuser/ksuser.c @@ -20,8 +20,8 @@ KsiCreateObjectType( HANDLE hHandle, PHANDLE phHandle) { NTSTATUS Status; - ULONG Length; - ULONG TotalSize; + SIZE_T Length; + SIZE_T TotalSize; LPWSTR pStr; UNICODE_STRING ObjectName; OBJECT_ATTRIBUTES ObjectAttributes; diff --git a/dll/directx/wine/d3dcompiler_43/utils.c b/dll/directx/wine/d3dcompiler_43/utils.c index 79f3be8840..9d32677a81 100644 --- a/dll/directx/wine/d3dcompiler_43/utils.c +++ b/dll/directx/wine/d3dcompiler_43/utils.c @@ -557,7 +557,7 @@ HRESULT dxbc_add_section(struct dxbc *dxbc, DWORD tag, const char *data, DWORD d return S_OK; } -HRESULT dxbc_init(struct dxbc *dxbc, UINT size) +HRESULT dxbc_init(struct dxbc *dxbc, DWORD size) { TRACE("dxbc %p, size %u.\n", dxbc, size); diff --git a/dll/ntdll/ldr/ldrapi.c b/dll/ntdll/ldr/ldrapi.c index 2f8cc68340..6e4019c600 100644 --- a/dll/ntdll/ldr/ldrapi.c +++ b/dll/ntdll/ldr/ldrapi.c @@ -124,7 +124,7 @@ LdrUnlockLoaderLock(IN ULONG Flags, /* Validate the cookie */ if ((Cookie & 0xF0000000) || - ((Cookie >> 16) ^ ((ULONG)(NtCurrentTeb()->RealClientId.UniqueThread) & 0xFFF))) + ((Cookie >> 16) ^ (HandleToUlong(NtCurrentTeb()->RealClientId.UniqueThread) & 0xFFF))) { DPRINT1("LdrUnlockLoaderLock() called with an invalid cookie!\n"); diff --git a/dll/ntdll/ldr/ldrinit.c b/dll/ntdll/ldr/ldrinit.c index 902a797d15..dc0a3701cc 100644 --- a/dll/ntdll/ldr/ldrinit.c +++ b/dll/ntdll/ldr/ldrinit.c @@ -136,7 +136,7 @@ LdrOpenImageFileOptionsKey(IN PUNICODE_STRING SubKey, if (NT_SUCCESS(Status)) { /* Write the key handle */ - if (_InterlockedCompareExchange((LONG*)RootKeyLocation, (LONG)RootKey, 0) != 0) + if (InterlockedCompareExchangePointer(RootKeyLocation, RootKey, NULL) != NULL) { /* Someone already opened it, use it instead */ NtClose(RootKey); @@ -460,8 +460,8 @@ LdrpInitSecurityCookie(PLDR_DATA_TABLE_ENTRY LdrEntry) NtQueryPerformanceCounter(&Counter, NULL); NewCookie = Counter.LowPart ^ Counter.HighPart; - NewCookie ^= (ULONG)NtCurrentTeb()->ClientId.UniqueProcess; - NewCookie ^= (ULONG)NtCurrentTeb()->ClientId.UniqueThread; + NewCookie ^= (ULONG_PTR)NtCurrentTeb()->ClientId.UniqueProcess; + NewCookie ^= (ULONG_PTR)NtCurrentTeb()->ClientId.UniqueThread; /* Loop like it's done in KeQueryTickCount(). We don't want to call it directly. */ while (SharedUserData->SystemTime.High1Time != SharedUserData->SystemTime.High2Time) diff --git a/dll/win32/browseui/parsecmdline.cpp b/dll/win32/browseui/parsecmdline.cpp index ad2b4fa475..855c089079 100644 --- a/dll/win32/browseui/parsecmdline.cpp +++ b/dll/win32/browseui/parsecmdline.cpp @@ -176,7 +176,7 @@ static LPITEMIDLIST _ILReadFromSharedMemory(PCWSTR strField) if (*strField != L':') return NULL; - HANDLE hData = (HANDLE) StrToIntW(strField + 1); + HANDLE hData = IntToPtr(StrToIntW(strField + 1)); PWSTR strSecond = StrChrW(strField + 1, L':'); if (strSecond) @@ -246,7 +246,7 @@ SHExplorerParseCmdLine(ExplorerCommandLineParseResults * pInfo) PathStripToRootW(strDir); pInfo->pidlPath = ILCreateFromPathW(strDir); } - return (LONG) (pInfo->pidlPath); + return (LONG_PTR)(pInfo->pidlPath); } PCWSTR strNextArg = _FindFirstField(strFieldArray); diff --git a/dll/win32/fltlib/fltlib.c b/dll/win32/fltlib/fltlib.c index ce99378e15..f39a106781 100644 --- a/dll/win32/fltlib/fltlib.c +++ b/dll/win32/fltlib/fltlib.c @@ -74,8 +74,8 @@ FilterLoadUnload(_In_z_ LPCWSTR lpFilterName, { PFILTER_NAME FilterName; HANDLE hFltMgr; - DWORD StringLength; - DWORD BufferLength; + SIZE_T StringLength; + SIZE_T BufferLength; DWORD dwError; /* Get a handle to the filter manager */ diff --git a/dll/win32/fltlib/message.c b/dll/win32/fltlib/message.c index bdbfcb3541..d05be26ea1 100644 --- a/dll/win32/fltlib/message.c +++ b/dll/win32/fltlib/message.c @@ -35,8 +35,8 @@ FilterConnectCommunicationPort(_In_ LPCWSTR lpPortName, UNICODE_STRING DeviceName; UNICODE_STRING PortName; HANDLE FileHandle; - ULONG PortNameSize; - ULONG BufferSize; + SIZE_T PortNameSize; + SIZE_T BufferSize; PCHAR Ptr; NTSTATUS Status; HRESULT hr; diff --git a/dll/win32/iphlpapi/ifenum_reactos.c b/dll/win32/iphlpapi/ifenum_reactos.c index 7557ef1f32..8bbdd63a50 100644 --- a/dll/win32/iphlpapi/ifenum_reactos.c +++ b/dll/win32/iphlpapi/ifenum_reactos.c @@ -62,8 +62,8 @@ NTSTATUS tdiGetMibForIfEntity NTSTATUS status = STATUS_SUCCESS; DWORD returnSize; - WARN("TdiGetMibForIfEntity(tcpFile %x,entityId %x)\n", - (int)tcpFile, (int)ent->tei_instance); + WARN("TdiGetMibForIfEntity(tcpFile %p,entityId %p)\n", + tcpFile, ent->tei_instance); req.ID.toi_class = INFO_CLASS_PROTOCOL; req.ID.toi_type = INFO_TYPE_PROVIDER; diff --git a/dll/win32/kernel32/client/file/create.c b/dll/win32/kernel32/client/file/create.c index ec91f9a9db..cbb6583076 100644 --- a/dll/win32/kernel32/client/file/create.c +++ b/dll/win32/kernel32/client/file/create.c @@ -447,7 +447,7 @@ OpenFile(LPCSTR lpFileName, default: Sharing = FILE_SHARE_READ | FILE_SHARE_WRITE; } - return (HFILE) CreateFileA (lpFileName, + return (HFILE)(ULONG_PTR) CreateFileA (lpFileName, GENERIC_READ | GENERIC_WRITE, Sharing, NULL, @@ -476,7 +476,7 @@ OpenFile(LPCSTR lpFileName, if (Len == 0 || Len > OFS_MAXPATHNAME) { lpReOpenBuff->nErrCode = (WORD)GetLastError(); - return (HFILE)INVALID_HANDLE_VALUE; + return HFILE_ERROR; } if (uStyle & OF_DELETE) @@ -507,7 +507,7 @@ OpenFile(LPCSTR lpFileName, NULL, NULL)) { - return (HFILE)INVALID_HANDLE_VALUE; + return HFILE_ERROR; } // FILE_SHARE_READ @@ -534,7 +534,7 @@ OpenFile(LPCSTR lpFileName, if (!NT_SUCCESS(errCode)) { BaseSetLastNTError (errCode); - return (HFILE)INVALID_HANDLE_VALUE; + return HFILE_ERROR; } if (uStyle & OF_EXIST) @@ -543,7 +543,7 @@ OpenFile(LPCSTR lpFileName, return (HFILE)1; } - return (HFILE)FileHandle; + return (HFILE)(ULONG_PTR)FileHandle; } /* diff --git a/dll/win32/kernel32/client/file/lfile.c b/dll/win32/kernel32/client/file/lfile.c index 5f907f070f..6f40555678 100644 --- a/dll/win32/kernel32/client/file/lfile.c +++ b/dll/win32/kernel32/client/file/lfile.c @@ -44,7 +44,7 @@ _hwrite(HFILE hFile, LPCSTR lpBuffer, long lBytes) if (lBytes == 0) { - if (!SetEndOfFile((HANDLE) hFile)) + if (!SetEndOfFile((HANDLE)(ULONG_PTR) hFile)) { return HFILE_ERROR; } @@ -98,7 +98,7 @@ _lopen(LPCSTR lpPathName, int iReadWrite) default: dwSharing = FILE_SHARE_READ | FILE_SHARE_WRITE; break; } - return (HFILE) CreateFileA(lpPathName, + return (HFILE)(ULONG_PTR) CreateFileA(lpPathName, dwAccess, dwSharing, NULL, diff --git a/dll/win32/kernel32/client/thread.c b/dll/win32/kernel32/client/thread.c index a7963e272f..8fc5a7ad61 100644 --- a/dll/win32/kernel32/client/thread.c +++ b/dll/win32/kernel32/client/thread.c @@ -176,6 +176,7 @@ CreateRemoteThread(IN HANDLE hProcess, ACTIVATION_CONTEXT_BASIC_INFORMATION ActCtxInfo; ULONG_PTR Cookie; ULONG ReturnLength; + SIZE_T ReturnSize; DPRINT("CreateRemoteThread: hProcess: %p dwStackSize: %lu lpStartAddress" ": %p lpParameter: %p, dwCreationFlags: %lx\n", hProcess, dwStackSize, lpStartAddress, lpParameter, dwCreationFlags); @@ -267,7 +268,7 @@ CreateRemoteThread(IN HANDLE hProcess, ActivationContextBasicInformation, &ActCtxInfo, sizeof(ActCtxInfo), - &ReturnLength); + &ReturnSize); if (!NT_SUCCESS(Status)) { /* Fail */ diff --git a/dll/win32/lsasrv/authpackage.c b/dll/win32/lsasrv/authpackage.c index 22e668c600..7405e0904e 100644 --- a/dll/win32/lsasrv/authpackage.c +++ b/dll/win32/lsasrv/authpackage.c @@ -386,7 +386,7 @@ LsapAllocateClientBuffer(IN PLSA_CLIENT_REQUEST ClientRequest, OUT PVOID *ClientBaseAddress) { PLSAP_LOGON_CONTEXT LogonContext; - ULONG Length; + SIZE_T Length; *ClientBaseAddress = NULL; @@ -409,7 +409,7 @@ LsapFreeClientBuffer(IN PLSA_CLIENT_REQUEST ClientRequest, IN PVOID ClientBaseAddress) { PLSAP_LOGON_CONTEXT LogonContext; - ULONG Length; + SIZE_T Length; if (ClientBaseAddress == NULL) return STATUS_SUCCESS; diff --git a/dll/win32/lsasrv/session.c b/dll/win32/lsasrv/session.c index a290e3428f..2cc37bdc51 100644 --- a/dll/win32/lsasrv/session.c +++ b/dll/win32/lsasrv/session.c @@ -258,7 +258,8 @@ LsapEnumLogonSessions(IN OUT PLSA_API_MSG RequestMsg) PLIST_ENTRY SessionEntry; PLSAP_LOGON_SESSION CurrentSession; PLUID SessionList; - ULONG i, Length, MemSize; + ULONG i, Length; + SIZE_T MemSize; PVOID ClientBaseAddress = NULL; NTSTATUS Status; @@ -353,7 +354,8 @@ LsapGetLogonSessionData(IN OUT PLSA_API_MSG RequestMsg) PLSAP_LOGON_SESSION Session; PSECURITY_LOGON_SESSION_DATA LocalSessionData; PVOID ClientBaseAddress = NULL; - ULONG TotalLength, MemSize, SidLength = 0; + ULONG TotalLength, SidLength = 0; + SIZE_T MemSize; PUCHAR Ptr; NTSTATUS Status; diff --git a/dll/win32/msafd/misc/dllmain.c b/dll/win32/msafd/misc/dllmain.c index f6e04ae5fc..5ec1bc151a 100644 --- a/dll/win32/msafd/misc/dllmain.c +++ b/dll/win32/msafd/misc/dllmain.c @@ -75,17 +75,17 @@ WSPSocket(int AddressFamily, if (lpProtocolInfo && lpProtocolInfo->dwServiceFlags3 != 0 && lpProtocolInfo->dwServiceFlags4 != 0) { /* Duplpicating socket from different process */ - if ((HANDLE)lpProtocolInfo->dwServiceFlags3 == INVALID_HANDLE_VALUE) + if (UlongToPtr(lpProtocolInfo->dwServiceFlags3) == INVALID_HANDLE_VALUE) { Status = WSAEINVAL; goto error; } - if ((HANDLE)lpProtocolInfo->dwServiceFlags4 == INVALID_HANDLE_VALUE) + if (UlongToPtr(lpProtocolInfo->dwServiceFlags4) == INVALID_HANDLE_VALUE) { Status = WSAEINVAL; goto error; } - SharedData = MapViewOfFile((HANDLE)lpProtocolInfo->dwServiceFlags3, + SharedData = MapViewOfFile(UlongToPtr(lpProtocolInfo->dwServiceFlags3), FILE_MAP_ALL_ACCESS, 0, 0, @@ -183,8 +183,8 @@ WSPSocket(int AddressFamily, if (SharedData) { Socket->SharedData = SharedData; - Socket->SharedDataHandle = (HANDLE)lpProtocolInfo->dwServiceFlags3; - Sock = (HANDLE)lpProtocolInfo->dwServiceFlags4; + Socket->SharedDataHandle = UlongToHandle(lpProtocolInfo->dwServiceFlags3); + Sock = UlongToHandle(lpProtocolInfo->dwServiceFlags4); Socket->Handle = (SOCKET)lpProtocolInfo->dwServiceFlags4; } else @@ -422,7 +422,7 @@ error: if( SharedData ) { UnmapViewOfFile(SharedData); - NtClose((HANDLE)lpProtocolInfo->dwServiceFlags3); + NtClose(UlongToHandle(lpProtocolInfo->dwServiceFlags3)); } else { @@ -523,8 +523,8 @@ WSPDuplicateSocket( lpProtocolInfo->iAddressFamily = Socket->SharedData->AddressFamily; lpProtocolInfo->iProtocol = Socket->SharedData->Protocol; lpProtocolInfo->iSocketType = Socket->SharedData->SocketType; - lpProtocolInfo->dwServiceFlags3 = (DWORD)hDuplicatedSharedData; - lpProtocolInfo->dwServiceFlags4 = (DWORD)hDuplicatedHandle; + lpProtocolInfo->dwServiceFlags3 = HandleToUlong(hDuplicatedSharedData); + lpProtocolInfo->dwServiceFlags4 = HandleToUlong(hDuplicatedHandle); if( lpErrno ) *lpErrno = NO_ERROR; @@ -903,7 +903,7 @@ WSPBind(SOCKET Handle, /* Set up Address in TDI Format */ BindData->Address.TAAddressCount = 1; - BindData->Address.Address[0].AddressLength = SocketAddressLength - sizeof(SocketAddress->sa_family); + BindData->Address.Address[0].AddressLength = (USHORT)(SocketAddressLength - sizeof(SocketAddress->sa_family)); BindData->Address.Address[0].AddressType = SocketAddress->sa_family; RtlCopyMemory (BindData->Address.Address[0].Address, SocketAddress->sa_data, @@ -1427,14 +1427,16 @@ GetCurrentTimeInSeconds(VOID) return (DWORD)((Time.ll - u1970.ll) / 10000000ULL); } +_Must_inspect_result_ SOCKET WSPAPI -WSPAccept(SOCKET Handle, - struct sockaddr *SocketAddress, - int *SocketAddressLength, - LPCONDITIONPROC lpfnCondition, - DWORD dwCallbackData, - LPINT lpErrno) +WSPAccept( + _In_ SOCKET Handle, + _Out_writes_bytes_to_opt_(*addrlen, *addrlen) struct sockaddr FAR *SocketAddress, + _Inout_opt_ LPINT SocketAddressLength, + _In_opt_ LPCONDITIONPROC lpfnCondition, + _In_opt_ DWORD_PTR dwCallbackData, + _Out_ LPINT lpErrno) { IO_STATUS_BLOCK IOSB; PAFD_RECEIVED_ACCEPT_DATA ListenReceiveData; @@ -2885,14 +2887,15 @@ SendToHelper: * RETURNS: * Status of operation */ -INT +_Must_inspect_result_ +int WSPAPI -WSPStartup(IN WORD wVersionRequested, - OUT LPWSPDATA lpWSPData, - IN LPWSAPROTOCOL_INFOW lpProtocolInfo, - IN WSPUPCALLTABLE UpcallTable, - OUT LPWSPPROC_TABLE lpProcTable) - +WSPStartup( + _In_ WORD wVersionRequested, + _In_ LPWSPDATA lpWSPData, + _In_ LPWSAPROTOCOL_INFOW lpProtocolInfo, + _In_ WSPUPCALLTABLE UpcallTable, + _Out_ LPWSPPROC_TABLE lpProcTable) { NTSTATUS Status; @@ -2959,7 +2962,7 @@ WSPAddressToString(IN LPSOCKADDR lpsaAddress, IN OUT LPDWORD lpdwAddressStringLength, OUT LPINT lpErrno) { - DWORD size; + SIZE_T size; WCHAR buffer[54]; /* 32 digits + 7':' + '[' + '%" + 5 digits + ']:' + 5 digits + '\0' */ WCHAR *p; diff --git a/dll/win32/msafd/msafd.h b/dll/win32/msafd/msafd.h index 3765c2fca7..07ed1657fc 100644 --- a/dll/win32/msafd/msafd.h +++ b/dll/win32/msafd/msafd.h @@ -140,15 +140,16 @@ typedef struct _AFDAPCCONTEXT PSOCKET_INFORMATION lpSocket; } AFDAPCCONTEXT, *PAFDAPCCONTEXT; +_Must_inspect_result_ SOCKET WSPAPI WSPAccept( - IN SOCKET s, - OUT LPSOCKADDR addr, - IN OUT LPINT addrlen, - IN LPCONDITIONPROC lpfnCondition, - IN DWORD dwCallbackData, - OUT LPINT lpErrno); + _In_ SOCKET s, + _Out_writes_bytes_to_opt_(*addrlen, *addrlen) struct sockaddr FAR * addr, + _Inout_opt_ LPINT addrlen, + _In_opt_ LPCONDITIONPROC lpfnCondition, + _In_opt_ DWORD_PTR dwCallbackData, + _Out_ LPINT lpErrno); INT WSPAPI diff --git a/dll/win32/msgina/shutdown.c b/dll/win32/msgina/shutdown.c index 01e397cbce..658e21c7f5 100644 --- a/dll/win32/msgina/shutdown.c +++ b/dll/win32/msgina/shutdown.c @@ -398,7 +398,7 @@ ShutdownOnOk( } } -static BOOL +static INT_PTR CALLBACK ShutdownDialogProc( HWND hDlg, diff --git a/dll/win32/mswsock/mswhelper.c b/dll/win32/mswsock/mswhelper.c index 1a08ccd22b..52265324d3 100644 --- a/dll/win32/mswsock/mswhelper.c +++ b/dll/win32/mswsock/mswhelper.c @@ -108,7 +108,7 @@ mswBufferAppendLst(_Inout_ PMSW_BUFFER mswBuf, { DWORD lstItemCount; DWORD lstByteSize; - DWORD lstDataPos; + DWORD_PTR lstDataPos; DWORD i1; UINT_PTR *ptrSrcLstPos; @@ -129,7 +129,7 @@ mswBufferAppendLst(_Inout_ PMSW_BUFFER mswBuf, /* calculate position for the data of the first item */ lstDataPos = ((lstItemCount + 1) * sizeof(UINT_PTR)) + - (DWORD)mswBufferEndPtr(mswBuf); + (DWORD_PTR)mswBufferEndPtr(mswBuf); /* add ptrofs */ lstDataPos += ptrofs; @@ -164,7 +164,7 @@ mswBufferAppendStrLstA(_Inout_ PMSW_BUFFER mswBuf, DWORD lstItemLen[MAX_ARRAY_SIZE]; DWORD lstItemCount; DWORD lstByteSize; - DWORD lstDataPos; + DWORD_PTR lstDataPos; DWORD lstDataSize; DWORD i1; UINT_PTR *ptrSrcLstPos; @@ -194,7 +194,7 @@ mswBufferAppendStrLstA(_Inout_ PMSW_BUFFER mswBuf, /* calculate position for the data of the first item */ lstDataPos = ((lstItemCount + 1) * sizeof(UINT_PTR)) + - (DWORD)mswBufferEndPtr(mswBuf); + (DWORD_PTR)mswBufferEndPtr(mswBuf); /* add ptrofs */ lstDataPos += ptrofs; @@ -261,7 +261,7 @@ mswBufferAppendBlob_Hostent(_Inout_ PMSW_BUFFER mswBuf, { if (!mswBufferAppendStrLstA(mswBuf, (void**)hostAliasesA, - -(DWORD)bytesOfs)) + -(LONG_PTR)bytesOfs)) return FALSE; } else @@ -277,7 +277,7 @@ mswBufferAppendBlob_Hostent(_Inout_ PMSW_BUFFER mswBuf, phe->h_addr_list = (char**)(mswBufferEndPtr(mswBuf) - bytesOfs); - if (!mswBufferAppendLst(mswBuf, lst, 4, -(DWORD)bytesOfs)) + if (!mswBufferAppendLst(mswBuf, lst, 4, -(LONG_PTR)bytesOfs)) return FALSE; /* name */ @@ -323,7 +323,7 @@ mswBufferAppendBlob_Servent(_Inout_ PMSW_BUFFER mswBuf, { if (!mswBufferAppendStrLstA(mswBuf, (void**)serviceAliasesA, - -(DWORD)bytesOfs)) + -(LONG_PTR)bytesOfs)) return FALSE; } else @@ -484,8 +484,8 @@ WCHAR* StrCpyHeapAllocW(_In_opt_ HANDLE hHeap, _In_ WCHAR* wStr) { - int chLen; - int bLen; + size_t chLen; + size_t bLen; WCHAR* resW; if (wStr == NULL) @@ -507,8 +507,8 @@ char* StrCpyHeapAllocA(_In_opt_ HANDLE hHeap, _In_ char* aStr) { - int chLen; - int bLen; + size_t chLen; + size_t bLen; char* resA; if (aStr == NULL) @@ -534,8 +534,8 @@ StrAryCpyHeapAllocA(_In_opt_ HANDLE hHeap, char** aDstPtr; char* aDstNextStr; DWORD aStrByteLen[MAX_ARRAY_SIZE]; - int bLen; - int bItmLen; + size_t bLen; + size_t bItmLen; int aCount; int i1; char** resA; @@ -581,7 +581,7 @@ StrAryCpyHeapAllocA(_In_opt_ HANDLE hHeap, *aDstPtr = aDstNextStr; RtlCopyMemory(*aDstPtr, *aSrcPtr, bItmLen); - aDstNextStr = (char*)((DWORD)aDstNextStr + (DWORD)bItmLen); + aDstNextStr = (char*)((DWORD_PTR)aDstNextStr + (DWORD)bItmLen); aDstPtr++; aSrcPtr++; } @@ -671,7 +671,7 @@ StrAryCpyHeapAllocWToA(_In_opt_ HANDLE hHeap, RtlCopyMemory(*aDstPtr, aStr, bItmLen); HeapFree(hHeap, 0, aStr); - aDstNextStr = (char*)((DWORD)aDstNextStr + (DWORD)bItmLen); + aDstNextStr = (char*)((DWORD_PTR)aDstNextStr + (DWORD)bItmLen); aDstPtr++; wSrcPtr++; } diff --git a/dll/win32/psapi/psapi.c b/dll/win32/psapi/psapi.c index 1c82f505ed..6eae8375f7 100644 --- a/dll/win32/psapi/psapi.c +++ b/dll/win32/psapi/psapi.c @@ -506,7 +506,7 @@ EnumProcesses(DWORD *lpidProcess, */ if (Count < cb / sizeof(DWORD)) { - lpidProcess[Count] = (DWORD)ProcInfo->UniqueProcessId; + lpidProcess[Count] = HandleToUlong(ProcInfo->UniqueProcessId); Count++; } @@ -840,7 +840,7 @@ GetMappedFileNameW(HANDLE hProcess, DWORD nSize) { DWORD Len; - DWORD OutSize; + SIZE_T OutSize; NTSTATUS Status; struct { diff --git a/dll/win32/shimgvw/shimgvw.c b/dll/win32/shimgvw/shimgvw.c index 4177ac2d68..8339b66b16 100644 --- a/dll/win32/shimgvw/shimgvw.c +++ b/dll/win32/shimgvw/shimgvw.c @@ -188,7 +188,7 @@ static void pSaveImageAs(HWND hwnd) GUID rawFormat; UINT num; UINT size; - UINT sizeRemain; + size_t sizeRemain; UINT j; WCHAR *c; diff --git a/dll/win32/uxtheme/nonclient.c b/dll/win32/uxtheme/nonclient.c index b777d02e41..4171e09264 100644 --- a/dll/win32/uxtheme/nonclient.c +++ b/dll/win32/uxtheme/nonclient.c @@ -68,10 +68,10 @@ UserGetWindowIcon(PDRAW_CONTEXT pcontext) SendMessageTimeout(pcontext->hWnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon); if (!hIcon) - hIcon = (HICON)GetClassLong(pcontext->hWnd, GCL_HICONSM); + hIcon = (HICON)GetClassLongPtr(pcontext->hWnd, GCLP_HICONSM); if (!hIcon) - hIcon = (HICON)GetClassLong(pcontext->hWnd, GCL_HICON); + hIcon = (HICON)GetClassLongPtr(pcontext->hWnd, GCLP_HICON); // See also win32ss/user/ntuser/nonclient.c!NC_IconForWindow if (!hIcon && !(pcontext->wi.dwExStyle & WS_EX_DLGMODALFRAME)) diff --git a/dll/win32/wshtcpip/iflist.c b/dll/win32/wshtcpip/iflist.c index a3fe651f2c..d6d68ced2b 100644 --- a/dll/win32/wshtcpip/iflist.c +++ b/dll/win32/wshtcpip/iflist.c @@ -95,7 +95,7 @@ BOOL AllocAndGetEntityArray( *idCount = (outBufLenNeeded / sizeof(TDIEntityID)); *ppEntities = (TDIEntityID*)outBuf; - DPRINT("TcpFile %lx\n", (DWORD)TcpFile); + DPRINT("TcpFile %p\n", TcpFile); DPRINT("idCount %lx\n", *idCount);// 0x24; @@ -247,7 +247,7 @@ WSHIoctl_GetInterfaceList( goto cleanup; } - DPRINT("TcpFile %lx\n",(DWORD)TcpFile); + DPRINT("TcpFile %p\n", TcpFile); if (!AllocAndGetEntityArray(TcpFile,hHeap,&outEntityID,&outIDCount)) { diff --git a/win32ss/gdi/gdi32/include/gdi32p.h b/win32ss/gdi/gdi32/include/gdi32p.h index ace5d574a2..c78f993d22 100644 --- a/win32ss/gdi/gdi32/include/gdi32p.h +++ b/win32ss/gdi/gdi32/include/gdi32p.h @@ -136,7 +136,7 @@ typedef struct tagENHMETAFILE #define UMPDEV_SUPPORT_ESCAPE 0x0004 typedef struct _UMPDEV { - DWORD_PTR Sig; // Init with PDEV_UMPD_ID + DWORD_PTR Sig; // Init with PDEV_UMPD_ID struct _UMPDEV *pumpdNext; PDRIVER_INFO_5W pdi5Info; HMODULE hModule;
6 years, 4 months
1
0
0
0
14/16: [APPLICATIONS] Fix 64 bit issues
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6f1306664735830e08bf0…
commit 6f1306664735830e08bf074f07b82a57107f2912 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Mar 4 16:12:18 2018 +0100 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Aug 4 19:19:34 2018 +0200 [APPLICATIONS] Fix 64 bit issues --- base/applications/cmdutils/dbgprint/dbgprint.c | 6 +++--- base/applications/drwtsn32/main.cpp | 2 +- base/applications/mmc/console.c | 2 +- base/applications/mplay32/mplay32.c | 4 ++-- base/applications/msconfig_new/utils.c | 10 ++++++---- base/applications/network/net/cmdUser.c | 2 +- base/applications/rapps/gui.cpp | 2 +- base/applications/rapps/include/crichedit.h | 6 +++--- base/applications/rapps/include/rosui.h | 2 +- base/applications/rapps/loaddlg.cpp | 9 +++++---- base/applications/sc/config.c | 2 +- base/applications/sc/misc.c | 2 +- base/applications/shutdown/gui.c | 2 +- base/applications/sndrec32/sndrec32.cpp | 2 +- base/applications/sndvol32/dialog.c | 2 +- sdk/include/reactos/rosctrls.h | 4 ++-- 16 files changed, 31 insertions(+), 28 deletions(-) diff --git a/base/applications/cmdutils/dbgprint/dbgprint.c b/base/applications/cmdutils/dbgprint/dbgprint.c index 6fd17317f9..1ea7f56766 100644 --- a/base/applications/cmdutils/dbgprint/dbgprint.c +++ b/base/applications/cmdutils/dbgprint/dbgprint.c @@ -17,9 +17,9 @@ int _tmain(int argc, TCHAR ** argv) { TCHAR * buf; - int bufsize; + size_t bufsize; int i; - int offset; + size_t offset; bufsize = 0; for(i = 1; i < argc; i++) @@ -106,7 +106,7 @@ int _tmain(int argc, TCHAR ** argv) offset = 0; for(i = 1; i < argc; i++) { - int length = _tcslen(argv[i]); + size_t length = _tcslen(argv[i]); _tcsncpy(&buf[offset], argv[i], length); offset += length; if (i + 1 < argc) diff --git a/base/applications/drwtsn32/main.cpp b/base/applications/drwtsn32/main.cpp index e67c735006..0c9d5664ce 100644 --- a/base/applications/drwtsn32/main.cpp +++ b/base/applications/drwtsn32/main.cpp @@ -285,7 +285,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR cmdLine, INT) { if (n + 1 < argc) { - data.Event = (HANDLE)wcstoul(argv[n+1], NULL, 10); + data.Event = (HANDLE)(ULONG_PTR)_wcstoui64(argv[n+1], NULL, 10); n++; } } diff --git a/base/applications/mmc/console.c b/base/applications/mmc/console.c index ce34c56efc..58d98ad511 100644 --- a/base/applications/mmc/console.c +++ b/base/applications/mmc/console.c @@ -97,7 +97,7 @@ CreateNewMDIChild(PCONSOLE_MAINFRAME_WND Info, mcs.y = mcs.cy = CW_USEDEFAULT; mcs.style = MDIS_ALLCHILDSTYLES; - hChild = (HWND)SendMessage(hwndMDIClient, WM_MDICREATE, 0, (LONG)&mcs); + hChild = (HWND)SendMessage(hwndMDIClient, WM_MDICREATE, 0, (LPARAM)&mcs); if (hChild) { Info->nConsoleCount++; diff --git a/base/applications/mplay32/mplay32.c b/base/applications/mplay32/mplay32.c index bf2a12da88..e5299cb539 100644 --- a/base/applications/mplay32/mplay32.c +++ b/base/applications/mplay32/mplay32.c @@ -963,8 +963,8 @@ BuildFileFilterAndDeviceMenu(VOID) DWORD dwPosition = 0; DWORD i; DWORD j; - UINT uSizeRemain; - UINT uMaskRemain; + size_t uSizeRemain; + size_t uMaskRemain; HKEY hKey = NULL; /* Always load the default (all files) filter */ diff --git a/base/applications/msconfig_new/utils.c b/base/applications/msconfig_new/utils.c index 52d5c2dd46..104081f78c 100644 --- a/base/applications/msconfig_new/utils.c +++ b/base/applications/msconfig_new/utils.c @@ -142,10 +142,12 @@ RunCommand(IN LPCWSTR lpszCommand, lpszExpandedCommand = (LPWSTR)MemAlloc(0, dwNumOfChars * sizeof(WCHAR)); ExpandEnvironmentStringsW(lpszCommand, lpszExpandedCommand, dwNumOfChars); - dwRes = (DWORD)ShellExecuteW(NULL, NULL /* and not L"open" !! */, - lpszExpandedCommand, - lpszParameters, - NULL, nShowCmd); + dwRes = (DWORD_PTR)ShellExecuteW(NULL, + NULL /* and not L"open" !! */, + lpszExpandedCommand, + lpszParameters, + NULL, + nShowCmd); MemFree(lpszExpandedCommand); return dwRes; diff --git a/base/applications/network/net/cmdUser.c b/base/applications/network/net/cmdUser.c index ec96c8163b..d093ffc9e0 100644 --- a/base/applications/network/net/cmdUser.c +++ b/base/applications/network/net/cmdUser.c @@ -29,7 +29,7 @@ EnumerateUsers(VOID) PSERVER_INFO_100 pServer = NULL; DWORD dwRead = 0, dwTotal = 0; DWORD i; - DWORD_PTR ResumeHandle = 0; + DWORD ResumeHandle = 0; NET_API_STATUS Status; Status = NetServerGetInfo(NULL, diff --git a/base/applications/rapps/gui.cpp b/base/applications/rapps/gui.cpp index dca702fc9f..b85e5fa92e 100644 --- a/base/applications/rapps/gui.cpp +++ b/base/applications/rapps/gui.cpp @@ -348,7 +348,7 @@ public: return FALSE; } - ImageList_Destroy((HIMAGELIST) SetImageList(hImageList)); + ImageList_Destroy(SetImageList(hImageList)); AddButtons(_countof(Buttons), Buttons); diff --git a/base/applications/rapps/include/crichedit.h b/base/applications/rapps/include/crichedit.h index 3b34fde3f4..e3cd93345d 100644 --- a/base/applications/rapps/include/crichedit.h +++ b/base/applications/rapps/include/crichedit.h @@ -6,10 +6,10 @@ class CRichEdit : { HMODULE m_LoadedLibrary; - VOID GenericInsertText(LPCWSTR lpszText, LONG InsertedTextLen, DWORD dwEffects) + VOID GenericInsertText(LPCWSTR lpszText, SIZE_T InsertedTextLen, DWORD dwEffects) { SETTEXTEX SetText; - LONG Len = GetTextLen(); + SIZE_T Len = GetTextLen(); if (InsertedTextLen) { @@ -34,7 +34,7 @@ class CRichEdit : public: CRichEdit() : CWindow(), m_LoadedLibrary(NULL) {} - VOID SetRangeFormatting(LONG Start, LONG End, DWORD dwEffects) + VOID SetRangeFormatting(SIZE_T Start, SIZE_T End, DWORD dwEffects) { CHARFORMAT2W CharFormat; diff --git a/base/applications/rapps/include/rosui.h b/base/applications/rapps/include/rosui.h index e51a1c4c96..0d7cd296b3 100644 --- a/base/applications/rapps/include/rosui.h +++ b/base/applications/rapps/include/rosui.h @@ -47,7 +47,7 @@ public: virtual INT OnCompareItems(T * p1, T * p2) { - INT t = (reinterpret_cast<INT>(p2) - reinterpret_cast<INT>(p1)); + INT_PTR t = (reinterpret_cast<INT_PTR>(p2) - reinterpret_cast<INT_PTR>(p1)); if (t > 0) return 1; if (t < 0) diff --git a/base/applications/rapps/loaddlg.cpp b/base/applications/rapps/loaddlg.cpp index fe9ec04dec..4016aa550c 100644 --- a/base/applications/rapps/loaddlg.cpp +++ b/base/applications/rapps/loaddlg.cpp @@ -190,11 +190,12 @@ public: Item = GetDlgItem(m_hDialog, IDC_DOWNLOAD_STATUS); if (Item && szStatusText && wcslen(szStatusText) > 0 && m_UrlHasBeenCopied == FALSE) { - DWORD len = wcslen(szStatusText) + 1; + SIZE_T len = wcslen(szStatusText) + 1; ATL::CStringW buf; + DWORD dummyLen; /* beautify our url for display purposes */ - if (!InternetCanonicalizeUrlW(szStatusText, buf.GetBuffer(len), &len, ICU_DECODE | ICU_NO_ENCODE)) + if (!InternetCanonicalizeUrlW(szStatusText, buf.GetBuffer(len), &dummyLen, ICU_DECODE | ICU_NO_ENCODE)) { /* just use the original */ buf.ReleaseBuffer(); @@ -405,8 +406,8 @@ INT_PTR CALLBACK CDownloadManager::DownloadDlgProc(HWND Dlg, UINT uMsg, WPARAM w HICON hIconSm, hIconBg; ATL::CStringW szTempCaption; - hIconBg = (HICON) GetClassLongW(hMainWnd, GCLP_HICON); - hIconSm = (HICON) GetClassLongW(hMainWnd, GCLP_HICONSM); + hIconBg = (HICON) GetClassLongPtrW(hMainWnd, GCLP_HICON); + hIconSm = (HICON) GetClassLongPtrW(hMainWnd, GCLP_HICONSM); if (hIconBg && hIconSm) { diff --git a/base/applications/sc/config.c b/base/applications/sc/config.c index 3e8ac43f51..25794f76f4 100644 --- a/base/applications/sc/config.c +++ b/base/applications/sc/config.c @@ -17,7 +17,7 @@ BOOL QueryConfig(LPCTSTR ServiceName) DWORD cbBytesNeeded = 0; LPQUERY_SERVICE_CONFIG pServiceConfig = NULL; LPWSTR lpPtr; - INT nLen, i; + SSIZE_T nLen, i; #ifdef SCDBG _tprintf(_T("service to show configuration - %s\n\n"), ServiceName); diff --git a/base/applications/sc/misc.c b/base/applications/sc/misc.c index e03aea4967..44d371c684 100644 --- a/base/applications/sc/misc.c +++ b/base/applications/sc/misc.c @@ -169,7 +169,7 @@ ParseFailureActions( SC_ACTION *pActions = NULL; LPTSTR pStringBuffer = NULL; LPTSTR p; - INT nLength; + INT_PTR nLength; INT nCount = 0; *pcActions = 0; diff --git a/base/applications/shutdown/gui.c b/base/applications/shutdown/gui.c index c3fb5a4b56..0c1a0e9c25 100644 --- a/base/applications/shutdown/gui.c +++ b/base/applications/shutdown/gui.c @@ -8,7 +8,7 @@ #include "precomp.h" -BOOL CALLBACK ShutdownGuiProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +INT_PTR CALLBACK ShutdownGuiProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { switch(msg) { diff --git a/base/applications/sndrec32/sndrec32.cpp b/base/applications/sndrec32/sndrec32.cpp index 7eabc446fa..18bf8f37d1 100644 --- a/base/applications/sndrec32/sndrec32.cpp +++ b/base/applications/sndrec32/sndrec32.cpp @@ -484,7 +484,7 @@ WndProc(HWND hWnd, BUTTONS_W, BUTTONS_H, hWnd, - (HMENU)i, + (HMENU)UlongToPtr(i), hInst, 0); if (!buttons[i]) diff --git a/base/applications/sndvol32/dialog.c b/base/applications/sndvol32/dialog.c index 7e15e36695..ccaaf318f1 100644 --- a/base/applications/sndvol32/dialog.c +++ b/base/applications/sndvol32/dialog.c @@ -157,7 +157,7 @@ AddDialogControl( rect.right - rect.left, rect.bottom - rect.top, hwndDialog, - (HMENU)(wID), + UlongToPtr(wID), hAppInstance, NULL); diff --git a/sdk/include/reactos/rosctrls.h b/sdk/include/reactos/rosctrls.h index f332aca915..eb5cebc026 100644 --- a/sdk/include/reactos/rosctrls.h +++ b/sdk/include/reactos/rosctrls.h @@ -395,9 +395,9 @@ public: // Layout management methods } public: // Image list management methods - DWORD SetImageList(HIMAGELIST himl) + HIMAGELIST SetImageList(HIMAGELIST himl) { - return SendMessageW(TB_SETIMAGELIST, 0, reinterpret_cast<LPARAM>(himl)); + return (HIMAGELIST)SendMessageW(TB_SETIMAGELIST, 0, reinterpret_cast<LPARAM>(himl)); } public: // Other methods
6 years, 4 months
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Results per page:
10
25
50
100
200