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
July 2021
----- 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
18 participants
142 discussions
Start a n
N
ew thread
[reactos] 01/01: [IMM32] Imm(Lock|Unlock)ImeDpi and ImmSetOpenStatus (#3830)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ecb0c0963d19ecb3cc465…
commit ecb0c0963d19ecb3cc46582500dddbbb452ce36b Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun Jul 25 11:57:57 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sun Jul 25 11:57:57 2021 +0900 [IMM32] Imm(Lock|Unlock)ImeDpi and ImmSetOpenStatus (#3830) - Add IMEDPI structure to ntuser.h. - Implement ImmLockImeDpi/ImmUnlockImeDpi functions. - Rewrite ImmSetOpenStatus function. - Modify some NTUSER function prototypes. - Modify imm32.spec. CORE-11700 --- dll/win32/imm32/imm.c | 172 +++++++++++++++++++++++++++++++++----- dll/win32/imm32/imm32.spec | 4 +- sdk/include/reactos/imm32_undoc.h | 2 + win32ss/include/ntuser.h | 42 +++++++++- win32ss/user/ntuser/ime.c | 11 ++- win32ss/user/ntuser/ntstubs.c | 4 +- 6 files changed, 202 insertions(+), 33 deletions(-) diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c index 53c13d27d9f..66c740a925f 100644 --- a/dll/win32/imm32/imm.c +++ b/dll/win32/imm32/imm.c @@ -48,8 +48,63 @@ WINE_DEFAULT_DEBUG_CHANNEL(imm); #define IMM_INIT_MAGIC 0x19650412 #define IMM_INVALID_CANDFORM ULONG_MAX +RTL_CRITICAL_SECTION g_csImeDpi; +PIMEDPI g_pImeDpiList = NULL; + BOOL WINAPI User32InitializeImmEntryTable(DWORD); +static DWORD APIENTRY Imm32QueryInputContext(HIMC hIMC, DWORD dwUnknown2) +{ + return NtUserQueryInputContext(hIMC, dwUnknown2); +} + +static DWORD APIENTRY Imm32NotifyIMEStatus(HWND hwnd, HIMC hIMC, DWORD dwConversion) +{ + return NtUserNotifyIMEStatus(hwnd, hIMC, dwConversion); +} + +static VOID APIENTRY Imm32FreeImeDpi(PIMEDPI pImeDpi, BOOL bDestroy) +{ + if (pImeDpi->hInst == NULL) + return; + if (bDestroy) + pImeDpi->ImeDestroy(0); + FreeLibrary(pImeDpi->hInst); + pImeDpi->hInst = NULL; +} + +static BOOL APIENTRY +Imm32NotifyAction(HIMC hIMC, HWND hwnd, DWORD dwAction, DWORD_PTR dwIndex, DWORD_PTR dwValue, + DWORD_PTR dwCommand, DWORD_PTR dwData) +{ + DWORD dwLayout; + HKL hKL; + PIMEDPI pImeDpi; + + if (dwAction) + { + dwLayout = Imm32QueryInputContext(hIMC, 1); + if (dwLayout) + { + /* find keyboard layout and lock it */ + hKL = GetKeyboardLayout(dwLayout); + pImeDpi = ImmLockImeDpi(hKL); + if (pImeDpi) + { + /* do notify */ + pImeDpi->NotifyIME(hIMC, dwAction, dwIndex, dwValue); + + ImmUnlockImeDpi(pImeDpi); /* unlock */ + } + } + } + + if (hwnd && dwCommand) + SendMessageW(hwnd, WM_IME_NOTIFY, dwCommand, dwData); + + return TRUE; +} + typedef struct _tagImmHkl{ struct list entry; HKL hkl; @@ -2951,40 +3006,119 @@ BOOL WINAPI ImmSetConversionStatus( return TRUE; } +/*********************************************************************** + * ImmLockImeDpi (IMM32.@) + */ +PIMEDPI WINAPI ImmLockImeDpi(HKL hKL) +{ + PIMEDPI pImeDpi = NULL; + + TRACE("ImmLockImeDpi(%p)\n", hKL); + + RtlEnterCriticalSection(&g_csImeDpi); + + /* Find by hKL */ + for (pImeDpi = g_pImeDpiList; pImeDpi; pImeDpi = pImeDpi->pNext) + { + if (pImeDpi->hKL == hKL) /* found */ + { + /* lock if possible */ + if (pImeDpi->dwFlags & IMEDPI_FLAG_UNKNOWN) + pImeDpi = NULL; + else + ++(pImeDpi->cLockObj); + break; + } + } + + RtlLeaveCriticalSection(&g_csImeDpi); + return pImeDpi; +} + +/*********************************************************************** + * ImmUnlockImeDpi (IMM32.@) + */ +VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi) +{ + PIMEDPI *ppEntry; + + TRACE("ImmUnlockImeDpi(%p)\n", pImeDpi); + + if (pImeDpi == NULL) + return; + + RtlEnterCriticalSection(&g_csImeDpi); + + /* unlock */ + --(pImeDpi->cLockObj); + if (pImeDpi->cLockObj != 0) + { + RtlLeaveCriticalSection(&g_csImeDpi); + return; + } + + if ((pImeDpi->dwFlags & IMEDPI_FLAG_UNKNOWN) == 0) + { + if ((pImeDpi->dwFlags & IMEDPI_FLAG_UNKNOWN2) == 0 || + (pImeDpi->dwUnknown1 & 1) == 0) + { + RtlLeaveCriticalSection(&g_csImeDpi); + return; + } + } + + /* Remove from list */ + for (ppEntry = &g_pImeDpiList; *ppEntry; ppEntry = &((*ppEntry)->pNext)) + { + if (*ppEntry == pImeDpi) /* found */ + { + *ppEntry = pImeDpi->pNext; + break; + } + } + + Imm32FreeImeDpi(pImeDpi, TRUE); + HeapFree(g_hImm32Heap, 0, pImeDpi); + + RtlLeaveCriticalSection(&g_csImeDpi); +} + /*********************************************************************** * ImmSetOpenStatus (IMM32.@) */ BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen) { - InputContextData *data = get_imc_data(hIMC); + DWORD idImeThread, idThread, dwConversion; + LPINPUTCONTEXT pIC; + HWND hWnd; + BOOL bHasChange = FALSE; - TRACE("%p %d\n", hIMC, fOpen); + TRACE("ImmSetOpenStatus(%p, %d)\n", hIMC, fOpen); - if (!data) - { - SetLastError(ERROR_INVALID_HANDLE); + idImeThread = Imm32QueryInputContext(hIMC, 1); + idThread = GetCurrentThreadId(); + if (idImeThread != idThread) return FALSE; - } - if (IMM_IsCrossThreadAccess(NULL, hIMC)) + pIC = ImmLockIMC(hIMC); + if (pIC == NULL) return FALSE; - if (data->immKbd->UIWnd == NULL) + if (pIC->fOpen != fOpen) { - /* create the ime window */ - data->immKbd->UIWnd = CreateWindowExW( WS_EX_TOOLWINDOW, - data->immKbd->imeClassName, NULL, WS_POPUP, 0, 0, 1, 1, 0, - 0, data->immKbd->hIME, 0); - SetWindowLongPtrW(data->immKbd->UIWnd, IMMGWL_IMC, (LONG_PTR)data); + pIC->fOpen = fOpen; + hWnd = pIC->hWnd; + dwConversion = pIC->fdwConversion; + bHasChange = TRUE; } - else if (fOpen) - SetWindowLongPtrW(data->immKbd->UIWnd, IMMGWL_IMC, (LONG_PTR)data); - if (!fOpen != !data->IMC.fOpen) + ImmUnlockIMC(hIMC); + + if (bHasChange) { - data->IMC.fOpen = fOpen; - ImmNotifyIME( hIMC, NI_CONTEXTUPDATED, 0, IMC_SETOPENSTATUS); - ImmInternalSendIMENotify(data, IMN_SETOPENSTATUS, 0); + Imm32NotifyAction(hIMC, hWnd, NI_CONTEXTUPDATED, 0, + IMC_SETOPENSTATUS, IMN_SETOPENSTATUS, 0); + Imm32NotifyIMEStatus(hWnd, hIMC, dwConversion); } return TRUE; diff --git a/dll/win32/imm32/imm32.spec b/dll/win32/imm32/imm32.spec index 3c950672c35..365d6726122 100644 --- a/dll/win32/imm32/imm32.spec +++ b/dll/win32/imm32/imm32.spec @@ -73,7 +73,7 @@ @ stdcall ImmLockClientImc(ptr) @ stdcall ImmLockIMC(ptr) @ stdcall ImmLockIMCC(ptr) -@ stdcall -stub ImmLockImeDpi(long) +@ stdcall ImmLockImeDpi(ptr) @ stdcall ImmNotifyIME(ptr long long long) @ stub ImmPenAuxInput @ stdcall ImmProcessKey(ptr long long long long) @@ -107,7 +107,7 @@ @ stdcall ImmUnlockClientImc(ptr) @ stdcall ImmUnlockIMC(ptr) @ stdcall ImmUnlockIMCC(ptr) -@ stdcall -stub ImmUnlockImeDpi(ptr) +@ stdcall ImmUnlockImeDpi(ptr) @ stdcall ImmUnregisterWordA(long str long str) @ stdcall ImmUnregisterWordW(long wstr long wstr) @ stdcall -stub ImmWINNLSEnableIME(ptr long) diff --git a/sdk/include/reactos/imm32_undoc.h b/sdk/include/reactos/imm32_undoc.h index a2b068fb058..a9a20c49b18 100644 --- a/sdk/include/reactos/imm32_undoc.h +++ b/sdk/include/reactos/imm32_undoc.h @@ -34,6 +34,8 @@ ImmGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearch PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc); VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc); +PIMEDPI WINAPI ImmLockImeDpi(HKL hKL); +VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi); #ifdef __cplusplus } // extern "C" diff --git a/win32ss/include/ntuser.h b/win32ss/include/ntuser.h index cc454ba1e2c..7c30a21d54d 100644 --- a/win32ss/include/ntuser.h +++ b/win32ss/include/ntuser.h @@ -1212,6 +1212,40 @@ typedef struct _IMEWND PIMEUI pimeui; } IMEWND, *PIMEWND; +typedef BOOL (WINAPI *FN_ImeDestroy)(UINT uReserved); +typedef BOOL (WINAPI *FN_NotifyIME)(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue); + +typedef struct IMEDPI /* unconfirmed */ +{ + struct IMEDPI *pNext; + HINSTANCE hInst; + HKL hKL; + DWORD dwUnknown0; + DWORD dwUnknown1; + DWORD dwUnknown2[14]; + DWORD cLockObj; + DWORD dwFlags; + DWORD dwUnknown3[7]; + FN_ImeDestroy ImeDestroy; + DWORD dwUnknown4[5]; + FN_NotifyIME NotifyIME; + /* ... */ +} IMEDPI, *PIMEDPI; + +#ifndef _WIN64 +C_ASSERT(offsetof(IMEDPI, pNext) == 0x0); +C_ASSERT(offsetof(IMEDPI, hInst) == 0x4); +C_ASSERT(offsetof(IMEDPI, hKL) == 0x8); +C_ASSERT(offsetof(IMEDPI, cLockObj) == 0x4c); +C_ASSERT(offsetof(IMEDPI, dwFlags) == 0x50); +C_ASSERT(offsetof(IMEDPI, ImeDestroy) == 0x70); +C_ASSERT(offsetof(IMEDPI, NotifyIME) == 0x88); +#endif + +/* flags for IMEDPI.dwFlags */ +#define IMEDPI_FLAG_UNKNOWN 1 +#define IMEDPI_FLAG_UNKNOWN2 2 + DWORD NTAPI NtUserAssociateInputContext( @@ -2676,9 +2710,9 @@ NtUserMoveWindow( DWORD NTAPI NtUserNotifyIMEStatus( - DWORD Unknown0, - DWORD Unknown1, - DWORD Unknown2); + HWND hwnd, + HIMC hIMC, + DWORD dwConversion); BOOL NTAPI @@ -2787,7 +2821,7 @@ NtUserQueryInformationThread( DWORD NTAPI NtUserQueryInputContext( - DWORD dwUnknown1, + HIMC hIMC, DWORD dwUnknown2); DWORD diff --git a/win32ss/user/ntuser/ime.c b/win32ss/user/ntuser/ime.c index 4b587667e4e..dd5ccbc874a 100644 --- a/win32ss/user/ntuser/ime.c +++ b/win32ss/user/ntuser/ime.c @@ -50,13 +50,12 @@ NtUserGetImeHotKey(IN DWORD dwHotKey, DWORD APIENTRY NtUserNotifyIMEStatus( - DWORD Unknown0, - DWORD Unknown1, - DWORD Unknown2) + HWND hwnd, + HIMC hIMC, + DWORD dwConversion) { - STUB - - return 0; + TRACE("NtUserNotifyIMEStatus(%p, %p, 0x%lX)\n", hwnd, hIMC, dwConversion); + return 0; } diff --git a/win32ss/user/ntuser/ntstubs.c b/win32ss/user/ntuser/ntstubs.c index 87d2c3ed11a..5ebde8bb41c 100644 --- a/win32ss/user/ntuser/ntstubs.c +++ b/win32ss/user/ntuser/ntstubs.c @@ -630,10 +630,10 @@ Quit: DWORD APIENTRY NtUserQueryInputContext( - DWORD dwUnknown1, + HIMC hIMC, DWORD dwUnknown2) { - STUB; + TRACE("NtUserQueryInputContext(%p, 0x%lX)\n", hIMC, dwUnknown2); return 0; }
3 years, 5 months
1
0
0
0
[reactos] 01/01: [IMM32] Improve ImmGetImeInfoEx (#3833)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=97847f20780a79e8148d5…
commit 97847f20780a79e8148d5d44641b97b634876e69 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun Jul 25 11:56:17 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sun Jul 25 11:56:17 2021 +0900 [IMM32] Improve ImmGetImeInfoEx (#3833) - Rewrite ImmGetImeInfoEx function. - Implement CtfImmIsTextFrameServiceDisabled function. - Modify imm32.spec. CORE-11700 --- dll/win32/imm32/imm.c | 57 ++++++++++++++++++++++++++++++++++++++-------- dll/win32/imm32/imm32.spec | 1 + win32ss/include/ntuser.h | 1 + 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c index 904e0d25725..53c13d27d9f 100644 --- a/dll/win32/imm32/imm.c +++ b/dll/win32/imm32/imm.c @@ -39,6 +39,7 @@ #include <ndk/pstypes.h> #include <ndk/rtlfuncs.h> #include "../../../win32ss/include/ntuser.h" +#include "../../../win32ss/include/ntwin32.h" #include <imm32_undoc.h> #include <strsafe.h> @@ -3608,29 +3609,67 @@ BOOL WINAPI ImmRegisterClient(PVOID ptr, /* FIXME: should point to SHAREDINFO st return TRUE; } +/*********************************************************************** + * CtfImmIsTextFrameServiceDisabled(IMM32.@) + */ +BOOL WINAPI CtfImmIsTextFrameServiceDisabled(VOID) +{ + PTEB pTeb = NtCurrentTeb(); + if (((PW32CLIENTINFO)pTeb->Win32ClientInfo)->CI_flags & CI_TFSDISABLED) + return TRUE; + return FALSE; +} + /*********************************************************************** * ImmGetImeInfoEx (IMM32.@) */ + +static BOOL APIENTRY Imm32GetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType) +{ + return NtUserGetImeInfoEx(pImeInfoEx, SearchType); +} + BOOL WINAPI ImmGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearchKey) { + BOOL bDisabled = FALSE; + HKL hKL; + PTEB pTeb; + switch (SearchType) { case ImeInfoExKeyboardLayout: - pImeInfoEx->hkl = *(LPHKL)pvSearchKey; - if (!IS_IME_HKL(pImeInfoEx->hkl)) - return FALSE; break; - case ImeInfoExImeFileName: - lstrcpynW(pImeInfoEx->wszImeFile, (LPWSTR)pvSearchKey, - ARRAY_SIZE(pImeInfoEx->wszImeFile)); + case ImeInfoExImeWindow: + bDisabled = CtfImmIsTextFrameServiceDisabled(); + SearchType = ImeInfoExKeyboardLayout; break; - default: - return FALSE; + case ImeInfoExImeFileName: + StringCchCopyW(pImeInfoEx->wszImeFile, _countof(pImeInfoEx->wszImeFile), + pvSearchKey); + goto Quit; } - return NtUserGetImeInfoEx(pImeInfoEx, SearchType); + + hKL = *(HKL*)pvSearchKey; + pImeInfoEx->hkl = hKL; + + if (!IS_IME_HKL(hKL)) + { + if (g_dwImm32Flags & IMM32_FLAG_CICERO_ENABLED) + { + pTeb = NtCurrentTeb(); + if (((PW32CLIENTINFO)pTeb->Win32ClientInfo)->W32ClientInfo[0] & 2) + return FALSE; + if (!bDisabled) + goto Quit; + } + return FALSE; + } + +Quit: + return Imm32GetImeInfoEx(pImeInfoEx, SearchType); } diff --git a/dll/win32/imm32/imm32.spec b/dll/win32/imm32/imm32.spec index 43107d4797a..3c950672c35 100644 --- a/dll/win32/imm32/imm32.spec +++ b/dll/win32/imm32/imm32.spec @@ -1,4 +1,5 @@ @ stdcall CtfImmIsCiceroEnabled() +@ stdcall CtfImmIsTextFrameServiceDisabled() @ stdcall -stub ImmActivateLayout(long) @ stdcall ImmAssociateContext(ptr ptr) @ stdcall ImmAssociateContextEx(ptr ptr long) diff --git a/win32ss/include/ntuser.h b/win32ss/include/ntuser.h index 54499388337..cc454ba1e2c 100644 --- a/win32ss/include/ntuser.h +++ b/win32ss/include/ntuser.h @@ -281,6 +281,7 @@ typedef struct _CALLBACKWND #define CI_CURTHPRHOOK 0x00000010 #define CI_CLASSESREGISTERED 0x00000020 #define CI_IMMACTIVATE 0x00000040 +#define CI_TFSDISABLED 0x00000400 typedef struct _CLIENTINFO {
3 years, 5 months
1
0
0
0
[reactos] 01/01: [IMM32] Improve ImmUnlockClientImc and Imm32HeapAlloc (#3834)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5afc3243599276d212e2a…
commit 5afc3243599276d212e2acc9fe28f0030eb36aa5 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun Jul 25 11:55:03 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sun Jul 25 11:55:03 2021 +0900 [IMM32] Improve ImmUnlockClientImc and Imm32HeapAlloc (#3834) - Fix Imm32HeapAlloc function. - Fix ImmUnlockClientImc function. CORE-11700 --- dll/win32/imm32/imm.c | 6 +++--- sdk/include/reactos/imm32_undoc.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c index dc62b77bfd2..904e0d25725 100644 --- a/dll/win32/imm32/imm.c +++ b/dll/win32/imm32/imm.c @@ -1017,7 +1017,7 @@ LPVOID APIENTRY Imm32HeapAlloc(DWORD dwFlags, DWORD dwBytes) { if (!g_hImm32Heap) { - g_hImm32Heap = GetProcessHeap(); // FIXME: Use TEB + g_hImm32Heap = RtlGetProcessHeap(); if (g_hImm32Heap == NULL) return NULL; } @@ -1076,7 +1076,7 @@ PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc) } else { - if (pClientImc->dwFlags & CLIENTIMC_DISABLED) + if (pClientImc->dwFlags & CLIENTIMC_UNKNOWN1) return NULL; } @@ -1092,7 +1092,7 @@ VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc) TRACE("ImmUnlockClientImc(%p)\n", pClientImc); cLocks = InterlockedDecrement(&pClientImc->cLockObj); - if (cLocks != 0 || (pClientImc->dwFlags & CLIENTIMC_DISABLED)) + if (cLocks != 0 || !(pClientImc->dwFlags & CLIENTIMC_UNKNOWN1)) return; hImc = pClientImc->hImc; diff --git a/sdk/include/reactos/imm32_undoc.h b/sdk/include/reactos/imm32_undoc.h index e207d52bc0e..a2b068fb058 100644 --- a/sdk/include/reactos/imm32_undoc.h +++ b/sdk/include/reactos/imm32_undoc.h @@ -21,9 +21,9 @@ typedef struct tagCLIENTIMC } CLIENTIMC, *PCLIENTIMC; /* flags for CLIENTIMC */ -#define CLIENTIMC_WIDE (1 << 0) -#define CLIENTIMC_DISABLED (1 << 6) -#define CLIENTIMC_UNKNOWN2 (1 << 8) +#define CLIENTIMC_WIDE 0x1 +#define CLIENTIMC_UNKNOWN1 0x40 +#define CLIENTIMC_UNKNOWN2 0x100 #ifdef __cplusplus extern "C" {
3 years, 5 months
1
0
0
0
[reactos] 01/01: __rt_div fixes for arm (#3843)
by Roman Masanin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f2bc1f0e11187e84230fb…
commit f2bc1f0e11187e84230fb3319f7b6a281b8d2ffa Author: Roman Masanin <52833910+theR4K(a)users.noreply.github.com> AuthorDate: Sat Jul 24 21:23:58 2021 +0300 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Jul 24 20:23:58 2021 +0200 __rt_div fixes for arm (#3843) [CRT/arm] Fix __rt_udiv and __rt_sdiv --- sdk/lib/crt/math/arm/__rt_div_worker.h | 27 +++++++++++++++++---------- sdk/lib/crt/math/arm/__rt_sdiv.c | 7 ++++--- sdk/lib/crt/math/arm/__rt_sdiv64.s | 15 +++++++-------- sdk/lib/crt/math/arm/__rt_udiv.c | 7 ++++--- sdk/lib/crt/math/arm/__rt_udiv64.s | 15 +++++++-------- 5 files changed, 39 insertions(+), 32 deletions(-) diff --git a/sdk/lib/crt/math/arm/__rt_div_worker.h b/sdk/lib/crt/math/arm/__rt_div_worker.h index 2aef926d0d9..035b3abd045 100644 --- a/sdk/lib/crt/math/arm/__rt_div_worker.h +++ b/sdk/lib/crt/math/arm/__rt_div_worker.h @@ -25,10 +25,18 @@ __brkdiv0(void) __emit(0xDEF9); } -typedef struct _ARM_DIVRESULT +typedef union _ARM_DIVRESULT { - UINT3264 quotient; /* to be returned in R0 */ - UINT3264 modulus; /* to be returned in R1 */ +#ifdef _USE_64_BITS_ + unsigned int raw_data[4]; +#else + unsigned long long raw_data; +#endif + struct + { + UINT3264 quotient; /* to be returned in R0(R0,R1) */ + UINT3264 modulus; /* to be returned in R1(R2,R3) */ + } data; } ARM_DIVRESULT; #ifndef _USE_64_BITS_ @@ -36,9 +44,9 @@ __forceinline #endif void __rt_div_worker( - ARM_DIVRESULT *result, UINT3264 divisor, - UINT3264 dividend) + UINT3264 dividend, + ARM_DIVRESULT* result) { UINT3264 shift; UINT3264 mask; @@ -70,8 +78,8 @@ __rt_div_worker( if (divisor > dividend) { - result->quotient = 0; - result->modulus = divisor; + result->data.quotient = 0; + result->data.modulus = divisor; return; } @@ -110,7 +118,6 @@ __rt_div_worker( } #endif // _SIGNED_DIV_ - result->quotient = quotient; - result->modulus = dividend; - return; + result->data.quotient = quotient; + result->data.modulus = dividend; } diff --git a/sdk/lib/crt/math/arm/__rt_sdiv.c b/sdk/lib/crt/math/arm/__rt_sdiv.c index dea2b30e326..302cec422a4 100644 --- a/sdk/lib/crt/math/arm/__rt_sdiv.c +++ b/sdk/lib/crt/math/arm/__rt_sdiv.c @@ -13,14 +13,15 @@ #include "__rt_div_worker.h" -ARM_DIVRESULT +unsigned long long __rt_sdiv( int divisor, int dividend) { ARM_DIVRESULT result; - __rt_sdiv_worker(&result, divisor, dividend); - return result; + __rt_sdiv_worker(divisor, dividend, &result); + + return result.raw_data; } diff --git a/sdk/lib/crt/math/arm/__rt_sdiv64.s b/sdk/lib/crt/math/arm/__rt_sdiv64.s index c5ea8bb15ed..d3515a79729 100644 --- a/sdk/lib/crt/math/arm/__rt_sdiv64.s +++ b/sdk/lib/crt/math/arm/__rt_sdiv64.s @@ -18,19 +18,18 @@ NESTED_ENTRY __rt_sdiv64 /* Allocate stack space and store parameters there */ - stmdb sp!,{r0,r1,r2,r3,lr} + push {lr} + sub sp,sp,0x10 + mov r12,sp + push {r12} PROLOG_END - /* Load pointer to stack structure into R0 */ - mov r0, sp - /* Call the C worker function */ - adr lr, Return - b __rt_sdiv64_worker + bl __rt_sdiv64_worker + add sp,sp,0x04 -Return /* Move result data into the appropriate registers and return */ - ldmia sp!,{r0,r1,r2,r3,pc} + pop {r0,r1,r2,r3,pc} NESTED_END __rt_sdiv64 END diff --git a/sdk/lib/crt/math/arm/__rt_udiv.c b/sdk/lib/crt/math/arm/__rt_udiv.c index 0d047e3c66a..2f47697d8ff 100644 --- a/sdk/lib/crt/math/arm/__rt_udiv.c +++ b/sdk/lib/crt/math/arm/__rt_udiv.c @@ -11,14 +11,15 @@ #include "__rt_div_worker.h" -ARM_DIVRESULT +unsigned long long __rt_udiv( unsigned int divisor, unsigned int dividend) { ARM_DIVRESULT result; - __rt_udiv_worker(&result, divisor, dividend); - return result; + __rt_udiv_worker(divisor, dividend, &result); + + return result.raw_data; } diff --git a/sdk/lib/crt/math/arm/__rt_udiv64.s b/sdk/lib/crt/math/arm/__rt_udiv64.s index 07c90bce81c..d08a02fc463 100644 --- a/sdk/lib/crt/math/arm/__rt_udiv64.s +++ b/sdk/lib/crt/math/arm/__rt_udiv64.s @@ -18,19 +18,18 @@ NESTED_ENTRY __rt_udiv64 /* Allocate stack space and store parameters there */ - stmdb sp!,{r0,r1,r2,r3,lr} + push {lr} + sub sp,sp,0x10 + mov r12,sp + push {r12} PROLOG_END - /* Load pointer to stack structure into R0 */ - mov r0, sp - /* Call the C worker function */ - adr lr, Return - b __rt_udiv64_worker + bl __rt_udiv64_worker + add sp,sp,0x04 -Return /* Move result data into the appropriate registers and return */ - ldmia sp!,{r0,r1,r2,r3,pc} + pop {r0,r1,r2,r3,pc} NESTED_END __rt_udiv64 END
3 years, 5 months
1
0
0
0
[reactos] 01/01: [SHELL32] Update de-DE.rc in IDD_BROWSE_FOR_FOLDER_NEW
by Joachim Henze
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c30b1fe893e8c7cfb9c80…
commit c30b1fe893e8c7cfb9c8031b3c8cc83a311a294f Author: Joachim Henze <Joachim.Henze(a)reactos.org> AuthorDate: Sat Jul 24 15:11:54 2021 +0200 Commit: Joachim Henze <Joachim.Henze(a)reactos.org> CommitDate: Sat Jul 24 15:11:54 2021 +0200 [SHELL32] Update de-DE.rc in IDD_BROWSE_FOR_FOLDER_NEW More space for the german text in that button. Correct the keyboard accelerator. --- dll/win32/shell32/lang/de-DE.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/win32/shell32/lang/de-DE.rc b/dll/win32/shell32/lang/de-DE.rc index f5cd30140e8..abfd2401c7c 100644 --- a/dll/win32/shell32/lang/de-DE.rc +++ b/dll/win32/shell32/lang/de-DE.rc @@ -109,7 +109,7 @@ BEGIN LTEXT "", IDC_BROWSE_FOR_FOLDER_STATUS, 10, 25, 198, 12 EDITTEXT IDC_BROWSE_FOR_FOLDER_FOLDER_TEXT, 12, 38, 194, 14, ES_AUTOHSCROLL | WS_GROUP CONTROL "", IDC_BROWSE_FOR_FOLDER_TREEVIEW, "SysTreeView32", TVS_SHOWSELALWAYS | TVS_EDITLABELS | TVS_LINESATROOT | TVS_HASLINES | TVS_HASBUTTONS | WS_BORDER | WS_TABSTOP, 12, 58, 194, 105 - PUSHBUTTON "&Neuen Ordner erstellen", IDC_BROWSE_FOR_FOLDER_NEW_FOLDER, 12, 174, 77, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Neuen &Ordner erstellen", IDC_BROWSE_FOR_FOLDER_NEW_FOLDER, 12, 174, 85, 14, WS_GROUP | WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 102, 174, 50, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP PUSHBUTTON "Abbrechen", IDCANCEL, 156, 174, 50, 14, WS_GROUP | WS_TABSTOP END
3 years, 5 months
1
0
0
0
[reactos] 03/03: [SHELLUTILS] Fix FAILED_UNEXPECTEDLY macro evaluating twice
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=61e7ea5be5ef98bb54b37…
commit 61e7ea5be5ef98bb54b37f919abcfc14438c42f2 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Fri Jul 23 20:24:13 2021 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Fri Jul 23 22:10:36 2021 +0200 [SHELLUTILS] Fix FAILED_UNEXPECTEDLY macro evaluating twice --- sdk/include/reactos/shellutils.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sdk/include/reactos/shellutils.h b/sdk/include/reactos/shellutils.h index c4e4026fd14..f1b8461653f 100644 --- a/sdk/include/reactos/shellutils.h +++ b/sdk/include/reactos/shellutils.h @@ -23,7 +23,7 @@ extern "C" { #endif /* defined(__cplusplus) */ -static inline ULONG +inline ULONG Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...) { char szMsg[512]; @@ -68,7 +68,18 @@ Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...) #endif #if 1 -#define FAILED_UNEXPECTEDLY(hr) (FAILED(hr) && (Win32DbgPrint(__FILE__, __LINE__, "Unexpected failure %08x.\n", hr), TRUE)) + +inline BOOL _ROS_FAILED_HELPER(HRESULT hr, const char* expr, const char* filename, int line) +{ + if (FAILED(hr)) + { + Win32DbgPrint(filename, line, "Unexpected failure (%s)=%08x.\n", expr, hr); + return TRUE; + } + return FALSE; +} + +#define FAILED_UNEXPECTEDLY(hr) _ROS_FAILED_HELPER((hr), #hr, __FILE__, __LINE__) #else #define FAILED_UNEXPECTEDLY(hr) FAILED(hr) #endif
3 years, 5 months
1
0
0
0
[reactos] 02/03: [SHELL32] CDefView: Respect item attributes
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d039653959aca40876ba9…
commit d039653959aca40876ba91c448f46ccb530d4749 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Thu Jul 15 22:46:20 2021 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Fri Jul 23 22:10:36 2021 +0200 [SHELL32] CDefView: Respect item attributes --- dll/win32/shell32/CDefView.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp index 50471196d31..608738f48e6 100644 --- a/dll/win32/shell32/CDefView.cpp +++ b/dll/win32/shell32/CDefView.cpp @@ -1587,6 +1587,26 @@ LRESULT CDefView::OnExplorerCommand(UINT uCommand, BOOL bUseSelection) if (FAILED_UNEXPECTEDLY( hResult)) goto cleanup; + if (bUseSelection) + { + // FIXME: we should cache this.... + SFGAOF rfg = SFGAO_BROWSABLE | SFGAO_CANCOPY | SFGAO_CANLINK | SFGAO_CANMOVE | SFGAO_CANDELETE | SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_FILESYSTEM | SFGAO_FOLDER; + hResult = m_pSFParent->GetAttributesOf(m_cidl, m_apidl, &rfg); + if (FAILED_UNEXPECTEDLY(hResult)) + return 0; + + if (!(rfg & SFGAO_CANMOVE) && uCommand == FCIDM_SHVIEW_CUT) + return 0; + if (!(rfg & SFGAO_CANCOPY) && uCommand == FCIDM_SHVIEW_COPY) + return 0; + if (!(rfg & SFGAO_CANDELETE) && uCommand == FCIDM_SHVIEW_DELETE) + return 0; + if (!(rfg & SFGAO_CANRENAME) && uCommand == FCIDM_SHVIEW_RENAME) + return 0; + if (!(rfg & SFGAO_HASPROPSHEET) && uCommand == FCIDM_SHVIEW_PROPERTIES) + return 0; + } + InvokeContextMenuCommand(uCommand); cleanup: @@ -1819,6 +1839,9 @@ LRESULT CDefView::OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHand case FCIDM_SHVIEW_PROPERTIES: case FCIDM_SHVIEW_COPYTO: case FCIDM_SHVIEW_MOVETO: + if (SHRestricted(REST_NOVIEWCONTEXTMENU)) + return 0; + return OnExplorerCommand(dwCmdID, TRUE); case FCIDM_SHVIEW_INSERT:
3 years, 5 months
1
0
0
0
[reactos] 01/03: [FONTEXT] Cache attributes, handle sorting
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=91e63ee0b5a28f5a0e56f…
commit 91e63ee0b5a28f5a0e56f4c56b701888d12692f3 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Thu Jul 15 22:45:19 2021 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Fri Jul 23 22:10:30 2021 +0200 [FONTEXT] Cache attributes, handle sorting --- dll/shellext/fontext/CDataObject.cpp | 36 ++-------- dll/shellext/fontext/CEnumFonts.cpp | 2 +- dll/shellext/fontext/CFontCache.cpp | 86 ++++++++++++++++++++---- dll/shellext/fontext/CFontCache.hpp | 24 +++++-- dll/shellext/fontext/CFontExt.cpp | 125 +++++++++++++++++++++++++---------- dll/shellext/fontext/CFontExt.hpp | 4 +- dll/shellext/fontext/CFontMenu.cpp | 15 ++++- dll/shellext/fontext/fontext.cpp | 2 +- dll/shellext/fontext/fontpidl.cpp | 2 +- dll/shellext/fontext/fontpidl.hpp | 4 +- sdk/include/reactos/shellutils.h | 65 ++++++++++++++++++ 11 files changed, 268 insertions(+), 97 deletions(-) diff --git a/dll/shellext/fontext/CDataObject.cpp b/dll/shellext/fontext/CDataObject.cpp index f6851f19985..bff70910043 100644 --- a/dll/shellext/fontext/CDataObject.cpp +++ b/dll/shellext/fontext/CDataObject.cpp @@ -2,7 +2,7 @@ * PROJECT: ReactOS Font Shell Extension * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) * PURPOSE: CFontMenu implementation - * COPYRIGHT: Copyright 2019,2020 Mark Jansen (mark.jansen(a)reactos.org) + * COPYRIGHT: Copyright 2019-2021 Mark Jansen <mark.jansen(a)reactos.org> */ #include "precomp.h" @@ -58,7 +58,7 @@ HRESULT _CDataObject_CreateInstance(PCIDLIST_ABSOLUTE folder, UINT cidl, PCUITEM const FontPidlEntry* fontEntry = _FontFromIL(apidl[n]); if (fontEntry) { - CStringW File = g_FontCache->Filename(fontEntry, true); + CStringW File = g_FontCache->Filename(g_FontCache->Find(fontEntry), true); if (!File.IsEmpty()) { // Now append the path (+ nullterminator) to the buffer @@ -94,36 +94,8 @@ HRESULT _CDataObject_CreateInstance(PCIDLIST_ABSOLUTE folder, UINT cidl, PCUITEM pDrop->pt.x = pDrop->pt.y = 0; pDrop-> fNC = NULL; - // Prepare the format descriptors - STGMEDIUM medium = {0}; - medium.tymed = TYMED_HGLOBAL; - - // Copy the data to an HGLOBAL - medium.hGlobal = GlobalAlloc(GHND, offset); - if (medium.hGlobal) - { - LPVOID blob = GlobalLock(medium.hGlobal); - if (blob) - { - CopyMemory(blob, (BYTE*)data, offset); - GlobalUnlock(medium.hGlobal); - - CComPtr<IDataObject> spDataObject(*(IDataObject**)ppvOut); - if (spDataObject) - { - FORMATETC etc = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; - hr = spDataObject->SetData(&etc, &medium, TRUE); - } - } - else - { - ERR("Unable to lock the hGlobal?!\n"); - } - } - else - { - ERR("Unable to allocate %u bytes for the hGlobal\n", offset); - } + hr = DataObject_SetData(*(IDataObject**)ppvOut, CF_HDROP, data, offset); + FAILED_UNEXPECTEDLY(hr); return hr; } diff --git a/dll/shellext/fontext/CEnumFonts.cpp b/dll/shellext/fontext/CEnumFonts.cpp index 7e197187cdf..1b81a09318b 100644 --- a/dll/shellext/fontext/CEnumFonts.cpp +++ b/dll/shellext/fontext/CEnumFonts.cpp @@ -2,7 +2,7 @@ * PROJECT: ReactOS Font Shell Extension * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) * PURPOSE: CEnumFonts implementation - * COPYRIGHT: Copyright 2019 Mark Jansen (mark.jansen(a)reactos.org) + * COPYRIGHT: Copyright 2019 Mark Jansen <mark.jansen(a)reactos.org> */ #include "precomp.h" diff --git a/dll/shellext/fontext/CFontCache.cpp b/dll/shellext/fontext/CFontCache.cpp index 218be7bb638..53a7a5a6aec 100644 --- a/dll/shellext/fontext/CFontCache.cpp +++ b/dll/shellext/fontext/CFontCache.cpp @@ -2,7 +2,7 @@ * PROJECT: ReactOS Font Shell Extension * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) * PURPOSE: font list cache handling - * COPYRIGHT: Copyright 2019,2020 Mark Jansen (mark.jansen(a)reactos.org) + * COPYRIGHT: Copyright 2019-2021 Mark Jansen <mark.jansen(a)reactos.org> */ #include "precomp.h" @@ -14,7 +14,11 @@ CFontCache* g_FontCache = NULL; CFontInfo::CFontInfo(LPCWSTR name) : m_Name(name) , m_FileRead(false) + , m_AttrsRead(false) + , m_FileWriteTime({}) + , m_dwFileAttributes(0) { + m_FileSize.QuadPart = 0; } const CStringW& CFontInfo::Name() const @@ -62,7 +66,52 @@ const CStringW& CFontInfo::File() return m_File; } +void CFontInfo::ReadAttrs() +{ + CStringW File = g_FontCache->Filename(this, true); + + m_AttrsRead = true; + + WIN32_FIND_DATAW findFileData; + HANDLE hFile = FindFirstFileW(File, &findFileData); + if (hFile != INVALID_HANDLE_VALUE) + { + + // File write time + FileTimeToLocalFileTime(&findFileData.ftLastWriteTime, &m_FileWriteTime); + + // File size + m_FileSize.HighPart = findFileData.nFileSizeHigh; + m_FileSize.LowPart = findFileData.nFileSizeLow; + + m_dwFileAttributes = findFileData.dwFileAttributes; + FindClose(hFile); + } +} + +const LARGE_INTEGER& CFontInfo::FileSize() +{ + if (!m_AttrsRead) + ReadAttrs(); + + return m_FileSize; +} + +const FILETIME& CFontInfo::FileWriteTime() +{ + if (!m_AttrsRead) + ReadAttrs(); + + return m_FileWriteTime; +} + +DWORD CFontInfo::FileAttributes() +{ + if (!m_AttrsRead) + ReadAttrs(); + return m_dwFileAttributes; +} CFontCache::CFontCache() { @@ -93,30 +142,39 @@ CStringW CFontCache::Name(size_t Index) return m_Fonts[Index].Name(); } -CStringW CFontCache::Filename(const FontPidlEntry* fontEntry, bool alwaysFullPath) +CFontInfo* CFontCache::Find(const FontPidlEntry* fontEntry) { - CStringW File; - if (fontEntry->Index < m_Fonts.GetCount()) { - CFontInfo& info = m_Fonts[fontEntry->Index]; - - if (info.Name().CompareNoCase(fontEntry->Name) == 0) - File = info.File(); + if (m_Fonts[fontEntry->Index].Name().CompareNoCase(fontEntry->Name) == 0) + return &m_Fonts[fontEntry->Index]; } - for (UINT n = 0; File.IsEmpty() && n < Size(); ++n) + for (UINT n = 0; n < Size(); ++n) { if (m_Fonts[n].Name().CompareNoCase(fontEntry->Name) == 0) - File = m_Fonts[n].File(); + { + return &m_Fonts[n]; + } } + return nullptr; +} - if (!File.IsEmpty() && alwaysFullPath) + +CStringW CFontCache::Filename(CFontInfo* info, bool alwaysFullPath) +{ + CStringW File; + if (info) { - // Ensure this is a full path - if (PathIsRelativeW(File)) + File = info->File(); + + if (!File.IsEmpty() && alwaysFullPath) { - File = m_FontFolderPath + File; + // Ensure this is a full path + if (PathIsRelativeW(File)) + { + File = m_FontFolderPath + File; + } } } diff --git a/dll/shellext/fontext/CFontCache.hpp b/dll/shellext/fontext/CFontCache.hpp index 9454660a653..e047e6b4b1d 100644 --- a/dll/shellext/fontext/CFontCache.hpp +++ b/dll/shellext/fontext/CFontCache.hpp @@ -2,7 +2,7 @@ * PROJECT: ReactOS Font Shell Extension * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) * PURPOSE: font list cache handling - * COPYRIGHT: Copyright 2019,2020 Mark Jansen (mark.jansen(a)reactos.org) + * COPYRIGHT: Copyright 2019-2021 Mark Jansen <mark.jansen(a)reactos.org> */ #pragma once @@ -14,12 +14,24 @@ private: CStringW m_Name; CStringW m_File; bool m_FileRead; + + bool m_AttrsRead; + LARGE_INTEGER m_FileSize; + FILETIME m_FileWriteTime; + DWORD m_dwFileAttributes; + + void ReadAttrs(); + public: CFontInfo(LPCWSTR name = L""); - const CStringW& Name() const; - const CStringW& File(); + const CStringW& Name() const; // Font display name stored in the registry const bool Valid() const; + + const CStringW& File(); // Full path or file, depending on how it's stored in the registry + const LARGE_INTEGER& FileSize(); + const FILETIME& FileWriteTime(); + DWORD FileAttributes(); }; @@ -40,8 +52,10 @@ public: const CStringW& FontPath() const { return m_FontFolderPath; } size_t Size(); - CStringW Name(size_t Index); - CStringW Filename(const FontPidlEntry* fontEntry, bool alwaysFullPath = false); + CStringW Name(size_t Index); // Font display name stored in the registry + + CFontInfo* Find(const FontPidlEntry* fontEntry); + CStringW Filename(CFontInfo* info, bool alwaysFullPath = false); friend class CFontExtModule; }; diff --git a/dll/shellext/fontext/CFontExt.cpp b/dll/shellext/fontext/CFontExt.cpp index 03d03f420b1..b2681055cd2 100644 --- a/dll/shellext/fontext/CFontExt.cpp +++ b/dll/shellext/fontext/CFontExt.cpp @@ -2,7 +2,7 @@ * PROJECT: ReactOS Font Shell Extension * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) * PURPOSE: CFontExt implementation - * COPYRIGHT: Copyright 2019,2020 Mark Jansen (mark.jansen(a)reactos.org) + * COPYRIGHT: Copyright 2019-2021 Mark Jansen <mark.jansen(a)reactos.org> * Copyright 2019 Katayama Hirofumi MZ (katayama.hirofumi.mz(a)gmail.com) */ @@ -11,6 +11,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(fontext); +#ifndef SHCIDS_ALLFIELDS +#define SHCIDS_ALLFIELDS 0x80000000L +#endif struct FolderViewColumns { @@ -20,6 +23,15 @@ struct FolderViewColumns int fmt; }; +enum font_columns +{ + FONTEXT_COL_NAME, + FONTEXT_COL_FILENAME, + FONTEXT_COL_SIZE, + FONTEXT_COL_MODIFIED, + FONTEXT_COL_ATTR, +}; + static FolderViewColumns g_ColumnDefs[] = { { IDS_COL_NAME, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, 25, LVCFMT_LEFT }, @@ -140,7 +152,7 @@ STDMETHODIMP CFontExt::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDET } // Name, ReactOS specific? - if (iColumn == 0) + if (iColumn == FONTEXT_COL_NAME) return GetDisplayNameOf(pidl, 0, &psd->str); const FontPidlEntry* fontEntry = _FontFromIL(pidl); @@ -151,41 +163,28 @@ STDMETHODIMP CFontExt::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDET } // If we got here, we are in details view! - // Let's see if we got info about this file that we can re-use - if (m_LastDetailsFontName != fontEntry->Name) + auto info = g_FontCache->Find(fontEntry); + if (info == nullptr) { - CStringW File = g_FontCache->Filename(fontEntry, true); - HANDLE hFile = FindFirstFileW(File, &m_LastDetailsFileData); - if (hFile == INVALID_HANDLE_VALUE) - { - m_LastDetailsFontName.Empty(); - ERR("Unable to query info about %S\n", File.GetString()); - return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND); - } - FindClose(hFile); - m_LastDetailsFontName = fontEntry->Name; + ERR("Unable to query info about %S\n", fontEntry->Name); + return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND); } - // Most code borrowed from CFSFolder::GetDetailsOf - FILETIME lft; - SYSTEMTIME time; int ret; - LARGE_INTEGER FileSize; CStringA AttrLetters; + DWORD dwAttributes; + SYSTEMTIME time; switch (iColumn) { - case 1: // Filename - return SHSetStrRet(&psd->str, m_LastDetailsFileData.cFileName); - case 2: // Size + case FONTEXT_COL_FILENAME: + return SHSetStrRet(&psd->str, PathFindFileNameW(info->File())); + case FONTEXT_COL_SIZE: psd->str.uType = STRRET_CSTR; - FileSize.HighPart = m_LastDetailsFileData.nFileSizeHigh; - FileSize.LowPart = m_LastDetailsFileData.nFileSizeLow; - StrFormatKBSizeA(FileSize.QuadPart, psd->str.cStr, MAX_PATH); + StrFormatKBSizeA(info->FileSize().QuadPart, psd->str.cStr, MAX_PATH); return S_OK; - case 3: // Modified - FileTimeToLocalFileTime(&m_LastDetailsFileData.ftLastWriteTime, &lft); - FileTimeToSystemTime (&lft, &time); + case FONTEXT_COL_MODIFIED: psd->str.uType = STRRET_CSTR; + FileTimeToSystemTime(&info->FileWriteTime(), &time); ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &time, NULL, psd->str.cStr, MAX_PATH); if (ret < 1) { @@ -195,7 +194,7 @@ STDMETHODIMP CFontExt::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDET psd->str.cStr[ret-1] = ' '; GetTimeFormatA(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &time, NULL, &psd->str.cStr[ret], MAX_PATH - ret); return S_OK; - case 4: // Attributes + case FONTEXT_COL_ATTR: AttrLetters.LoadString(IDS_COL_ATTR_LETTERS); if (AttrLetters.GetLength() != 5) { @@ -203,16 +202,17 @@ STDMETHODIMP CFontExt::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDET return E_FAIL; } psd->str.uType = STRRET_CSTR; + dwAttributes = info->FileAttributes(); ret = 0; - if (m_LastDetailsFileData.dwFileAttributes & FILE_ATTRIBUTE_READONLY) + if (dwAttributes & FILE_ATTRIBUTE_READONLY) psd->str.cStr[ret++] = AttrLetters[0]; - if (m_LastDetailsFileData.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) + if (dwAttributes & FILE_ATTRIBUTE_HIDDEN) psd->str.cStr[ret++] = AttrLetters[1]; - if (m_LastDetailsFileData.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM) + if (dwAttributes & FILE_ATTRIBUTE_SYSTEM) psd->str.cStr[ret++] = AttrLetters[2]; - if (m_LastDetailsFileData.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE) + if (dwAttributes & FILE_ATTRIBUTE_ARCHIVE) psd->str.cStr[ret++] = AttrLetters[3]; - if (m_LastDetailsFileData.dwFileAttributes & FILE_ATTRIBUTE_COMPRESSED) + if (dwAttributes & FILE_ATTRIBUTE_COMPRESSED) psd->str.cStr[ret++] = AttrLetters[4]; psd->str.cStr[ret] = '\0'; return S_OK; @@ -262,7 +262,53 @@ STDMETHODIMP CFontExt::CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUID if (!fontEntry1 || !fontEntry2) return E_INVALIDARG; - int result = (int)fontEntry1->Index - (int)fontEntry2->Index; + int result; + DWORD sortMode = lParam & 0xFFFF0000; + DWORD column = lParam & 0x0000FFFF; + if (sortMode == SHCIDS_ALLFIELDS) + { + UNIMPLEMENTED; + result = (int)fontEntry1->Index - (int)fontEntry2->Index; + } + else + { + auto info1 = g_FontCache->Find(fontEntry1); + auto info2 = g_FontCache->Find(fontEntry2); + + if (!info1 || !info2) + { + ERR("Unable to find font %S or %S in cache!\n", fontEntry1->Name, fontEntry2->Name); + return E_INVALIDARG; + } + + switch (column) + { + case 0xffff: + /* ROS bug? */ + case FONTEXT_COL_NAME: + // These items are already ordered by name + result = (int)fontEntry1->Index - (int)fontEntry2->Index; + break; + case FONTEXT_COL_FILENAME: + result = wcsicmp(PathFindFileNameW(info1->File()), PathFindFileNameW(info2->File())); + break; + case FONTEXT_COL_SIZE: + result = (int)info1->FileSize().HighPart - info2->FileSize().HighPart; + if (result == 0) + result = (int)info1->FileSize().LowPart - info2->FileSize().LowPart; + break; + case FONTEXT_COL_MODIFIED: + result = CompareFileTime(&info1->FileWriteTime(), &info2->FileWriteTime()); + break; + case FONTEXT_COL_ATTR: + // FIXME: how to compare attributes? + result = (int)info1->FileAttributes() - info2->FileAttributes(); + break; + default: + ERR("Unimplemented column %u\n", column); + return E_INVALIDARG; + } + } return MAKE_COMPARE_HRESULT(result); } @@ -341,7 +387,7 @@ STDMETHODIMP CFontExt::GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ if (fontEntry) { DWORD dwAttributes = FILE_ATTRIBUTE_NORMAL; - CStringW File = g_FontCache->Filename(fontEntry); + CStringW File = g_FontCache->Filename(g_FontCache->Find(fontEntry)); // Just create a default icon extractor based on the filename // We might want to create a preview with the font to get really fancy one day. return SHCreateFileExtractIconW(File, dwAttributes, riid, ppvOut); @@ -385,6 +431,15 @@ STDMETHODIMP CFontExt::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPS if (!fontEntry) return E_FAIL; + if (dwFlags == SHGDN_FORPARSING) + { + CStringW File = g_FontCache->Filename(g_FontCache->Find(fontEntry), true); + if (!File.IsEmpty()) + { + return SHSetStrRet(strRet, File); + } + } + return SHSetStrRet(strRet, fontEntry->Name); } diff --git a/dll/shellext/fontext/CFontExt.hpp b/dll/shellext/fontext/CFontExt.hpp index ba868628957..a3e5431c90f 100644 --- a/dll/shellext/fontext/CFontExt.hpp +++ b/dll/shellext/fontext/CFontExt.hpp @@ -2,7 +2,7 @@ * PROJECT: ReactOS Font Shell Extension * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) * PURPOSE: CFontExt definition - * COPYRIGHT: Copyright 2019,2020 Mark Jansen (mark.jansen(a)reactos.org) + * COPYRIGHT: Copyright 2019,2020 Mark Jansen <mark.jansen(a)reactos.org> * Copyright 2019 Katayama Hirofumi MZ (katayama.hirofumi.mz(a)gmail.com) */ @@ -16,8 +16,6 @@ class CFontExt : public IDropTarget { CComHeapPtr<ITEMIDLIST> m_Folder; - CStringW m_LastDetailsFontName; - WIN32_FIND_DATAW m_LastDetailsFileData; public: diff --git a/dll/shellext/fontext/CFontMenu.cpp b/dll/shellext/fontext/CFontMenu.cpp index 05b968e27d3..62464a099ee 100644 --- a/dll/shellext/fontext/CFontMenu.cpp +++ b/dll/shellext/fontext/CFontMenu.cpp @@ -2,7 +2,7 @@ * PROJECT: ReactOS Font Shell Extension * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) * PURPOSE: CFontMenu implementation - * COPYRIGHT: Copyright 2019,2020 Mark Jansen (mark.jansen(a)reactos.org) + * COPYRIGHT: Copyright 2019,2020 Mark Jansen <mark.jansen(a)reactos.org> */ #include "precomp.h" @@ -69,7 +69,7 @@ static void RunFontViewer(HWND hwnd, const FontPidlEntry* fontEntry) WCHAR FontViewerPath[MAX_PATH] = L"%SystemRoot%\\System32\\fontview.exe"; WCHAR FontPathArg[MAX_PATH + 3]; - CStringW Path = g_FontCache->Filename(fontEntry, true); + CStringW Path = g_FontCache->Filename(g_FontCache->Find(fontEntry), true); if (!Path.IsEmpty()) { // '/d' disables the install button @@ -108,7 +108,7 @@ static HRESULT CALLBACK FontFolderMenuCallback(IShellFolder *psf, HWND hwnd, IDa return S_OK; } case DFM_INVOKECOMMAND: - // Preview is the only item we can handle + // Preview is the only item we handle if (wParam == 0) { CComHeapPtr<CIDA> cida; @@ -123,6 +123,15 @@ static HRESULT CALLBACK FontFolderMenuCallback(IShellFolder *psf, HWND hwnd, IDa } return S_OK; } + else if (wParam == DFM_CMD_PROPERTIES) + { + ERR("Default properties handling!\n"); + return S_FALSE; + } + else + { + ERR("Unhandled DFM_INVOKECOMMAND(wParam=0x%x)\n", wParam); + } return S_FALSE; case DFM_INVOKECOMMANDEX: diff --git a/dll/shellext/fontext/fontext.cpp b/dll/shellext/fontext/fontext.cpp index d3659199e2d..0b68e40a7cb 100644 --- a/dll/shellext/fontext/fontext.cpp +++ b/dll/shellext/fontext/fontext.cpp @@ -2,7 +2,7 @@ * PROJECT: ReactOS Font Shell Extension * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) * PURPOSE: Shell extension entry point - * COPYRIGHT: Copyright 2019,2020 Mark Jansen (mark.jansen(a)reactos.org) + * COPYRIGHT: Copyright 2019,2020 Mark Jansen <mark.jansen(a)reactos.org> */ #include "precomp.h" diff --git a/dll/shellext/fontext/fontpidl.cpp b/dll/shellext/fontext/fontpidl.cpp index 38bb7814c84..6354e848bf2 100644 --- a/dll/shellext/fontext/fontpidl.cpp +++ b/dll/shellext/fontext/fontpidl.cpp @@ -2,7 +2,7 @@ * PROJECT: ReactOS Font Shell Extension * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) * PURPOSE: pidl handling - * COPYRIGHT: Copyright 2019,2020 Mark Jansen (mark.jansen(a)reactos.org) + * COPYRIGHT: Copyright 2019,2020 Mark Jansen <mark.jansen(a)reactos.org> */ #include "precomp.h" diff --git a/dll/shellext/fontext/fontpidl.hpp b/dll/shellext/fontext/fontpidl.hpp index f5ef556ddff..1546f646f78 100644 --- a/dll/shellext/fontext/fontpidl.hpp +++ b/dll/shellext/fontext/fontpidl.hpp @@ -2,7 +2,7 @@ * PROJECT: ReactOS Font Shell Extension * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) * PURPOSE: pidl handling - * COPYRIGHT: Copyright 2019 Mark Jansen (mark.jansen(a)reactos.org) + * COPYRIGHT: Copyright 2019 Mark Jansen <mark.jansen(a)reactos.org> */ #pragma once @@ -12,7 +12,7 @@ struct FontPidlEntry { WORD cb; WORD Magic; - ULONG Index; // Informative only + ULONG Index; // Informative only, used for sorting WCHAR Name[1]; }; diff --git a/sdk/include/reactos/shellutils.h b/sdk/include/reactos/shellutils.h index 82f2f708eee..c4e4026fd14 100644 --- a/sdk/include/reactos/shellutils.h +++ b/sdk/include/reactos/shellutils.h @@ -546,4 +546,69 @@ static inline PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const* pida, SIZE_T i) } +#ifdef __cplusplus + +inline +HRESULT DataObject_GetData(IDataObject* pDataObject, CLIPFORMAT clipformat, PVOID pBuffer, SIZE_T dwBufferSize) +{ + FORMATETC fmt = { clipformat, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; + STGMEDIUM medium = { TYMED_NULL }; + + HRESULT hr = pDataObject->GetData(&fmt, &medium); + if (SUCCEEDED(hr)) + { + LPVOID blob = GlobalLock(medium.hGlobal); + if (blob) + { + SIZE_T size = GlobalSize(medium.hGlobal); + if (size <= dwBufferSize) + { + CopyMemory(pBuffer, blob, size); + hr = S_OK; + } + else + { + hr = E_OUTOFMEMORY; + } + GlobalUnlock(medium.hGlobal); + } + else + { + hr = STG_E_INVALIDHANDLE; + } + + ReleaseStgMedium(&medium); + } + return hr; +} + +inline +HRESULT DataObject_SetData(IDataObject* pDataObject, CLIPFORMAT clipformat, PVOID pBuffer, SIZE_T dwBufferSize) +{ + STGMEDIUM medium = { TYMED_HGLOBAL }; + + medium.hGlobal = GlobalAlloc(GHND, dwBufferSize); + if (!medium.hGlobal) + return E_OUTOFMEMORY; + + HRESULT hr = E_UNEXPECTED; + LPVOID blob = GlobalLock(medium.hGlobal); + if (blob) + { + CopyMemory(blob, pBuffer, dwBufferSize); + GlobalUnlock(medium.hGlobal); + + FORMATETC etc = { clipformat, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; + hr = pDataObject->SetData(&etc, &medium, TRUE); + } + + if (FAILED(hr)) + GlobalFree(medium.hGlobal); + + return hr; +} + +#endif + + #endif /* __ROS_SHELL_UTILS_H */
3 years, 5 months
1
0
0
0
[reactos] 05/05: [CMAKE] Turn all warnings into errors on MSVC x86
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cb9b5387254c613e57aad…
commit cb9b5387254c613e57aadd852e05b4dc8e64344a Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Fri Feb 21 20:07:27 2020 +0100 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Fri Jul 23 22:03:48 2021 +0200 [CMAKE] Turn all warnings into errors on MSVC x86 --- sdk/cmake/msvc.cmake | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/sdk/cmake/msvc.cmake b/sdk/cmake/msvc.cmake index e6b533a5bb4..f32f88cf786 100644 --- a/sdk/cmake/msvc.cmake +++ b/sdk/cmake/msvc.cmake @@ -88,6 +88,22 @@ add_compile_options(/wd4244 /wd4290 /wd4800 /wd4200 /wd4214) # FIXME: Temporarily disable C4018 until we fix more of the others. CORE-10113 add_compile_options(/wd4018) +# Allow all warnings on msbuild/VS IDE +if (MSVC_IDE) + set(ALLOW_WARNINGS TRUE) +endif() + +# On x86 Debug builds, if it's not Clang-CL or msbuild, treat all warnings as errors +if ((ARCH STREQUAL "i386") AND (CMAKE_BUILD_TYPE STREQUAL "Debug") AND (NOT USE_CLANG_CL) AND (NOT MSVC_IDE)) + set(TREAT_ALL_WARNINGS_AS_ERRORS=TRUE) +endif() + +# Define ALLOW_WARNINGS=TRUE on the cmake/configure command line to bypass errors +if (ALLOW_WARNINGS) + # Nothing +elseif (TREAT_ALL_WARNINGS_AS_ERRORS) + add_compile_options(/WX) +else() # The following warnings are treated as errors: # - C4013: implicit function declaration # - C4020: too many actual parameters @@ -119,6 +135,8 @@ if(MSVC_IDE OR CMAKE_BUILD_TYPE STREQUAL "Debug") add_compile_options(/we4101 /we4189) endif() +endif() + # Enable warnings above the default level, but don't treat them as errors: # - C4115: named type definition in parentheses add_compile_options(/w14115) @@ -194,8 +212,8 @@ if (NOT MSVC_IDE) endif() if(_VS_ANALYZE_) - message("VS static analysis enabled!") - add_compile_options(/analyze) + message("-- VS static analysis enabled!") + add_compile_options(/analyze:WX-) elseif(_PREFAST_) message("PREFAST enabled!") set(CMAKE_C_COMPILE_OBJECT "prefast <CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <INCLUDES> <FLAGS> <DEFINES> /Fo<OBJECT> -c <SOURCE>${CMAKE_END_TEMP_FILE}"
3 years, 5 months
1
0
0
0
[reactos] 04/05: [REACTOS] Silence warnings in 3r-party code
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=41bc57ddf07abe2311743…
commit 41bc57ddf07abe23117437b4fa3c8e0369abfba8 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Tue Jun 29 10:03:28 2021 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Fri Jul 23 22:03:48 2021 +0200 [REACTOS] Silence warnings in 3r-party code --- base/applications/mstsc/CMakeLists.txt | 5 +++++ base/applications/network/telnet/CMakeLists.txt | 6 ++++++ base/services/nfsd/CMakeLists.txt | 2 +- base/services/tftpd/CMakeLists.txt | 5 +++++ dll/3rdparty/libtirpc/CMakeLists.txt | 10 +++------- dll/directx/wine/CMakeLists.txt | 6 ++++++ dll/win32/avifil32/CMakeLists.txt | 5 +++++ dll/win32/comctl32/CMakeLists.txt | 4 +++- dll/win32/crypt32/CMakeLists.txt | 5 +++-- dll/win32/dbghelp/CMakeLists.txt | 3 ++- dll/win32/gdiplus/CMakeLists.txt | 6 ++++++ dll/win32/jscript/CMakeLists.txt | 6 ++++++ dll/win32/kernel32/CMakeLists.txt | 5 +++++ dll/win32/mciseq/CMakeLists.txt | 5 ++++- dll/win32/mciwave/CMakeLists.txt | 5 ++++- dll/win32/msi/CMakeLists.txt | 10 +++++----- dll/win32/msxml3/CMakeLists.txt | 3 +++ dll/win32/netapi32/CMakeLists.txt | 5 +++++ dll/win32/ole32/CMakeLists.txt | 6 ++++++ dll/win32/oleaut32/CMakeLists.txt | 6 ++++++ dll/win32/rpcrt4/CMakeLists.txt | 5 +++++ dll/win32/vbscript/CMakeLists.txt | 5 +++++ dll/win32/windowscodecs/CMakeLists.txt | 5 +++-- dll/win32/wininet/CMakeLists.txt | 5 +++++ dll/win32/winmm/CMakeLists.txt | 5 +++-- dll/win32/wintrust/CMakeLists.txt | 5 +++++ dll/win32/xmllite/CMakeLists.txt | 5 +++++ drivers/bluetooth/fbtusb/CMakeLists.txt | 5 +++++ drivers/filesystems/btrfs/CMakeLists.txt | 5 +++++ drivers/filesystems/ext2/CMakeLists.txt | 8 ++++---- drivers/storage/ide/uniata/CMakeLists.txt | 6 ++++++ modules/rostests/winetests/riched20/CMakeLists.txt | 4 ---- sdk/lib/fslib/ext2lib/CMakeLists.txt | 5 +++++ 33 files changed, 145 insertions(+), 31 deletions(-) diff --git a/base/applications/mstsc/CMakeLists.txt b/base/applications/mstsc/CMakeLists.txt index 87a2df78942..6cede16d5f5 100644 --- a/base/applications/mstsc/CMakeLists.txt +++ b/base/applications/mstsc/CMakeLists.txt @@ -38,3 +38,8 @@ set_module_type(mstsc win32gui UNICODE) add_importlibs(mstsc user32 gdi32 comctl32 ws2_32 crypt32 secur32 advapi32 shell32 ole32 comdlg32 msvcrt kernel32) add_pch(mstsc precomp.h SOURCE) add_cd_file(TARGET mstsc DESTINATION reactos/system32 FOR all) + +if(MSVC) + # Disable warning C4267: 'initializing': conversion from 'size_t' to 'uint16', possible loss of data + target_compile_options(mstsc PRIVATE /wd4267) +endif() diff --git a/base/applications/network/telnet/CMakeLists.txt b/base/applications/network/telnet/CMakeLists.txt index 7bb174f62f2..1af3dfefe26 100644 --- a/base/applications/network/telnet/CMakeLists.txt +++ b/base/applications/network/telnet/CMakeLists.txt @@ -25,6 +25,12 @@ add_executable(telnet ${SOURCE} telnet.rc) target_link_libraries(telnet cppstl) set_target_cpp_properties(telnet WITH_EXCEPTIONS) +if (MSVC) + # C4838: conversion from 'int' to 'SHORT' requires a narrowing conversion + # C4996: 'strnicmp': Deprecated POSIX name, Try _strnicmp instead! + target_compile_options(telnet PRIVATE /wd4838 /wd4996) +endif() + if (NOT MSVC) target_compile_definitions(telnet PRIVATE _CRT_NONSTDC_NO_DEPRECATE) endif() diff --git a/base/services/nfsd/CMakeLists.txt b/base/services/nfsd/CMakeLists.txt index d5f5dbd913c..fdb6f81857a 100644 --- a/base/services/nfsd/CMakeLists.txt +++ b/base/services/nfsd/CMakeLists.txt @@ -50,7 +50,7 @@ add_executable(nfsd ${SOURCE} nfsd.rc) if(MSVC AND (NOT USE_CLANG_CL)) # Disable warning C4477 (printf format warnings) - remove_target_compile_option(nfsd "/we4477") + target_compile_options(nfsd PRIVATE /wd4477) else() # FIXME: Tons of warnings. target_compile_options(nfsd PRIVATE "-w") diff --git a/base/services/tftpd/CMakeLists.txt b/base/services/tftpd/CMakeLists.txt index 1790a81dff6..3fa949c31a0 100644 --- a/base/services/tftpd/CMakeLists.txt +++ b/base/services/tftpd/CMakeLists.txt @@ -4,6 +4,11 @@ set_module_type(tftpd win32cui) add_importlibs(tftpd advapi32 ws2_32 iphlpapi msvcrt kernel32) add_cd_file(TARGET tftpd DESTINATION reactos/system32 FOR all) +if (MSVC) + # Disable warning C4267: 'initializing': conversion from 'size_t' to 'unsigned short', possible loss of data + target_compile_options(tftpd PRIVATE /wd4267) +endif() + if(CMAKE_C_COMPILER_ID STREQUAL "GNU") target_compile_options(tftpd PRIVATE -Wno-format-overflow) endif() diff --git a/dll/3rdparty/libtirpc/CMakeLists.txt b/dll/3rdparty/libtirpc/CMakeLists.txt index d2d97f2cb73..0975514febf 100644 --- a/dll/3rdparty/libtirpc/CMakeLists.txt +++ b/dll/3rdparty/libtirpc/CMakeLists.txt @@ -94,14 +94,10 @@ add_library(libtirpc MODULE ${CMAKE_CURRENT_BINARY_DIR}/libtirpc.def) if(MSVC) - # error C4133: '=': incompatible types - from 'char *' to 'int32_t *' - remove_target_compile_option(libtirpc "/we4133") - # Disable warning C4313 (format string conflicts) - remove_target_compile_option(libtirpc "/we4313") - # Disable warning C4477 (printf format warnings) - remove_target_compile_option(libtirpc "/we4477") + # Disable warning C4273: 'strtok_s': inconsistent dll linkage + # Disable warning C4313: 'fprintf': '%x' in format string conflicts with argument 2 of type 'HANDLE' + target_compile_options(libtirpc PRIVATE /wd4273 /wd4313) if (NOT USE_CLANG_CL) - remove_target_compile_option(libtirpc "/we4101") target_compile_options(libtirpc PRIVATE /wd4101 /wd4133 /wd4473 /wd4477) endif() else() diff --git a/dll/directx/wine/CMakeLists.txt b/dll/directx/wine/CMakeLists.txt index ee7f69896ef..a6fcff25cc7 100644 --- a/dll/directx/wine/CMakeLists.txt +++ b/dll/directx/wine/CMakeLists.txt @@ -1,4 +1,10 @@ +if (MSVC) + # Disable warning C4090: 'function': different 'const' qualifiers + # Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned + add_compile_options(/wd4090 /wd4146) +endif() + add_subdirectory(amstream) add_subdirectory(d3d8) add_subdirectory(d3d9) diff --git a/dll/win32/avifil32/CMakeLists.txt b/dll/win32/avifil32/CMakeLists.txt index c1a9e84bc97..3d7b7799e7f 100644 --- a/dll/win32/avifil32/CMakeLists.txt +++ b/dll/win32/avifil32/CMakeLists.txt @@ -30,6 +30,11 @@ add_library(avifil32 MODULE ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c ${CMAKE_CURRENT_BINARY_DIR}/avifil32.def) +if(MSVC) + # Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned + target_compile_options(avifil32 PRIVATE /wd4146) +endif() + set_module_type(avifil32 win32dll) target_link_libraries(avifil32 wine ${PSEH_LIB}) add_importlibs(avifil32 msacm32 msvfw32 winmm ole32 user32 advapi32 rpcrt4 msvcrt kernel32 ntdll) diff --git a/dll/win32/comctl32/CMakeLists.txt b/dll/win32/comctl32/CMakeLists.txt index 2d963efb7e1..511167db4a1 100644 --- a/dll/win32/comctl32/CMakeLists.txt +++ b/dll/win32/comctl32/CMakeLists.txt @@ -65,8 +65,10 @@ add_library(comctl32 MODULE ${CMAKE_CURRENT_BINARY_DIR}/comctl32.def) if(MSVC) + # Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned + # Disable warning C4267: '=': conversion from 'size_t' to 'WORD', possible loss of data # Disable warning C4477 (printf format warnings) - remove_target_compile_option(comctl32 "/we4477") + target_compile_options(comctl32 PRIVATE /wd4146 /wd4267 /wd4477) endif() set_module_type(comctl32 win32dll UNICODE) diff --git a/dll/win32/crypt32/CMakeLists.txt b/dll/win32/crypt32/CMakeLists.txt index 6bb17abc850..2ee0078b2c1 100644 --- a/dll/win32/crypt32/CMakeLists.txt +++ b/dll/win32/crypt32/CMakeLists.txt @@ -47,8 +47,9 @@ add_library(crypt32 MODULE ${CMAKE_CURRENT_BINARY_DIR}/crypt32.def) if(MSVC) - # error C4312: 'type cast': conversion from 'unsigned int' to 'void *' of greater size - remove_target_compile_option(crypt32 "/we4312") + # Disable warning C4090: 'function': different 'const' qualifiers + # Disable warning C4312: 'type cast': conversion from 'unsigned int' to 'void *' of greater size + target_compile_options(crypt32 PRIVATE /wd4090 /wd4312) endif() set_module_type(crypt32 win32dll) diff --git a/dll/win32/dbghelp/CMakeLists.txt b/dll/win32/dbghelp/CMakeLists.txt index ab1edd17410..3f858614a9e 100644 --- a/dll/win32/dbghelp/CMakeLists.txt +++ b/dll/win32/dbghelp/CMakeLists.txt @@ -81,7 +81,8 @@ else() add_cd_file(TARGET dbghelp DESTINATION reactos/system32 FOR all) if(MSVC) + # Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned # Disable warning C4477 (printf format warnings) - remove_target_compile_option(dbghelp "/we4477") + target_compile_options(dbghelp PRIVATE /wd4146 /wd4477) endif() endif() diff --git a/dll/win32/gdiplus/CMakeLists.txt b/dll/win32/gdiplus/CMakeLists.txt index c939dfa9ddb..65522334bf2 100644 --- a/dll/win32/gdiplus/CMakeLists.txt +++ b/dll/win32/gdiplus/CMakeLists.txt @@ -33,6 +33,12 @@ add_library(gdiplus MODULE gdiplus.rc ${CMAKE_CURRENT_BINARY_DIR}/gdiplus.def) +if(MSVC) + # Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned + # Disable warning C4305: '=': truncation from 'double' to 'REAL' + target_compile_options(gdiplus PRIVATE /wd4146 /wd4305) +endif() + set_module_type(gdiplus win32dll) target_link_libraries(gdiplus wine) add_delay_importlibs(gdiplus windowscodecs) diff --git a/dll/win32/jscript/CMakeLists.txt b/dll/win32/jscript/CMakeLists.txt index 6337587d67a..1690bd6e2f6 100644 --- a/dll/win32/jscript/CMakeLists.txt +++ b/dll/win32/jscript/CMakeLists.txt @@ -55,6 +55,12 @@ add_library(jscript MODULE rsrc.rc ${CMAKE_CURRENT_BINARY_DIR}/jscript.def) +if(MSVC) + # Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned + # Disable warning C4267: '=': conversion from 'size_t' to 'WCHAR', possible loss of data + target_compile_options(jscript PRIVATE /wd4146 /wd4267) +endif() + add_idl_headers(jscript_idlheader jscript_classes.idl) add_typelib(jsglobal.idl) add_dependencies(jscript jscript_idlheader stdole2) diff --git a/dll/win32/kernel32/CMakeLists.txt b/dll/win32/kernel32/CMakeLists.txt index 11339a91e60..1cc82f9d42b 100644 --- a/dll/win32/kernel32/CMakeLists.txt +++ b/dll/win32/kernel32/CMakeLists.txt @@ -93,6 +93,11 @@ list(APPEND SOURCE winnls/string/sortkey.c k32.h) +if(MSVC) + # Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned + set_source_files_properties(wine/res.c PROPERTIES COMPILE_FLAGS /wd4146) +endif() + if(ARCH STREQUAL "i386") list(APPEND ASM_SOURCE client/i386/fiber.S diff --git a/dll/win32/mciseq/CMakeLists.txt b/dll/win32/mciseq/CMakeLists.txt index 8f1dd4ca5a3..6d0091f5e2d 100644 --- a/dll/win32/mciseq/CMakeLists.txt +++ b/dll/win32/mciseq/CMakeLists.txt @@ -13,6 +13,9 @@ target_link_libraries(mciseq wine) add_importlibs(mciseq winmm user32 msvcrt kernel32 ntdll) add_cd_file(TARGET mciseq DESTINATION reactos/system32 FOR all) -if(NOT MSVC) +if(MSVC) + # Disable warning C4305: '=': truncation from 'UINT' to 'WORD' + target_compile_options(mciseq PRIVATE /wd4305) +else() target_compile_options(mciseq PRIVATE "-Wno-overflow") endif() diff --git a/dll/win32/mciwave/CMakeLists.txt b/dll/win32/mciwave/CMakeLists.txt index 569b91f212c..37f44ea86bd 100644 --- a/dll/win32/mciwave/CMakeLists.txt +++ b/dll/win32/mciwave/CMakeLists.txt @@ -16,6 +16,9 @@ target_link_libraries(mciwave wine) add_importlibs(mciwave user32 winmm msvcrt kernel32 ntdll) add_cd_file(TARGET mciwave DESTINATION reactos/system32 FOR all) -if(NOT MSVC) +if(MSVC) + # Disable warning C4305: '=': truncation from 'UINT' to 'WORD' + target_compile_options(mciwave PRIVATE /wd4305) +else() target_compile_options(mciwave PRIVATE "-Wno-overflow") endif() diff --git a/dll/win32/msi/CMakeLists.txt b/dll/win32/msi/CMakeLists.txt index 983913b6097..1b674400b6c 100644 --- a/dll/win32/msi/CMakeLists.txt +++ b/dll/win32/msi/CMakeLists.txt @@ -64,11 +64,11 @@ add_library(msi MODULE ${CMAKE_CURRENT_BINARY_DIR}/msi.def) if(MSVC) - # error C4133: 'function': incompatible types - from 'UINT *' to 'MSIINSTALLCONTEXT *' - remove_target_compile_option(msi "/we4133") - - # error C4312: 'type cast': conversion from 'unsigned int' to 'HANDLE' of greater size - remove_target_compile_option(msi "/we4312") + # Disable warning C4090: 'function': different 'const' qualifiers + # Disable warning C4133: 'function': incompatible types - from 'UINT *' to 'MSIINSTALLCONTEXT *' + # Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned + # Disable warning C4312: 'type cast': conversion from 'unsigned int' to 'HANDLE' of greater size + target_compile_options(msi PRIVATE /wd4090 /wd4133 /wd4146 /wd4312) endif() add_idl_headers(msi_idlheader msiserver.idl) diff --git a/dll/win32/msxml3/CMakeLists.txt b/dll/win32/msxml3/CMakeLists.txt index 4d85db5d4ce..be0ebf4105f 100644 --- a/dll/win32/msxml3/CMakeLists.txt +++ b/dll/win32/msxml3/CMakeLists.txt @@ -76,6 +76,9 @@ target_link_libraries(msxml3 libxml2 iconv-static uuid wine zlib) if(MSVC) target_compile_options(msxml3 PRIVATE /FIwine/typeof.h /FImsvc.h) + + # Disable warning C4090: 'function': different 'const' qualifiers + target_compile_options(msxml3 PRIVATE /wd4090) endif() add_importlibs(msxml3 urlmon ws2_32 shlwapi oleaut32 ole32 user32 msvcrt kernel32 ntdll) diff --git a/dll/win32/netapi32/CMakeLists.txt b/dll/win32/netapi32/CMakeLists.txt index bbc27a4b6e2..0c0c08744f1 100644 --- a/dll/win32/netapi32/CMakeLists.txt +++ b/dll/win32/netapi32/CMakeLists.txt @@ -58,3 +58,8 @@ add_delay_importlibs(netapi32 samlib secur32) add_importlibs(netapi32 iphlpapi ws2_32 advapi32 rpcrt4 msvcrt kernel32 ntdll) add_pch(netapi32 netapi32.h "${PCH_SKIP_SOURCE}") add_cd_file(TARGET netapi32 DESTINATION reactos/system32 FOR all) + +if(MSVC) + # Disable warning C4267: '=': conversion from 'size_t' to 'USHORT', possible loss of data + target_compile_options(netapi32 PRIVATE /wd4267) +endif() diff --git a/dll/win32/ole32/CMakeLists.txt b/dll/win32/ole32/CMakeLists.txt index 61310a2b6ce..2ba952e681d 100644 --- a/dll/win32/ole32/CMakeLists.txt +++ b/dll/win32/ole32/CMakeLists.txt @@ -81,6 +81,12 @@ add_library(ole32 MODULE ${CMAKE_CURRENT_BINARY_DIR}/irot_c.c ${CMAKE_CURRENT_BINARY_DIR}/ole32.def) +if(MSVC) + # Disable warning C4090: '=': different 'const' qualifiers + # Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned + target_compile_options(ole32 PRIVATE /wd4090 /wd4146) +endif() + set_module_type(ole32 win32dll) target_link_libraries(ole32 wine uuid ${PSEH_LIB}) add_delay_importlibs(ole32 oleaut32) diff --git a/dll/win32/oleaut32/CMakeLists.txt b/dll/win32/oleaut32/CMakeLists.txt index 44bdb0a9871..700a878c631 100644 --- a/dll/win32/oleaut32/CMakeLists.txt +++ b/dll/win32/oleaut32/CMakeLists.txt @@ -49,6 +49,12 @@ add_library(oleaut32 MODULE oleaut32.rc ${CMAKE_CURRENT_BINARY_DIR}/oleaut32.def) +if(MSVC) + # Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned + # Disable warning C4267: 'initializing': conversion from 'size_t' to 'BYTE', possible loss of data + target_compile_options(oleaut32 PRIVATE /wd4146 /wd4267) +endif() + add_idl_headers(oleaut32_idlheader oleaut32_oaidl.idl) add_dependencies(oleaut32 oleaut32_idlheader) set_module_type(oleaut32 win32dll) diff --git a/dll/win32/rpcrt4/CMakeLists.txt b/dll/win32/rpcrt4/CMakeLists.txt index c1f8de9f68f..90c9225847a 100644 --- a/dll/win32/rpcrt4/CMakeLists.txt +++ b/dll/win32/rpcrt4/CMakeLists.txt @@ -58,6 +58,11 @@ add_library(rpcrt4 MODULE rpcrt4.rc ${CMAKE_CURRENT_BINARY_DIR}/rpcrt4.def) +if(MSVC) + # Disable warning C4267: '=': conversion from 'size_t' to 'short', possible loss of data + target_compile_options(rpcrt4 PRIVATE /wd4267) +endif() + set_module_type(rpcrt4 win32dll) target_link_libraries(rpcrt4 wine uuid ${PSEH_LIB}) add_delay_importlibs(rpcrt4 iphlpapi wininet secur32 user32 oleaut32) diff --git a/dll/win32/vbscript/CMakeLists.txt b/dll/win32/vbscript/CMakeLists.txt index 145e7364bfa..f2842c8d4e0 100644 --- a/dll/win32/vbscript/CMakeLists.txt +++ b/dll/win32/vbscript/CMakeLists.txt @@ -39,6 +39,11 @@ add_library(vbscript MODULE vbscript.rc ${CMAKE_CURRENT_BINARY_DIR}/vbscript.def) +if(MSVC) + # Disable warning C4267: '=': conversion from 'size_t' to 'WCHAR', possible loss of data + target_compile_options(vbscript PRIVATE /wd4267) +endif() + set_module_type(vbscript win32dll) target_link_libraries(vbscript uuid wine) add_importlibs(vbscript oleaut32 ole32 user32 msvcrt kernel32 ntdll) diff --git a/dll/win32/windowscodecs/CMakeLists.txt b/dll/win32/windowscodecs/CMakeLists.txt index 316fd1f329b..d4fc4b281b2 100644 --- a/dll/win32/windowscodecs/CMakeLists.txt +++ b/dll/win32/windowscodecs/CMakeLists.txt @@ -71,8 +71,9 @@ add_library(windowscodecs MODULE ${CMAKE_CURRENT_BINARY_DIR}/windowscodecs.def) if(MSVC) - # error C4133: 'function': incompatible types - from 'WICPixelFormatNumericRepresentation *' to 'DWORD *' - remove_target_compile_option(windowscodecs "/we4133") + # Disable warning C4133: 'function': incompatible types - from 'WICPixelFormatNumericRepresentation *' to 'DWORD *' + # Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned + target_compile_options(windowscodecs PRIVATE /wd4133 /wd4146) target_compile_options(windowscodecs PRIVATE /FItypeof.h) endif() diff --git a/dll/win32/wininet/CMakeLists.txt b/dll/win32/wininet/CMakeLists.txt index eb4b9d12992..6b041deb423 100644 --- a/dll/win32/wininet/CMakeLists.txt +++ b/dll/win32/wininet/CMakeLists.txt @@ -39,6 +39,11 @@ add_library(wininet MODULE rsrc.rc ${CMAKE_CURRENT_BINARY_DIR}/wininet.def) +if(MSVC) + # Disable warning C4090: 'function': different 'const' qualifiers + target_compile_options(wininet PRIVATE /wd4090) +endif() + set_module_type(wininet win32dll) target_link_libraries(wininet wine ${PSEH_LIB} oldnames) diff --git a/dll/win32/winmm/CMakeLists.txt b/dll/win32/winmm/CMakeLists.txt index d6bc6b7f478..f6943f915b4 100644 --- a/dll/win32/winmm/CMakeLists.txt +++ b/dll/win32/winmm/CMakeLists.txt @@ -23,8 +23,9 @@ add_library(winmm MODULE if(MSVC) - # error C4312: 'type cast': conversion from 'DWORD' to 'HTASK' of greater size - remove_target_compile_option(winmm "/we4312") + # Disable warning C4090: 'function': different 'const' qualifiers + # Disable warning C4312: 'type cast': conversion from 'DWORD' to 'HTASK' of greater size + target_compile_options(winmm PRIVATE /wd4090 /wd4312) endif() set_module_type(winmm win32dll) diff --git a/dll/win32/wintrust/CMakeLists.txt b/dll/win32/wintrust/CMakeLists.txt index d47599c97a2..c6ee5b01338 100644 --- a/dll/win32/wintrust/CMakeLists.txt +++ b/dll/win32/wintrust/CMakeLists.txt @@ -17,6 +17,11 @@ add_library(wintrust MODULE version.rc ${CMAKE_CURRENT_BINARY_DIR}/wintrust.def) +if(MSVC) + # Disable warning C4090: 'function': different 'const' qualifiers + target_compile_options(wintrust PRIVATE /wd4090) +endif() + set_module_type(wintrust win32dll) target_link_libraries(wintrust wine ${PSEH_LIB}) # FIXME: imagehlp should be delay-imported. See CORE-6504 diff --git a/dll/win32/xmllite/CMakeLists.txt b/dll/win32/xmllite/CMakeLists.txt index 19ebd3879ef..8d432444ec4 100644 --- a/dll/win32/xmllite/CMakeLists.txt +++ b/dll/win32/xmllite/CMakeLists.txt @@ -15,6 +15,11 @@ add_library(xmllite MODULE guid.c ${CMAKE_CURRENT_BINARY_DIR}/xmllite.def) +if(MSVC) + # Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned + target_compile_options(xmllite PRIVATE /wd4146) +endif() + set_module_type(xmllite win32dll) target_link_libraries(xmllite uuid wine) add_importlibs(xmllite msvcrt kernel32 ntdll) diff --git a/drivers/bluetooth/fbtusb/CMakeLists.txt b/drivers/bluetooth/fbtusb/CMakeLists.txt index 7de68e74752..8358c974d79 100644 --- a/drivers/bluetooth/fbtusb/CMakeLists.txt +++ b/drivers/bluetooth/fbtusb/CMakeLists.txt @@ -16,6 +16,11 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU") target_compile_options(fbtusb PRIVATE -Wno-unused-but-set-variable) endif() +if(MSVC) + # Disable warning C4267: '=': conversion from 'size_t' to 'USHORT', possible loss of data + target_compile_options(fbtusb PRIVATE /wd4267) +endif() + set_module_type(fbtusb kernelmodedriver) add_importlibs(fbtusb ntoskrnl hal usbd) add_pch(fbtusb precomp.h SOURCE) diff --git a/drivers/filesystems/btrfs/CMakeLists.txt b/drivers/filesystems/btrfs/CMakeLists.txt index 0fd490853ca..e7427fd8e4a 100644 --- a/drivers/filesystems/btrfs/CMakeLists.txt +++ b/drivers/filesystems/btrfs/CMakeLists.txt @@ -65,6 +65,11 @@ add_asm_files(btrfs_asm ${ASM_SOURCE}) add_library(btrfs MODULE ${SOURCE} ${btrfs_asm} btrfs.rc) +if(MSVC) + # Disable warning C4267: 'function': conversion from 'size_t' to 'uint16_t', possible loss of data + target_compile_options(btrfs PRIVATE /wd4267) +endif() + add_definitions(-D__KERNEL__) set_module_type(btrfs kernelmodedriver) target_link_libraries(btrfs rtlver zlib_solo chkstk wdmguid ${PSEH_LIB}) diff --git a/drivers/filesystems/ext2/CMakeLists.txt b/drivers/filesystems/ext2/CMakeLists.txt index 06c51e756c3..b948b50c9b5 100644 --- a/drivers/filesystems/ext2/CMakeLists.txt +++ b/drivers/filesystems/ext2/CMakeLists.txt @@ -93,11 +93,11 @@ if(USE_CLANG_CL) endif() if(MSVC) - # Disable warnings: "unreferenced local variable", "initialized, but not used variable", "benign include" if (NOT CLANG) - remove_target_compile_option(ext2fs "/we4101") - remove_target_compile_option(ext2fs "/we4189") - target_compile_options(ext2fs PRIVATE /wd4189 /wd4142 /wd4101) + # Disable warning C4101: 'i': unreferenced local variable + # Disable warning C4189: 'sbi': local variable is initialized but not referenced + # Disable warning C4267: '=': conversion from 'size_t' to 'USHORT', possible loss of data + target_compile_options(ext2fs PRIVATE /wd4101 /wd4189 /wd4267) endif() else() target_compile_options(ext2fs PRIVATE diff --git a/drivers/storage/ide/uniata/CMakeLists.txt b/drivers/storage/ide/uniata/CMakeLists.txt index c172d96ac54..6b9cdcff5e9 100644 --- a/drivers/storage/ide/uniata/CMakeLists.txt +++ b/drivers/storage/ide/uniata/CMakeLists.txt @@ -28,6 +28,12 @@ if(USE_CLANG_CL OR (NOT MSVC)) endif() endif() +if(MSVC) + # Disable warning C4267: '=': conversion from 'size_t' to 'USHORT', possible loss of data + # Disable warning C4838: conversion from 'int' to 'ULONG' requires a narrowing conversion + target_compile_options(uniata PRIVATE /wd4267 /wd4838) +endif() + if(CMAKE_C_COMPILER_ID STREQUAL "GNU") target_compile_options(uniata PRIVATE -Wno-unused-but-set-variable) endif() diff --git a/modules/rostests/winetests/riched20/CMakeLists.txt b/modules/rostests/winetests/riched20/CMakeLists.txt index fe220a495ba..15c730ab8d0 100644 --- a/modules/rostests/winetests/riched20/CMakeLists.txt +++ b/modules/rostests/winetests/riched20/CMakeLists.txt @@ -7,10 +7,6 @@ list(APPEND SOURCE testlist.c txtsrv.c) -if(MSVC) - set_property(SOURCE editor.c APPEND_STRING PROPERTY COMPILE_FLAGS " /w14189") -endif() - add_executable(riched20_winetest ${SOURCE}) set_module_type(riched20_winetest win32cui) add_importlibs(riched20_winetest ole32 oleaut32 user32 gdi32 msvcrt kernel32) diff --git a/sdk/lib/fslib/ext2lib/CMakeLists.txt b/sdk/lib/fslib/ext2lib/CMakeLists.txt index 103760b751b..72b39211d1b 100644 --- a/sdk/lib/fslib/ext2lib/CMakeLists.txt +++ b/sdk/lib/fslib/ext2lib/CMakeLists.txt @@ -14,3 +14,8 @@ list(APPEND SOURCE add_library(ext2lib ${SOURCE}) add_pch(ext2lib Mke2fs.h SOURCE) add_dependencies(ext2lib psdk) + +if(MSVC) + # Disable warning C4267: '=': conversion from 'size_t' to '__u8', possible loss of data + target_compile_options(ext2lib PRIVATE /wd4267) +endif()
3 years, 5 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
15
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Results per page:
10
25
50
100
200