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
March 2019
----- 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
36 participants
217 discussions
Start a n
N
ew thread
[reactos] 01/01: [LOG2LINES] Add a TODO, Use a snprintf()
by Serge Gautherie
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=29c9e92c9e6741e55a9c6…
commit 29c9e92c9e6741e55a9c65ddf6777b8d9c671451 Author: Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr> AuthorDate: Wed Jan 16 17:46:27 2019 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sat Mar 16 11:22:58 2019 +0100 [LOG2LINES] Add a TODO, Use a snprintf() Addendum to c5d8d8d. --- sdk/tools/log2lines/log2lines.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/tools/log2lines/log2lines.c b/sdk/tools/log2lines/log2lines.c index 4ee66bb5c9..b5ff009c38 100644 --- a/sdk/tools/log2lines/log2lines.c +++ b/sdk/tools/log2lines/log2lines.c @@ -637,6 +637,7 @@ main(int argc, const char **argv) char PathBuffer[LINESIZE + 1]; char LineOutBuffer[LINESIZE + 1]; + // TODO: Re-use one translate_files(), instead of repeated translate_line(). while (i < argc) { offset = argv[optCount + i++]; @@ -646,7 +647,7 @@ main(int argc, const char **argv) { l2l_dbg(2, "translating %s %s\n", exefile, offset); - sprintf(Line, "<%s:%s>\n", exefile, offset); + snprintf(Line, LINESIZE, "<%s:%s>\n", exefile, offset); translate_line(conOut, Line, PathBuffer, LineOutBuffer); report(conOut); }
5 years, 9 months
1
0
0
0
[reactos] 01/01: [SYSDM] Update SMBIOS parsing code
by Stanislav Motylkov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=62595d39a6a8dc1da2ee5…
commit 62595d39a6a8dc1da2ee5517634a87bb0524cffb Author: Stanislav Motylkov <x86corez(a)gmail.com> AuthorDate: Thu Mar 7 03:33:39 2019 +0300 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sat Mar 16 11:16:55 2019 +0100 [SYSDM] Update SMBIOS parsing code --- dll/cpl/sysdm/smbios.c | 284 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 237 insertions(+), 47 deletions(-) diff --git a/dll/cpl/sysdm/smbios.c b/dll/cpl/sysdm/smbios.c index d7d49976ee..663c6d3b84 100644 --- a/dll/cpl/sysdm/smbios.c +++ b/dll/cpl/sysdm/smbios.c @@ -3,7 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: dll/cpl/sysdm/smbios.c * PURPOSE: Retrieve device or motherboard name identifier from DMI/SMBIOS - * COPYRIGHT: Copyright 2018 Stanislav Motylkov <x86corez(a)gmail.com> + * COPYRIGHT: Copyright 2018-2019 Stanislav Motylkov <x86corez(a)gmail.com> * */ @@ -16,6 +16,7 @@ typedef struct GENERIC_NAME { PCWSTR pwName; BOOL bCaseSensitive; + BOOL bRemove; } GENERIC_NAME; typedef struct VENDOR_LONG_NAME @@ -139,6 +140,12 @@ wchar_t * wcsistr_plus(const wchar_t *s, wchar_t *b) { b[0] = L')'; result = wcsistr(s, b); + if (!result && wcschr(s, L'.')) + { + b[len - 1] = L'.'; + result = wcsistr(s, b); + b[len - 1] = L' '; + } b[0] = L' '; } return result; @@ -226,45 +233,92 @@ freeStr: } static -BOOL IsGenericSystemName(PCWSTR ven, PCWSTR dev) +BOOL IsGenericSystemName(PCWSTR ven, PCWSTR dev, BOOL * bRemove) { static const GENERIC_NAME Vendors[] = { - { L"To Be Filled By O.E.M.", FALSE }, // some ASUS boards - { L"System manufacturer", TRUE }, // some ASUS boards - { L"Default string", TRUE }, // some Gigabyte boards - { L"LTD Delovoy Office", TRUE }, // some Gigabyte boards - { L"O.E.M", TRUE }, // some AMD boards - { L"DEPO Computers", TRUE }, // various boards + // some ASUS boards + { L"To Be Filled By O.E.M.", FALSE, TRUE }, + { L"To Be Filled By O.E.M", FALSE, TRUE }, + { L"System manufacturer", FALSE, TRUE }, + // some Gigabyte boards + { L"Default string", TRUE, TRUE }, + { L"LTD Delovoy Office", TRUE, FALSE }, + { L"Motherboard by ZOTAC", TRUE, FALSE }, + // various boards + { L"Type2 - Board Vendor Name1", TRUE, TRUE }, + { L"DEPO Computers", TRUE, FALSE }, + { L"-", TRUE, TRUE }, + { L"OEM", TRUE, TRUE }, + { L"O.E.M", TRUE, TRUE }, + { L"Unknow", TRUE, TRUE }, + // distinguish between Oracle and older VirtualBox releases (Sun, etc.) + { L"innotek GmbH", TRUE, FALSE }, }; static const GENERIC_NAME Devices[] = { - { L"To Be Filled By O.E.M.", FALSE }, // some ASUS boards - { L"All Series", TRUE }, // some ASUS boards - { L"System Product Name", TRUE }, // some ASUS boards - { L"Default string", TRUE }, // some Gigabyte boards - { L"Please change product name", TRUE }, // some MSI boards - { L"Computer", TRUE }, // some Intel boards - { L"ChiefRiver Platform", TRUE }, // some Intel boards - { L"SharkBay Platform", TRUE }, // some Intel boards - { L"HuronRiver Platform", TRUE }, // some Intel boards - { L"SandyBridge Platform", TRUE }, // some Intel boards - { L"Broadwell Platform", TRUE }, // some LG boards - { L"Sabine Platform", TRUE }, // some AMD boards - { L"O.E.M", TRUE }, // some AMD boards - { L"*", TRUE }, // various boards - { L"GEG", TRUE }, // various boards - { L"OEM", TRUE }, // various boards - { L"DEPO Computers", TRUE }, // various boards - { L"Aquarius Pro, Std, Elt Series", TRUE }, // some Foxconn boards - { L"Aquarius Server", TRUE }, // some ASUS server boards - { L"Aquarius Server G2", TRUE }, // some ASUS server boards - { L"Super Server", TRUE }, // some Supermicro server boards - { L"POSITIVO MOBILE", FALSE }, // some Positivo devices + // some ASUS boards + { L"To Be Filled By O.E.M.", FALSE, TRUE }, + { L"To Be Filled By O.E.M", FALSE, TRUE }, + { L"All Series", TRUE, TRUE }, + { L"System Product Name", TRUE, TRUE }, + { L"System Name", TRUE, TRUE }, + // some Gigabyte boards + { L"Default string", TRUE, TRUE }, + // some MSI boards + { L"Please change product name", TRUE, TRUE }, + // some Intel boards + { L"Computer", TRUE, TRUE }, + { L"ChiefRiver Platform", TRUE, FALSE }, + { L"OakTrail Platform", TRUE, FALSE }, + { L"SharkBay Platform", TRUE, FALSE }, + { L"HuronRiver Platform", TRUE, FALSE }, + { L"SandyBridge Platform", TRUE, FALSE }, + { L"Broadwell Platform", TRUE, FALSE }, + { L"Sabine Platform", TRUE, FALSE }, + // various boards + { L"Base Board Product Name", TRUE, TRUE }, + { L"Base Board Version", TRUE, TRUE }, + { L"Type2 - Board Product Name1", TRUE, TRUE }, + { L"Type2 - Board Version", TRUE, TRUE }, + { L"*", TRUE, TRUE }, + { L"T", TRUE, TRUE }, + { L"GEG", TRUE, TRUE }, + { L"N/A", TRUE, TRUE }, + { L"---", TRUE, TRUE }, + { L"OEM", TRUE, TRUE }, + { L"INVA", TRUE, TRUE }, + { L"O.E.M", TRUE, TRUE }, + { L"DNSNB", TRUE, FALSE }, + { L"12345", TRUE, FALSE }, + { L"``````", TRUE, TRUE }, + { L"Uknown", TRUE, TRUE }, + { L"Desktop", FALSE, TRUE }, + { L"Invalid", FALSE, TRUE }, + { L"Reserved", TRUE, TRUE }, + { L"HaierComputer", TRUE, FALSE }, + { L"DEPO Computers", TRUE, FALSE }, + { L"InsydeH2O EFI BIOS", TRUE, TRUE }, + { L"HP All-in-One", TRUE, FALSE }, + { L"MP Server", TRUE, FALSE }, + { L"0000000000", TRUE, TRUE }, + // some Foxconn boards + { L"Aquarius Pro, Std, Elt Series", TRUE, FALSE }, + // some ASUS server boards + { L"Aquarius Server", TRUE, FALSE }, + { L"Aquarius Server G2", TRUE, FALSE }, + // some Supermicro server boards + { L"Super Server", TRUE, FALSE }, + // some Positivo devices + { L"POSITIVO MOBILE", FALSE, FALSE }, }; BOOL bMatch; UINT i; + if (bRemove) + { + *bRemove = FALSE; + } for (i = 0; i < _countof(Vendors); i++) { if (!ven) @@ -281,6 +335,10 @@ BOOL IsGenericSystemName(PCWSTR ven, PCWSTR dev) } if (bMatch) { + if (bRemove) + { + *bRemove = Vendors[i].bRemove; + } return TRUE; } } @@ -301,6 +359,10 @@ BOOL IsGenericSystemName(PCWSTR ven, PCWSTR dev) } if (bMatch) { + if (bRemove) + { + *bRemove = Devices[i].bRemove; + } return TRUE; } } @@ -313,11 +375,13 @@ void AppendSystemFamily(PWSTR pBuf, SIZE_T cchBuf, PCHAR * DmiStrings, PWSTR dev static const PCSTR KnownFamilies[] = { "Eee PC", // ASUS + "ThinkPad", // Lenovo "IdeaPad", // Lenovo "IdeaCentre", // Lenovo }; static const PCWSTR Aliases[] = { + NULL, NULL, NULL, L"IdeaCenter", @@ -343,6 +407,29 @@ void AppendSystemFamily(PWSTR pBuf, SIZE_T cchBuf, PCHAR * DmiStrings, PWSTR dev } } +static +BOOL TrimNonPrintable(PCHAR DmiString) +{ + PCHAR c = DmiString; + if (!c) + { + return FALSE; + } + while (*c) + { + if (*c >= 0x20 && *c <= 0x7e) + { + c++; + } + else + { + *c = 0; + return TRUE; + } + } + return FALSE; +} + BOOL GetSystemName(PWSTR pBuf, SIZE_T cchBuf) { static const VENDOR_LONG_NAME LongNames[] = @@ -353,16 +440,24 @@ BOOL GetSystemName(PWSTR pBuf, SIZE_T cchBuf) { L"MICRO-STAR", L"MSI" }, { L"
SGI.COM
", L"SGI" }, { L"Silicon Graphics International", L"SGI" }, + { L"Intel(R) Client Systems", L"Intel" }, { L"InformationComputerSystems", L"ICS" }, { L"CHUWI INNOVATION AND TECHNOLOGY", L"CHUWI" }, { L"
http://www.abit.com.tw/
", L"ABIT" }, { L"
www.abit.com.tw
", L"ABIT" }, + { L"CASPER BILGISAYAR SISTEMLERI A.S", L"Casper" }, { L"Colorful Technology And Development", L"Colorful" }, + { L"Colorful Yu Gong Technology And Development", L"Colorful Yu Gong" }, { L"HaierComputer", L"Haier" }, + { L"HELIOS BUSINESS COMPUTER", L"HELIOS" }, + { L"Shanghai Zongzhi InfoTech", L"Zongzhi" }, + { L"TSING HUA TONGFANG CO.,LTD", L"TSINGHUA TONGFANG" }, + { L"Yeston Digital Technology Co.,LTD", L"Yeston" }, }; static const REDUNDANT_WORD RedundantWords[] = { { L"Corporation", FALSE }, + { L"Communication", FALSE }, { L"Computer", FALSE }, { L"Computers", FALSE }, { L"Group", FALSE }, @@ -374,13 +469,17 @@ BOOL GetSystemName(PWSTR pBuf, SIZE_T cchBuf) { L"Electronics", FALSE }, { L"Electric", FALSE }, { L"Software", FALSE }, + { L"Foundation", FALSE }, { L"International", FALSE }, { L"Interantonal", FALSE }, // on purpose (some MSI boards) + { L"INTERANTIONAL", FALSE }, // on purpose (some MSI boards) { L"Industrial", FALSE }, { L"Information", FALSE }, + { L"Informatica", FALSE }, { L"Technology", FALSE }, { L"Tecohnology", FALSE }, // on purpose (some Gigabyte boards) { L"Technologies", FALSE }, + { L"Tecnologia", FALSE }, { L"Limited", FALSE }, { L"Int", FALSE }, { L"Inc", FALSE }, @@ -388,9 +487,13 @@ BOOL GetSystemName(PWSTR pBuf, SIZE_T cchBuf) { L"Corp", FALSE }, { L"Crop", FALSE }, { L"Ltd", FALSE }, + { L"LTDA", FALSE }, { L"GmbH", FALSE }, { L"S.p.A", FALSE }, + { L"A.S.", FALSE }, { L"S.A", FALSE }, + { L"S.A.S", FALSE }, + { L"S/A", FALSE }, { L"SA", FALSE }, { L"SAS", FALSE }, { L"BV", FALSE }, @@ -403,7 +506,8 @@ BOOL GetSystemName(PWSTR pBuf, SIZE_T cchBuf) PVOID SMBiosBuf; PCHAR DmiStrings[ID_STRINGS_MAX] = { 0 }; WCHAR ven[512], dev[512]; - BOOL bGenericName; + CHAR tmpstr[512]; + BOOL bTrimProduct, bTrimFamily, bGenericName, bRemove; UINT i; PWCHAR j; @@ -413,40 +517,80 @@ BOOL GetSystemName(PWSTR pBuf, SIZE_T cchBuf) return FALSE; } + TrimNonPrintable(DmiStrings[SYS_VENDOR]); + bTrimProduct = TrimNonPrintable(DmiStrings[SYS_PRODUCT]); + TrimNonPrintable(DmiStrings[SYS_VERSION]); + bTrimFamily = TrimNonPrintable(DmiStrings[SYS_FAMILY]); + TrimNonPrintable(DmiStrings[BOARD_VENDOR]); + TrimNonPrintable(DmiStrings[BOARD_NAME]); + TrimNonPrintable(DmiStrings[BOARD_VERSION]); + + if (bTrimProduct) + { + if (DmiStrings[SYS_FAMILY] && !bTrimFamily) + { + DmiStrings[SYS_PRODUCT] = DmiStrings[SYS_FAMILY]; + bTrimProduct = FALSE; + } + } + GetSMBiosStringW(DmiStrings[SYS_VENDOR], ven, _countof(ven), TRUE); GetSMBiosStringW(DmiStrings[SYS_PRODUCT], dev, _countof(dev), TRUE); - bGenericName = IsGenericSystemName(ven, dev); + bGenericName = IsGenericSystemName(ven, dev, NULL) || bTrimProduct; if (wcslen(dev) == 0 || !wcscmp(dev, ven) || bGenericName) { + BOOL bGenericVen = FALSE, bGenericDev = (wcslen(dev) == 0 || !wcscmp(dev, ven) || bTrimProduct); + + if (bGenericName && IsGenericSystemName(ven, NULL, &bRemove)) + { + if (bRemove) + { + *ven = 0; + } + bGenericVen = TRUE; + } + if (bGenericName && IsGenericSystemName(NULL, dev, &bRemove)) + { + if (bRemove) + { + *dev = 0; + } + bGenericDev = TRUE; + } // system strings are unusable, use board strings if (DmiStrings[BOARD_VENDOR] != NULL || !bGenericName) { if ((DmiStrings[BOARD_VENDOR] && strlen(DmiStrings[BOARD_VENDOR]) >= 2 && strstr(DmiStrings[BOARD_VENDOR], " ") != DmiStrings[BOARD_VENDOR]) || - IsGenericSystemName(ven, NULL)) + bGenericVen) { GetSMBiosStringW(DmiStrings[BOARD_VENDOR], ven, _countof(ven), TRUE); } GetSMBiosStringW(DmiStrings[BOARD_NAME], dev, _countof(dev), TRUE); - if (IsGenericSystemName(ven, NULL)) + if (IsGenericSystemName(ven, NULL, &bRemove) && bRemove) { *ven = 0; } - if (IsGenericSystemName(NULL, dev)) + if (IsGenericSystemName(NULL, dev, &bRemove) && bRemove) { *dev = 0; + + if (!bGenericDev) + { + GetSMBiosStringW(DmiStrings[SYS_PRODUCT], dev, _countof(dev), TRUE); + } } if (wcslen(dev) == 0 && DmiStrings[SYS_VERSION] != NULL) { GetSMBiosStringW(DmiStrings[SYS_VERSION], dev, _countof(dev), TRUE); - if (IsGenericSystemName(NULL, dev)) + if (IsGenericSystemName(NULL, dev, &bRemove) && bRemove) { *dev = 0; } @@ -456,7 +600,7 @@ BOOL GetSystemName(PWSTR pBuf, SIZE_T cchBuf) { GetSMBiosStringW(DmiStrings[BOARD_VERSION], dev, _countof(dev), TRUE); - if (IsGenericSystemName(NULL, dev)) + if (IsGenericSystemName(NULL, dev, &bRemove) && bRemove) { *dev = 0; } @@ -475,7 +619,7 @@ BOOL GetSystemName(PWSTR pBuf, SIZE_T cchBuf) { GetSMBiosStringW(DmiStrings[BOARD_VENDOR], ven, _countof(ven), TRUE); - if (IsGenericSystemName(ven, NULL)) + if (IsGenericSystemName(ven, NULL, &bRemove) && bRemove) { *ven = 0; } @@ -495,6 +639,13 @@ BOOL GetSystemName(PWSTR pBuf, SIZE_T cchBuf) // make vendor strings shorter for (i = 0; i < _countof(LongNames); i++) { + if (wcsstr(dev, LongNames[i].pwLongName) == dev) + { + // swap ven and dev + StringCchCopyW(pBuf, cchBuf, ven); + StringCchCopyW(ven, _countof(ven), dev); + StringCchCopyW(dev, _countof(dev), pBuf); + } wcsrep(ven, LongNames[i].pwLongName, LongNames[i].pwShortName, TRUE); } @@ -511,15 +662,40 @@ BOOL GetSystemName(PWSTR pBuf, SIZE_T cchBuf) } // workaround for LENOVO notebooks - if (!wcscmp(ven, L"LENOVO")) + if (!wcsicmp(ven, L"LENOVO")) { StringCchCopyW(ven, _countof(ven), L"Lenovo"); + if (DmiStrings[SYS_VERSION] != NULL) + { + if (!strncmp(DmiStrings[SYS_VERSION], "ThinkPad ", 11)) + { + DmiStrings[SYS_VERSION][8] = L'\0'; + } + if (wcslen(dev) > 0 && + (!strcmp(DmiStrings[SYS_VERSION], "IdeaCentre") || + !strcmp(DmiStrings[SYS_VERSION], "ThinkPad"))) + { + DmiStrings[SYS_FAMILY] = DmiStrings[SYS_VERSION]; + DmiStrings[SYS_VERSION] = NULL; + } + else + { + StringCchCopyA(tmpstr, _countof(tmpstr), DmiStrings[SYS_VERSION]); + _strupr(tmpstr); + } + } + if (DmiStrings[SYS_VERSION] != NULL && - stricmp(DmiStrings[SYS_VERSION], "Lenovo") && - stricmp(DmiStrings[SYS_VERSION], "Lenovo Product") && - stricmp(DmiStrings[SYS_VERSION], " ") && - _strnicmp(DmiStrings[SYS_VERSION], " ", 3) && + strcmp(tmpstr, " ") && + strcmp(tmpstr, "LENOVO") && + strstr(tmpstr, "LENOVO ") == NULL && + strstr(tmpstr, "LENOVO PRODUCT") == NULL && + strstr(tmpstr, "INVALID") == NULL && + strncmp(tmpstr, " ", 3) && + strstr(DmiStrings[SYS_VERSION], "Rev ") == NULL && + strstr(DmiStrings[SYS_VERSION], "1.") == NULL && + wcsistr(dev, L"System ") == NULL && // includes System x and ThinkSystem wcsistr(dev, L"IdeaPad ") == NULL && wcsistr(dev, L"ThinkServer ") == NULL) { @@ -539,7 +715,8 @@ BOOL GetSystemName(PWSTR pBuf, SIZE_T cchBuf) } if (!wcscmp(ven, L"IBM") && DmiStrings[SYS_VERSION] != NULL && - strstr(DmiStrings[SYS_VERSION], "ThinkPad ") != NULL) + (strstr(DmiStrings[SYS_VERSION], "ThinkPad ") != NULL || + strstr(DmiStrings[SYS_VERSION], "ThinkCentre ") != NULL)) { GetSMBiosStringW(DmiStrings[SYS_VERSION], dev, _countof(dev), TRUE); } @@ -548,8 +725,10 @@ BOOL GetSystemName(PWSTR pBuf, SIZE_T cchBuf) if (!wcscmp(ven, L"DEXP")) { if (DmiStrings[SYS_PRODUCT] != NULL && - !stricmp(DmiStrings[SYS_PRODUCT], "Tablet PC") && - DmiStrings[SYS_VERSION] != NULL) + DmiStrings[SYS_VERSION] != NULL && + (!stricmp(DmiStrings[SYS_PRODUCT], "Tablet PC") || + !stricmp(DmiStrings[SYS_PRODUCT], "Notebook") || + !stricmp(DmiStrings[SYS_PRODUCT], "Decktop"))) { GetSMBiosStringW(DmiStrings[SYS_VERSION], dev, _countof(dev), TRUE); } @@ -585,13 +764,24 @@ BOOL GetSystemName(PWSTR pBuf, SIZE_T cchBuf) if (wcsistr(dev, ven) == dev || (!wcscmp(ven, L"ASUS") && wcsstr(dev, L"ASUS") != NULL) || - (!wcscmp(ven, L"HP") && wcsstr(dev, L" by HP") != NULL)) + (!wcscmp(ven, L"HP") && wcsstr(dev, L" by HP") != NULL) || + (!wcscmp(ven, L"INTEL") && wcsstr(dev, L" INTEL") != NULL)) { // device string contains vendor string, use second only StringCchCopyW(pBuf, cchBuf, dev); } else { + if (wcslen(ven) > 0 && wcslen(dev) > 0 && (j = wcschr(dev, L' '))) + { + // check if vendor string ends with first word of device string + i = j - dev; + if (wcslen(ven) > i && !_wcsnicmp(ven + wcslen(ven) - i, dev, i)) + { + ven[wcslen(ven) - i] = L'\0'; + TrimPunctuation(ven); + } + } StringCchCopyW(pBuf, cchBuf, ven); AppendSystemFamily(pBuf, cchBuf, DmiStrings, dev); if (wcslen(pBuf) > 0 && wcslen(dev) > 0)
5 years, 9 months
1
0
0
0
[reactos] 01/01: [USERENV] Use a reference counter when loading and unloading profiles. Unload the hive only when the reference counter reaches 0. This fixes the remaining bugs in "userenv_apitest LoadUserProfile".
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7d28dfd1848e83be05b3e…
commit 7d28dfd1848e83be05b3ec06cb5151fb4b8e017f Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sat Mar 16 07:45:30 2019 +0100 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sat Mar 16 07:45:30 2019 +0100 [USERENV] Use a reference counter when loading and unloading profiles. Unload the hive only when the reference counter reaches 0. This fixes the remaining bugs in "userenv_apitest LoadUserProfile". --- dll/win32/userenv/profile.c | 225 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 199 insertions(+), 26 deletions(-) diff --git a/dll/win32/userenv/profile.c b/dll/win32/userenv/profile.c index 6b4635ba06..1c18a67ab6 100644 --- a/dll/win32/userenv/profile.c +++ b/dll/win32/userenv/profile.c @@ -197,6 +197,157 @@ CreateProfileMutex( } +static +DWORD +IncrementRefCount( + PWSTR pszSidString, + PDWORD pdwRefCount) +{ + HKEY hProfilesKey = NULL, hProfileKey = NULL; + DWORD dwRefCount = 0, dwLength, dwType; + DWORD dwError; + + DPRINT1("IncrementRefCount(%S %p)\n", + pszSidString, pdwRefCount); + + dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList", + 0, + KEY_QUERY_VALUE, + &hProfilesKey); + if (dwError != ERROR_SUCCESS) + { + DPRINT1("Error: %lu\n", dwError); + goto done; + } + + dwError = RegOpenKeyExW(hProfilesKey, + pszSidString, + 0, + KEY_QUERY_VALUE | KEY_SET_VALUE, + &hProfileKey); + if (dwError != ERROR_SUCCESS) + { + DPRINT1("Error: %lu\n", dwError); + goto done; + } + + /* Get the reference counter */ + dwLength = sizeof(dwRefCount); + RegQueryValueExW(hProfileKey, + L"RefCount", + NULL, + &dwType, + (PBYTE)&dwRefCount, + &dwLength); + + dwRefCount++; + + dwLength = sizeof(dwRefCount); + dwError = RegSetValueExW(hProfileKey, + L"RefCount", + 0, + REG_DWORD, + (PBYTE)&dwRefCount, + dwLength); + if (dwError != ERROR_SUCCESS) + { + DPRINT1("Error: %lu\n", dwError); + goto done; + } + + if (pdwRefCount != NULL) + *pdwRefCount = dwRefCount; + +done: + if (hProfileKey != NULL) + RegCloseKey(hProfileKey); + + if (hProfilesKey != NULL) + RegCloseKey(hProfilesKey); + + return dwError; +} + + +static +DWORD +DecrementRefCount( + PWSTR pszSidString, + PDWORD pdwRefCount) +{ + HKEY hProfilesKey = NULL, hProfileKey = NULL; + DWORD dwRefCount = 0, dwLength, dwType; + DWORD dwError; + + DPRINT1("DecrementRefCount(%S %p)\n", + pszSidString, pdwRefCount); + + dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList", + 0, + KEY_QUERY_VALUE, + &hProfilesKey); + if (dwError != ERROR_SUCCESS) + { + DPRINT1("Error: %lu\n", dwError); + goto done; + } + + dwError = RegOpenKeyExW(hProfilesKey, + pszSidString, + 0, + KEY_QUERY_VALUE | KEY_SET_VALUE, + &hProfileKey); + if (dwError != ERROR_SUCCESS) + { + DPRINT1("Error: %lu\n", dwError); + goto done; + } + + /* Get the reference counter */ + dwLength = sizeof(dwRefCount); + dwError = RegQueryValueExW(hProfileKey, + L"RefCount", + NULL, + &dwType, + (PBYTE)&dwRefCount, + &dwLength); + if (dwError != ERROR_SUCCESS) + { + DPRINT1("Error: %lu\n", dwError); + goto done; + } + + dwRefCount--; + + dwLength = sizeof(dwRefCount); + dwError = RegSetValueExW(hProfileKey, + L"RefCount", + 0, + REG_DWORD, + (PBYTE)&dwRefCount, + dwLength); + if (dwError != ERROR_SUCCESS) + { + DPRINT1("Error: %lu\n", dwError); + goto done; + } + + if (pdwRefCount != NULL) + *pdwRefCount = dwRefCount; + +done: + if (hProfileKey != NULL) + RegCloseKey(hProfileKey); + + if (hProfilesKey != NULL) + RegCloseKey(hProfilesKey); + + return dwError; +} + + /* PUBLIC FUNCTIONS ********************************************************/ BOOL @@ -1613,6 +1764,14 @@ LoadUserProfileW( goto cleanup; } + Error = IncrementRefCount(SidString.Buffer, NULL); + if (Error != ERROR_SUCCESS) + { + DPRINT1("IncrementRefCount() failed (Error %ld)\n", Error); + SetLastError((DWORD)Error); + goto cleanup; + } + ret = TRUE; cleanup: @@ -1640,6 +1799,7 @@ UnloadUserProfile( { UNICODE_STRING SidString = {0, 0, NULL}; HANDLE hProfileMutex = NULL; + DWORD dwRefCount = 0; LONG Error; BOOL bRet = FALSE; @@ -1675,44 +1835,57 @@ UnloadUserProfile( /* Close the profile handle */ RegCloseKey(hProfile); - /* Acquire restore privilege */ - if (!AcquireRemoveRestorePrivilege(TRUE)) + Error = DecrementRefCount(SidString.Buffer, &dwRefCount); + if (Error != ERROR_SUCCESS) { - DPRINT1("AcquireRemoveRestorePrivilege() failed (Error %ld)\n", GetLastError()); + DPRINT1("DecrementRefCount() failed (Error %ld)\n", Error); + SetLastError((DWORD)Error); goto cleanup; } - /* HACK */ + if (dwRefCount == 0) { - HKEY hUserKey; + DPRINT1("RefCount is 0: Unload the Hive!\n"); - Error = RegOpenKeyExW(HKEY_USERS, - SidString.Buffer, - 0, - KEY_WRITE, - &hUserKey); - if (Error == ERROR_SUCCESS) + /* Acquire restore privilege */ + if (!AcquireRemoveRestorePrivilege(TRUE)) { - RegDeleteKeyW(hUserKey, - L"Volatile Environment"); + DPRINT1("AcquireRemoveRestorePrivilege() failed (Error %ld)\n", GetLastError()); + goto cleanup; + } + + /* HACK */ + { + HKEY hUserKey; + + Error = RegOpenKeyExW(HKEY_USERS, + SidString.Buffer, + 0, + KEY_WRITE, + &hUserKey); + if (Error == ERROR_SUCCESS) + { + RegDeleteKeyW(hUserKey, + L"Volatile Environment"); - RegCloseKey(hUserKey); + RegCloseKey(hUserKey); + } } - } - /* End of HACK */ + /* End of HACK */ - /* Unload the hive */ - Error = RegUnLoadKeyW(HKEY_USERS, - SidString.Buffer); + /* Unload the hive */ + Error = RegUnLoadKeyW(HKEY_USERS, + SidString.Buffer); - /* Remove restore privilege */ - AcquireRemoveRestorePrivilege(FALSE); + /* Remove restore privilege */ + AcquireRemoveRestorePrivilege(FALSE); - if (Error != ERROR_SUCCESS) - { - DPRINT1("RegUnLoadKeyW() failed (Error %ld)\n", Error); - SetLastError((DWORD)Error); - goto cleanup; + if (Error != ERROR_SUCCESS) + { + DPRINT1("RegUnLoadKeyW() failed (Error %ld)\n", Error); + SetLastError((DWORD)Error); + goto cleanup; + } } bRet = TRUE;
5 years, 9 months
1
0
0
0
[reactos] 01/01: [COMCTL32] Combobox Implement logic for set and get dropdown height CORE-15833
by Joachim Henze
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e3e173ffaafbccb0e9b52…
commit e3e173ffaafbccb0e9b52926d41626d5a4dc38cd Author: Joachim Henze <Joachim.Henze(a)reactos.org> AuthorDate: Sat Mar 16 02:11:00 2019 +0100 Commit: Joachim Henze <Joachim.Henze(a)reactos.org> CommitDate: Sat Mar 16 02:11:00 2019 +0100 [COMCTL32] Combobox Implement logic for set and get dropdown height CORE-15833 by import of Wine commit
https://source.winehq.org/git/wine.git/commit/313c63e194aebdd517b3a85f8fe4d…
merged from current Wine head. Thanks to patches author Fabian Maurer and also Doug Lyons for tests and adding initial the merge-patch. --- dll/win32/comctl32/combo.c | 43 +++++++++++++++++++++++-------------------- dll/win32/comctl32/comctl32.h | 1 + 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/dll/win32/comctl32/combo.c b/dll/win32/comctl32/combo.c index ee374f4537..abbe395090 100644 --- a/dll/win32/comctl32/combo.c +++ b/dll/win32/comctl32/combo.c @@ -18,10 +18,6 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * - * TODO: - * - ComboBox_[GS]etMinVisible() - * - CB_GETMINVISIBLE, CB_SETMINVISIBLE - * - CB_SETTOPINDEX */ #include <stdarg.h> @@ -459,6 +455,11 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG */ lphc->wState |= CBF_MEASUREITEM; + /* + * Per default the comctl32 version of combo shows up to 30 items + */ + lphc->visibleItems = 30; + /* M$ IE 3.01 actually creates (and rapidly destroys) an ownerless combobox */ if( lphc->owner || !(style & WS_VISIBLE) ) @@ -1010,23 +1011,18 @@ static void CBDropDown( LPHEADCOMBO lphc ) if (nItems > 0) { - int nHeight; - int nIHeight; - - nIHeight = (int)SendMessageW(lphc->hWndLBox, LB_GETITEMHEIGHT, 0, 0); + int nIHeight = (int)SendMessageW(lphc->hWndLBox, LB_GETITEMHEIGHT, 0, 0); - nHeight = nIHeight*nItems; - - if (nHeight < nDroppedHeight - COMBO_YBORDERSIZE()) - nDroppedHeight = nHeight + COMBO_YBORDERSIZE(); - - if (nDroppedHeight < nHeight) - { - if (nItems < 5) - nDroppedHeight = (nItems+1)*nIHeight; - else if (nDroppedHeight < 6*nIHeight) - nDroppedHeight = 6*nIHeight; - } + if (lphc->dwStyle & CBS_NOINTEGRALHEIGHT) + { + nDroppedHeight -= 1; + } + else + { + if (nItems > lphc->visibleItems) + nItems = lphc->visibleItems; + nDroppedHeight = nItems * nIHeight + COMBO_YBORDERSIZE(); + } } r.left = rect.left; @@ -2135,6 +2131,13 @@ static LRESULT CALLBACK COMBO_WindowProc( HWND hwnd, UINT message, WPARAM wParam return SendMessageW(lphc->hWndEdit, EM_LIMITTEXT, wParam, lParam); return TRUE; + case CB_GETMINVISIBLE: + return lphc->visibleItems; + + case CB_SETMINVISIBLE: + lphc->visibleItems = (INT)wParam; + return TRUE; + default: if (message >= WM_USER) WARN("unknown msg WM_USER+%04x wp=%04lx lp=%08lx\n", message - WM_USER, wParam, lParam ); diff --git a/dll/win32/comctl32/comctl32.h b/dll/win32/comctl32/comctl32.h index ee47772658..73564eb294 100644 --- a/dll/win32/comctl32/comctl32.h +++ b/dll/win32/comctl32/comctl32.h @@ -147,6 +147,7 @@ typedef struct INT fixedOwnerDrawHeight; INT droppedWidth; /* last two are not used unless set */ INT editHeight; /* explicitly */ + INT visibleItems; } HEADCOMBO, *LPHEADCOMBO; extern BOOL COMBO_FlipListbox(HEADCOMBO *lphc, BOOL ok, BOOL bRedrawButton) DECLSPEC_HIDDEN;
5 years, 9 months
1
0
0
0
[reactos] 01/01: [USERENV] Use a mutex to serialize profile loading and unloading.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=05886b83e978542ab19d2…
commit 05886b83e978542ab19d29a177d13d7b6d100445 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Fri Mar 15 20:54:03 2019 +0100 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Fri Mar 15 21:20:14 2019 +0100 [USERENV] Use a mutex to serialize profile loading and unloading. --- dll/win32/userenv/profile.c | 110 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 102 insertions(+), 8 deletions(-) diff --git a/dll/win32/userenv/profile.c b/dll/win32/userenv/profile.c index c250d8846d..6b4635ba06 100644 --- a/dll/win32/userenv/profile.c +++ b/dll/win32/userenv/profile.c @@ -143,6 +143,60 @@ CheckForLoadedProfile(HANDLE hToken) } +static +HANDLE +CreateProfileMutex( + _In_ PWSTR pszSidString) +{ + SECURITY_DESCRIPTOR SecurityDescriptor; + SECURITY_ATTRIBUTES SecurityAttributes; + PWSTR pszMutexName = NULL; + HANDLE hMutex = NULL; + + pszMutexName = HeapAlloc(GetProcessHeap(), + 0, + (wcslen(L"Global\\userenv: User Profile Mutex for ") + wcslen(pszSidString) + 1) * sizeof(WCHAR)); + if (pszMutexName == NULL) + { + DPRINT("Failed to allocate the mutex name buffer!\n"); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return NULL; + } + + /* Build the profile mutex name */ + wcscpy(pszMutexName, L"Global\\userenv: User Profile Mutex for "); + wcscat(pszMutexName, pszSidString); + + /* Initialize the security descriptor */ + InitializeSecurityDescriptor(&SecurityDescriptor, + SECURITY_DESCRIPTOR_REVISION); + + /* Set a NULL-DACL (everyone has access) */ + SetSecurityDescriptorDacl(&SecurityDescriptor, + TRUE, + NULL, + FALSE); + + /* Initialize the security attributes */ + SecurityAttributes.nLength = sizeof(SecurityAttributes); + SecurityAttributes.lpSecurityDescriptor = &SecurityDescriptor; + SecurityAttributes.bInheritHandle = FALSE; + + /* Create the profile mutex */ + hMutex = CreateMutexW(&SecurityAttributes, + FALSE, + pszMutexName); + if (hMutex == NULL) + { + DPRINT1("Failed to create the profile mutex (Error %lu)\n", GetLastError()); + } + + HeapFree(GetProcessHeap(), 0, pszMutexName); + + return hMutex; +} + + /* PUBLIC FUNCTIONS ********************************************************/ BOOL @@ -1420,6 +1474,7 @@ LoadUserProfileW( WCHAR szUserHivePath[MAX_PATH]; PTOKEN_USER UserSid = NULL; UNICODE_STRING SidString = { 0, 0, NULL }; + HANDLE hProfileMutex = NULL; LONG Error; BOOL ret = FALSE; DWORD dwLength = sizeof(szUserHivePath) / sizeof(szUserHivePath[0]); @@ -1445,6 +1500,17 @@ LoadUserProfileW( } ret = FALSE; + /* Create the profile mutex */ + hProfileMutex = CreateProfileMutex(SidString.Buffer); + if (hProfileMutex == NULL) + { + DPRINT1("Failed to create the profile mutex\n"); + goto cleanup; + } + + /* Wait for the profile mutex */ + WaitForSingleObject(hProfileMutex, INFINITE); + /* Don't load a profile twice */ if (CheckForLoadedProfile(hToken)) { @@ -1552,6 +1618,13 @@ LoadUserProfileW( cleanup: if (UserSid != NULL) HeapFree(GetProcessHeap(), 0, UserSid); + + if (hProfileMutex != NULL) + { + ReleaseMutex(hProfileMutex); + CloseHandle(hProfileMutex); + } + RtlFreeUnicodeString(&SidString); DPRINT("LoadUserProfileW() done\n"); @@ -1565,8 +1638,10 @@ UnloadUserProfile( _In_ HANDLE hToken, _In_ HANDLE hProfile) { - UNICODE_STRING SidString; + UNICODE_STRING SidString = {0, 0, NULL}; + HANDLE hProfileMutex = NULL; LONG Error; + BOOL bRet = FALSE; DPRINT("UnloadUserProfile() called\n"); @@ -1577,8 +1652,6 @@ UnloadUserProfile( return FALSE; } - RegCloseKey(hProfile); - /* Get the user SID string */ if (!GetUserSidStringFromToken(hToken, &SidString)) { @@ -1588,12 +1661,25 @@ UnloadUserProfile( DPRINT("SidString: '%wZ'\n", &SidString); + /* Create the profile mutex */ + hProfileMutex = CreateProfileMutex(SidString.Buffer); + if (hProfileMutex == NULL) + { + DPRINT1("Failed to create the profile mutex\n"); + goto cleanup; + } + + /* Wait for the profile mutex */ + WaitForSingleObject(hProfileMutex, INFINITE); + + /* Close the profile handle */ + RegCloseKey(hProfile); + /* Acquire restore privilege */ if (!AcquireRemoveRestorePrivilege(TRUE)) { DPRINT1("AcquireRemoveRestorePrivilege() failed (Error %ld)\n", GetLastError()); - RtlFreeUnicodeString(&SidString); - return FALSE; + goto cleanup; } /* HACK */ @@ -1625,16 +1711,24 @@ UnloadUserProfile( if (Error != ERROR_SUCCESS) { DPRINT1("RegUnLoadKeyW() failed (Error %ld)\n", Error); - RtlFreeUnicodeString(&SidString); SetLastError((DWORD)Error); - return FALSE; + goto cleanup; + } + + bRet = TRUE; + +cleanup: + if (hProfileMutex != NULL) + { + ReleaseMutex(hProfileMutex); + CloseHandle(hProfileMutex); } RtlFreeUnicodeString(&SidString); DPRINT("UnloadUserProfile() done\n"); - return TRUE; + return bRet; } /* EOF */
5 years, 9 months
1
0
0
0
[reactos] 01/01: [OLE32] Implement WS_EX_ACCEPTFILES (#1403)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=332ca5f5727945d14d8b7…
commit 332ca5f5727945d14d8b780d8cb7c0886a01688b Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Fri Mar 15 22:31:13 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Fri Mar 15 22:31:13 2019 +0900 [OLE32] Implement WS_EX_ACCEPTFILES (#1403) The window that has WS_EX_ACCEPTFILES extended style, should pretend like a drop target that accepts CF_HDROP data. CORE-11238 --- dll/win32/ole32/ole2.c | 143 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) diff --git a/dll/win32/ole32/ole2.c b/dll/win32/ole32/ole2.c index 2de9edbb80..f145982995 100644 --- a/dll/win32/ole32/ole2.c +++ b/dll/win32/ole32/ole2.c @@ -70,6 +70,9 @@ typedef struct tagTrackerWindowInfo BOOL escPressed; HWND curTargetHWND; /* window the mouse is hovering over */ IDropTarget* curDragTarget; +#ifdef __REACTOS__ + HWND accepterHWND; +#endif POINTL curMousePos; /* current position of the mouse in screen coordinates */ DWORD dwKeyState; /* current state of the shift and ctrl keys and the mouse buttons */ } TrackerWindowInfo; @@ -293,6 +296,12 @@ static inline BOOL is_droptarget(HWND hwnd) return get_droptarget_handle(hwnd) != 0; } +#ifdef __REACTOS__ +static inline BOOL is_acceptfiles(HWND hwnd) +{ + return !!(GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_ACCEPTFILES); +} +#endif /************************************************************* * get_droptarget_local_handle * @@ -772,6 +781,9 @@ HRESULT WINAPI DoDragDrop ( trackerInfo.escPressed = FALSE; trackerInfo.curTargetHWND = 0; trackerInfo.curDragTarget = 0; +#ifdef __REACTOS__ + trackerInfo.accepterHWND = NULL; +#endif hwndTrackWindow = CreateWindowW(OLEDD_DRAGTRACKERCLASS, trackerW, WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT, @@ -2182,14 +2194,107 @@ static LRESULT WINAPI OLEDD_DragTrackerWindowProc( return DefWindowProcW (hwnd, uMsg, wParam, lParam); } +#ifdef __REACTOS__ +static HRESULT WINAPI DefaultDragEnter(HWND hwndTarget, + IDataObject* pDataObj, + DWORD grfKeyState, + POINTL pt, + DWORD* pdwEffect) +{ + HRESULT hr; + FORMATETC fme; + + ZeroMemory(&fme, sizeof(fme)); + fme.cfFormat = CF_HDROP; + fme.ptd = NULL; + fme.dwAspect = DVASPECT_CONTENT; + fme.lindex = -1; + fme.tymed = TYMED_HGLOBAL; + hr = pDataObj->lpVtbl->QueryGetData(pDataObj, &fme); + + *pdwEffect = SUCCEEDED(hr) ? DROPEFFECT_COPY : DROPEFFECT_NONE; + + if (*pdwEffect == DROPEFFECT_NONE) + return DRAGDROP_S_CANCEL; + + return S_OK; +} + +static HRESULT WINAPI DefaultDrop(HWND hwndAccepter, + IDataObject* pDataObj, + DWORD grfKeyState, + POINTL pt, + DWORD* pdwEffect) +{ + FORMATETC fme; + STGMEDIUM stgm; + HRESULT hr; + HGLOBAL hGlobal = NULL; + + ZeroMemory(&fme, sizeof(fme)); + fme.cfFormat = CF_HDROP; + fme.ptd = NULL; + fme.dwAspect = DVASPECT_CONTENT; + fme.lindex = -1; + fme.tymed = TYMED_HGLOBAL; + hr = pDataObj->lpVtbl->QueryGetData(pDataObj, &fme); + if (FAILED(hr)) + return hr; + + ZeroMemory(&stgm, sizeof(stgm)); + hr = pDataObj->lpVtbl->GetData(pDataObj, &fme, &stgm); + if (SUCCEEDED(hr)) + { + hGlobal = stgm.DUMMYUNIONNAME.hGlobal; + if (hGlobal) + { + if (IsWindowUnicode(hwndAccepter)) + PostMessageW(hwndAccepter, WM_DROPFILES, (WPARAM)hGlobal, 0); + else + PostMessageA(hwndAccepter, WM_DROPFILES, (WPARAM)hGlobal, 0); + } + ReleaseStgMedium(&stgm); + } + + return hr; +} +#endif + static void drag_enter( TrackerWindowInfo *info, HWND new_target ) { HRESULT hr; +#ifdef __REACTOS__ + DWORD dwEffect = *info->pdwEffect; +#endif info->curTargetHWND = new_target; +#ifdef __REACTOS__ + info->accepterHWND = NULL; + while (new_target && !is_droptarget( new_target )) + { + if (is_acceptfiles(new_target)) + { + dwEffect = info->dwOKEffect; + hr = DefaultDragEnter(new_target, info->dataObject, + info->dwKeyState, info->curMousePos, + &dwEffect); + dwEffect &= info->dwOKEffect; + + if (hr == S_OK) + { + info->accepterHWND = new_target; + info->curDragTarget = NULL; + *info->pdwEffect = dwEffect; + return; + } + } + new_target = GetParent( new_target ); + } +#else while (new_target && !is_droptarget( new_target )) new_target = GetParent( new_target ); +#endif info->curDragTarget = get_droptarget_pointer( new_target ); @@ -2207,6 +2312,9 @@ static void drag_enter( TrackerWindowInfo *info, HWND new_target ) IDropTarget_Release( info->curDragTarget ); info->curDragTarget = NULL; info->curTargetHWND = NULL; +#ifdef __REACTOS__ + info->accepterHWND = NULL; +#endif } } } @@ -2239,6 +2347,27 @@ static void drag_end( TrackerWindowInfo *info ) IDropTarget_Release( info->curDragTarget ); info->curDragTarget = NULL; } +#ifdef __REACTOS__ + else if (info->accepterHWND) + { + if (info->returnValue == DRAGDROP_S_DROP && + *info->pdwEffect != DROPEFFECT_NONE) + { + *info->pdwEffect = info->dwOKEffect; + hr = DefaultDrop(info->accepterHWND, info->dataObject, info->dwKeyState, + info->curMousePos, info->pdwEffect); + *info->pdwEffect &= info->dwOKEffect; + + if (FAILED( hr )) + info->returnValue = hr; + } + else + { + *info->pdwEffect = DROPEFFECT_NONE; + } + info->accepterHWND = NULL; + } +#endif else *info->pdwEffect = DROPEFFECT_NONE; } @@ -2249,8 +2378,13 @@ static HRESULT give_feedback( TrackerWindowInfo *info ) int res; HCURSOR cur; +#ifdef __REACTOS__ + if (info->curDragTarget == NULL && info->accepterHWND == NULL) + *info->pdwEffect = DROPEFFECT_NONE; +#else if (info->curDragTarget == NULL) *info->pdwEffect = DROPEFFECT_NONE; +#endif hr = IDropSource_GiveFeedback( info->dropSource, *info->pdwEffect ); @@ -2309,6 +2443,9 @@ static void OLEDD_TrackStateChange(TrackerWindowInfo* trackerInfo) trackerInfo->curDragTarget = NULL; trackerInfo->curTargetHWND = NULL; } +#ifdef __REACTOS__ + trackerInfo->accepterHWND = NULL; +#endif if (hwndNewTarget) drag_enter( trackerInfo, hwndNewTarget ); @@ -2328,6 +2465,12 @@ static void OLEDD_TrackStateChange(TrackerWindowInfo* trackerInfo) trackerInfo->pdwEffect); *trackerInfo->pdwEffect &= trackerInfo->dwOKEffect; } +#ifdef __REACTOS__ + else if (trackerInfo->accepterHWND) + { + *trackerInfo->pdwEffect = trackerInfo->dwOKEffect; + } +#endif give_feedback( trackerInfo ); } else
5 years, 9 months
1
0
0
0
[reactos] 01/01: Updated release version on readme
by Benjamin Aerni
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8d75f93cbc2ae10e3c015…
commit 8d75f93cbc2ae10e3c015e29e4e4851a8d70e725 Author: Benjamin Aerni <daprogramerforbatch(a)gmail.com> AuthorDate: Thu Mar 14 08:46:54 2019 -0700 Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> CommitDate: Fri Mar 15 00:05:21 2019 +0100 Updated release version on readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 02199953e6..759059bb38 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ --- <p align=center> - <a href="
https://reactos.org/project-news/reactos-0410-released
"> - <img alt="ReactOS 0.4.10 Release" src="
https://img.shields.io/badge/release-0.4.10-0688CB.svg
"> + <a href="
https://reactos.org/project-news/reactos-0411-released
"> + <img alt="ReactOS 0.4.11 Release" src="
https://img.shields.io/badge/release-0.4.11-0688CB.svg
"> </a> <a href="
https://reactos.org/download
"> <img alt="Download ReactOS" src="
https://img.shields.io/badge/download-latest-0688CB.svg
">
5 years, 9 months
1
0
0
0
[reactos] 01/01: [README] Improve the layout of the Quick-Links; add the chat link (#1409)
by Alexander Rechitskiy
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fc1c5fa24518fe3015451…
commit fc1c5fa24518fe3015451b1867925d8055a8bfd6 Author: Alexander Rechitskiy <art1st.tm(a)gmail.com> AuthorDate: Fri Mar 15 02:04:57 2019 +0300 Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> CommitDate: Fri Mar 15 00:04:57 2019 +0100 [README] Improve the layout of the Quick-Links; add the chat link (#1409) --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 547610c847..02199953e6 100644 --- a/README.md +++ b/README.md @@ -28,13 +28,14 @@ </p> ## Quick Links +[Website](https://reactos.org) • +[Official chat](https://chat.reactos.org) • +[Wiki](https://reactos.org/wiki) • +[Forum](https://reactos.org/forum) • +[JIRA Bug
Tracker](https://jira.reactos.org/issues)
• +[ReactOS Git mirror](https://git.reactos.org) • +[Testman](https://reactos.org/testman/) -- [Website](https://reactos.org) -- [
Wiki](https://reactos.org/wiki)
-- [
Forum](https://reactos.org/forum)
-- [JIRA Bug
Tracker](https://jira.reactos.org/issues)
-- [ReactOS Git mirror](https://git.reactos.org) -- [
Testman](https://reactos.org/testman/)
## What is ReactOS?
5 years, 9 months
1
0
0
0
[reactos] 01/01: [USERENV] LoadUserProfileW: If a user profile has already been loaded, just open and return the profile key.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=30c501fc9ffea2687145f…
commit 30c501fc9ffea2687145f2604277d6fccad915d7 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Thu Mar 14 23:47:34 2019 +0100 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Thu Mar 14 23:49:16 2019 +0100 [USERENV] LoadUserProfileW: If a user profile has already been loaded, just open and return the profile key. --- dll/win32/userenv/profile.c | 149 ++++++++++++++++++++++---------------------- 1 file changed, 76 insertions(+), 73 deletions(-) diff --git a/dll/win32/userenv/profile.c b/dll/win32/userenv/profile.c index 40d4b323af..c250d8846d 100644 --- a/dll/win32/userenv/profile.c +++ b/dll/win32/userenv/profile.c @@ -1436,100 +1436,102 @@ LoadUserProfileW( DPRINT("UserName: %S\n", lpProfileInfo->lpUserName); - /* Don't load a profile twice */ - if (CheckForLoadedProfile(hToken)) + /* Get the user SID string */ + ret = GetUserSidStringFromToken(hToken, &SidString); + if (!ret) { - DPRINT ("Profile already loaded\n"); - lpProfileInfo->hProfile = NULL; - return TRUE; + DPRINT1("GetUserSidStringFromToken() failed\n"); + goto cleanup; } + ret = FALSE; - if (lpProfileInfo->lpProfilePath) + /* Don't load a profile twice */ + if (CheckForLoadedProfile(hToken)) { - /* Use the caller's specified roaming user profile path */ - StringCbCopyW(szUserHivePath, sizeof(szUserHivePath), lpProfileInfo->lpProfilePath); + DPRINT1("Profile %S already loaded\n", SidString.Buffer); } else { - /* FIXME: check if MS Windows allows lpProfileInfo->lpProfilePath to be NULL */ - if (!GetProfilesDirectoryW(szUserHivePath, &dwLength)) - { - DPRINT1("GetProfilesDirectoryW() failed (error %ld)\n", GetLastError()); - return FALSE; - } - } + DPRINT1("Loading profile %S\n", SidString.Buffer); - /* Create user hive name */ - StringCbCatW(szUserHivePath, sizeof(szUserHivePath), L"\\"); - StringCbCatW(szUserHivePath, sizeof(szUserHivePath), lpProfileInfo->lpUserName); - StringCbCatW(szUserHivePath, sizeof(szUserHivePath), L"\\ntuser.dat"); - DPRINT("szUserHivePath: %S\n", szUserHivePath); - - /* Create user profile directory if needed */ - if (GetFileAttributesW(szUserHivePath) == INVALID_FILE_ATTRIBUTES) - { - /* Get user sid */ - if (GetTokenInformation(hToken, TokenUser, NULL, 0, &dwLength) || - GetLastError() != ERROR_INSUFFICIENT_BUFFER) + if (lpProfileInfo->lpProfilePath) { - DPRINT1 ("GetTokenInformation() failed\n"); - return FALSE; + /* Use the caller's specified roaming user profile path */ + StringCbCopyW(szUserHivePath, sizeof(szUserHivePath), lpProfileInfo->lpProfilePath); } - - UserSid = (PTOKEN_USER)HeapAlloc(GetProcessHeap(), 0, dwLength); - if (!UserSid) + else { - DPRINT1("HeapAlloc() failed\n"); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - goto cleanup; + /* FIXME: check if MS Windows allows lpProfileInfo->lpProfilePath to be NULL */ + if (!GetProfilesDirectoryW(szUserHivePath, &dwLength)) + { + DPRINT1("GetProfilesDirectoryW() failed (error %ld)\n", GetLastError()); + goto cleanup; + } } - if (!GetTokenInformation(hToken, TokenUser, UserSid, dwLength, &dwLength)) + /* Create user hive name */ + StringCbCatW(szUserHivePath, sizeof(szUserHivePath), L"\\"); + StringCbCatW(szUserHivePath, sizeof(szUserHivePath), lpProfileInfo->lpUserName); + StringCbCatW(szUserHivePath, sizeof(szUserHivePath), L"\\ntuser.dat"); + DPRINT("szUserHivePath: %S\n", szUserHivePath); + + /* Create user profile directory if needed */ + if (GetFileAttributesW(szUserHivePath) == INVALID_FILE_ATTRIBUTES) { - DPRINT1("GetTokenInformation() failed\n"); - goto cleanup; + /* Get user sid */ + if (GetTokenInformation(hToken, TokenUser, NULL, 0, &dwLength) || + GetLastError() != ERROR_INSUFFICIENT_BUFFER) + { + DPRINT1 ("GetTokenInformation() failed\n"); + goto cleanup; + } + + UserSid = (PTOKEN_USER)HeapAlloc(GetProcessHeap(), 0, dwLength); + if (!UserSid) + { + DPRINT1("HeapAlloc() failed\n"); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + goto cleanup; + } + + if (!GetTokenInformation(hToken, TokenUser, UserSid, dwLength, &dwLength)) + { + DPRINT1("GetTokenInformation() failed\n"); + goto cleanup; + } + + /* Create profile */ + ret = CreateUserProfileW(UserSid->User.Sid, lpProfileInfo->lpUserName); + if (!ret) + { + DPRINT1("CreateUserProfileW() failed\n"); + goto cleanup; + } } - /* Create profile */ - ret = CreateUserProfileW(UserSid->User.Sid, lpProfileInfo->lpUserName); - if (!ret) + /* Acquire restore privilege */ + if (!AcquireRemoveRestorePrivilege(TRUE)) { - DPRINT1("CreateUserProfileW() failed\n"); + DPRINT1("AcquireRemoveRestorePrivilege() failed (Error %ld)\n", GetLastError()); goto cleanup; } - } - - /* Get the user SID string */ - ret = GetUserSidStringFromToken(hToken, &SidString); - if (!ret) - { - DPRINT1("GetUserSidStringFromToken() failed\n"); - goto cleanup; - } - ret = FALSE; - /* Acquire restore privilege */ - if (!AcquireRemoveRestorePrivilege(TRUE)) - { - DPRINT1("AcquireRemoveRestorePrivilege() failed (Error %ld)\n", GetLastError()); - goto cleanup; - } - - /* Load user registry hive */ - Error = RegLoadKeyW(HKEY_USERS, - SidString.Buffer, - szUserHivePath); - AcquireRemoveRestorePrivilege(FALSE); + /* Load user registry hive */ + Error = RegLoadKeyW(HKEY_USERS, + SidString.Buffer, + szUserHivePath); + AcquireRemoveRestorePrivilege(FALSE); - /* HACK: Do not fail if the profile has already been loaded! */ - if (Error == ERROR_SHARING_VIOLATION) - Error = ERROR_SUCCESS; + /* HACK: Do not fail if the profile has already been loaded! */ + if (Error == ERROR_SHARING_VIOLATION) + Error = ERROR_SUCCESS; - if (Error != ERROR_SUCCESS) - { - DPRINT1("RegLoadKeyW() failed (Error %ld)\n", Error); - SetLastError((DWORD)Error); - goto cleanup; + if (Error != ERROR_SUCCESS) + { + DPRINT1("RegLoadKeyW() failed (Error %ld)\n", Error); + SetLastError((DWORD)Error); + goto cleanup; + } } /* Open future HKEY_CURRENT_USER */ @@ -1548,7 +1550,8 @@ LoadUserProfileW( ret = TRUE; cleanup: - HeapFree(GetProcessHeap(), 0, UserSid); + if (UserSid != NULL) + HeapFree(GetProcessHeap(), 0, UserSid); RtlFreeUnicodeString(&SidString); DPRINT("LoadUserProfileW() done\n");
5 years, 9 months
1
0
0
0
[reactos] 08/08: [SHIMENG] Implement experimental support for multiple hooks on the same function
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ee62837ec08f8913754f8…
commit ee62837ec08f8913754f8d1d57e1593db30cd080 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Wed Mar 13 20:15:18 2019 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Thu Mar 14 20:02:01 2019 +0100 [SHIMENG] Implement experimental support for multiple hooks on the same function --- dll/appcompat/apphelp/shimeng.c | 91 +++++++++++++++++++++++++++++++++-------- dll/appcompat/apphelp/shimeng.h | 6 ++- 2 files changed, 78 insertions(+), 19 deletions(-) diff --git a/dll/appcompat/apphelp/shimeng.c b/dll/appcompat/apphelp/shimeng.c index e3c152bbdf..3e8a169617 100644 --- a/dll/appcompat/apphelp/shimeng.c +++ b/dll/appcompat/apphelp/shimeng.c @@ -46,7 +46,7 @@ HOOKAPIEX g_IntHookEx[] = StubGetProcAddress, /* ReplacementFunction*/ NULL, /* OriginalFunction */ NULL, /* pShimInfo */ - NULL /* Unused */ + NULL /* ApiLink */ }, }; @@ -545,17 +545,7 @@ VOID SeiAddHooks(PHOOKAPIEX hooks, DWORD dwHookCount, PSHIMINFO pShim) RtlInitAnsiString(&AnsiString, hook->FunctionName); if (NT_SUCCESS(LdrGetDllHandle(NULL, 0, &UnicodeModName, &DllHandle))) { - PVOID ProcAddress; - - - if (!NT_SUCCESS(LdrGetProcedureAddress(DllHandle, &AnsiString, 0, &ProcAddress))) - { - SHIMENG_FAIL("Unable to retrieve %s!%s\n", hook->LibraryName, hook->FunctionName); - continue; - } - HookModuleInfo = SeiFindHookModuleInfo(NULL, DllHandle); - hook->OriginalFunction = ProcAddress; } else { @@ -582,14 +572,22 @@ VOID SeiAddHooks(PHOOKAPIEX hooks, DWORD dwHookCount, PSHIMINFO pShim) int CmpResult = strcmp(hook->FunctionName, HookApi->FunctionName); if (CmpResult == 0) { - /* Multiple hooks on one function? --> use ApiLink */ - SHIMENG_FAIL("Multiple hooks on one API is not yet supported!\n"); - ASSERT(0); + while (HookApi->ApiLink) + { + HookApi = HookApi->ApiLink; + } + HookApi->ApiLink = hook; + hook = NULL; + break; } } - pHookApi = ARRAY_Append(&HookModuleInfo->HookApis, PHOOKAPIEX); - if (pHookApi) - *pHookApi = hook; + /* No place found yet, append it */ + if (hook) + { + pHookApi = ARRAY_Append(&HookModuleInfo->HookApis, PHOOKAPIEX); + if (pHookApi) + *pHookApi = hook; + } } } @@ -641,8 +639,57 @@ FARPROC WINAPI StubGetProcAddress(HINSTANCE hModule, LPCSTR lpProcName) return proc; } +VOID SeiResolveAPI(PHOOKMODULEINFO HookModuleInfo) +{ + DWORD n; + ANSI_STRING AnsiString; + + ASSERT(HookModuleInfo->BaseAddress != NULL); + + for (n = 0; n < ARRAY_Size(&HookModuleInfo->HookApis); ++n) + { + PVOID ProcAddress; + PHOOKAPIEX HookApi = *ARRAY_At(&HookModuleInfo->HookApis, PHOOKAPIEX, n); + RtlInitAnsiString(&AnsiString, HookApi->FunctionName); + + if (!NT_SUCCESS(LdrGetProcedureAddress(HookModuleInfo->BaseAddress, &AnsiString, 0, &ProcAddress))) + { + SHIMENG_FAIL("Unable to retrieve %s!%s\n", HookApi->LibraryName, HookApi->FunctionName); + continue; + } + + HookApi->OriginalFunction = ProcAddress; + if (HookApi->ApiLink) + { + SHIMENG_MSG("TODO: Figure out how to handle conflicting In/Exports with ApiLink!\n"); + } + while (HookApi->ApiLink) + { + HookApi->ApiLink->OriginalFunction = HookApi->OriginalFunction; + HookApi->OriginalFunction = HookApi->ApiLink->ReplacementFunction; + HookApi = HookApi->ApiLink; + } + } +} + /* Walk all shim modules / enabled shims, and add their hooks */ VOID SeiResolveAPIs(VOID) +{ + DWORD n; + + for (n = 0; n < ARRAY_Size(&g_pHookArray); ++n) + { + PHOOKMODULEINFO pModuleInfo = ARRAY_At(&g_pHookArray, HOOKMODULEINFO, n); + + /* Is this module loaded? */ + if (pModuleInfo->BaseAddress) + { + SeiResolveAPI(pModuleInfo); + } + } +} + +VOID SeiCombineHookInfo(VOID) { DWORD mod, n; @@ -1249,6 +1296,7 @@ VOID SeiInit(PUNICODE_STRING ProcessImage, HSDB hsdb, SDBQUERYRESULT* pQuery) } SeiAddInternalHooks(dwTotalHooks); + SeiCombineHookInfo(); SeiResolveAPIs(); PatchNewModules(Peb); @@ -1347,8 +1395,17 @@ VOID NTAPI SE_ProcessDying(VOID) VOID WINAPI SE_DllLoaded(PLDR_DATA_TABLE_ENTRY LdrEntry) { + PHOOKMODULEINFO HookModuleInfo; SHIMENG_INFO("%sINIT. loading DLL \"%wZ\"\n", g_bShimDuringInit ? "" : "AFTER ", &LdrEntry->BaseDllName); + HookModuleInfo = SeiFindHookModuleInfo(&LdrEntry->BaseDllName, NULL); + if (HookModuleInfo) + { + ASSERT(HookModuleInfo->BaseAddress == NULL); + HookModuleInfo->BaseAddress = LdrEntry->DllBase; + SeiResolveAPI(HookModuleInfo); + } + SeiHookImports(LdrEntry); NotifyShims(SHIM_REASON_DLL_LOAD, LdrEntry); diff --git a/dll/appcompat/apphelp/shimeng.h b/dll/appcompat/apphelp/shimeng.h index 0081c49bc9..c6e3888d53 100644 --- a/dll/appcompat/apphelp/shimeng.h +++ b/dll/appcompat/apphelp/shimeng.h @@ -23,6 +23,8 @@ typedef struct _ARRAY typedef struct _SHIMINFO *PSHIMINFO; typedef struct _SHIMMODULE *PSHIMMODULE; +typedef struct tagHOOKAPIEX *PHOOKAPIEX; + /* Shims know this structure as HOOKAPI, with 2 reserved members (the last 2). */ typedef struct tagHOOKAPIEX { @@ -31,8 +33,8 @@ typedef struct tagHOOKAPIEX PVOID ReplacementFunction; PVOID OriginalFunction; PSHIMINFO pShimInfo; - PVOID Unused; -} HOOKAPIEX, *PHOOKAPIEX; + PHOOKAPIEX ApiLink; +} HOOKAPIEX; C_ASSERT(sizeof(HOOKAPIEX) == sizeof(HOOKAPI)); C_ASSERT(offsetof(HOOKAPIEX, pShimInfo) == offsetof(HOOKAPI, Reserved));
5 years, 9 months
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
...
22
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
Results per page:
10
25
50
100
200