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
April 2018
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
26 participants
247 discussions
Start a n
N
ew thread
03/03: [README] Convert to UTF-8 without BOM.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3d012a44059ddc6ea0f18…
commit 3d012a44059ddc6ea0f18fc4e958244db6246706 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Apr 22 02:52:11 2018 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Apr 22 02:53:48 2018 +0200 [README] Convert to UTF-8 without BOM. --- boot/bootdata/readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/bootdata/readme.txt b/boot/bootdata/readme.txt index 13b8e0332a..0e007055a6 100644 --- a/boot/bootdata/readme.txt +++ b/boot/bootdata/readme.txt @@ -1,4 +1,4 @@ -======================== +======================== ReactOS™ Version 0.4.x Updated August 31, 2016 ========================
6 years, 8 months
1
0
0
0
02/03: [BOOTDATA] Increase the maximum size of the default event log files.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=32d51c8607b3553e4de56…
commit 32d51c8607b3553e4de56d768a1602108f49b349 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Apr 22 02:51:32 2018 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Apr 22 02:53:44 2018 +0200 [BOOTDATA] Increase the maximum size of the default event log files. --- boot/bootdata/hivesys.inf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/boot/bootdata/hivesys.inf b/boot/bootdata/hivesys.inf index 2bed731cb6..72585eaa30 100644 --- a/boot/bootdata/hivesys.inf +++ b/boot/bootdata/hivesys.inf @@ -1530,17 +1530,17 @@ HKLM,"SYSTEM\CurrentControlSet\Services\EventLog","Type",0x00010001,0x00000010 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Application",,0x00000010 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Application","File",0x00020000,"%SystemRoot%\system32\config\AppEvent.Evt" -HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Application","MaxSize",0x00010003,524288 +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Application","MaxSize",0x00010003,5242880 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Application","Retention",0x00010003,0 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Security",,0x00000010 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Security","File",0x00020000,"%SystemRoot%\system32\config\SecEvent.Evt" -HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Security","MaxSize",0x00010003,524288 +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Security","MaxSize",0x00010003,5242880 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Security","Retention",0x00010003,0 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System",,0x00000010 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System","File",0x00020000,"%SystemRoot%\system32\config\SysEvent.Evt" -HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System","MaxSize",0x00010003,524288 +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System","MaxSize",0x00010003,5242880 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System","Retention",0x00010003,0 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System\Application Popup","EventMessageFile",0x00020000,"%SystemRoot%\system32\ntdll.dll" HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System\Application Popup","TypesSupported",0x00010003,0x00000007
6 years, 8 months
1
0
0
0
01/03: [EVTLIB] Silence some DPRINTs.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=10ed9621e44cd48e04d1a…
commit 10ed9621e44cd48e04d1a3f0e0adb5fc288858ca Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Apr 22 02:42:04 2018 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Apr 22 02:53:40 2018 +0200 [EVTLIB] Silence some DPRINTs. --- sdk/lib/evtlib/evtlib.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/lib/evtlib/evtlib.c b/sdk/lib/evtlib/evtlib.c index 45c1b07d27..06c7de8c75 100644 --- a/sdk/lib/evtlib/evtlib.c +++ b/sdk/lib/evtlib/evtlib.c @@ -828,7 +828,7 @@ Continue: if (LogFile->Header.MaxSize - NextOffset.QuadPart < sizeof(EVENTLOGRECORD)) { /* Wrap to the beginning of the log */ - DPRINT1("Wrap!\n"); + DPRINT("Wrap!\n"); NextOffset.QuadPart = sizeof(EVENTLOGHEADER); } @@ -838,7 +838,7 @@ Continue: */ if (FileOffset.QuadPart > NextOffset.QuadPart) { - DPRINT1("Wrapping = TRUE;\n"); + DPRINT("Wrapping = TRUE;\n"); Wrapping = TRUE; } @@ -1474,10 +1474,10 @@ ElfWriteRecord( LogFile->Header.EndOffset = WriteOffset; } - DPRINT1("MaxSize = 0x%x, StartOffset = 0x%x, WriteOffset = 0x%x, EndOffset = 0x%x, BufSize = 0x%x\n" - "OldestRecordNumber = %d\n", - LogFile->Header.MaxSize, LogFile->Header.StartOffset, WriteOffset, LogFile->Header.EndOffset, BufSize, - OldestRecordNumber); + EVTLTRACE("MaxSize = 0x%x, StartOffset = 0x%x, WriteOffset = 0x%x, EndOffset = 0x%x, BufSize = 0x%x\n" + "OldestRecordNumber = %d\n", + LogFile->Header.MaxSize, LogFile->Header.StartOffset, WriteOffset, LogFile->Header.EndOffset, BufSize, + OldestRecordNumber); } /*
6 years, 8 months
1
0
0
0
01/01: [APISETS] Fix data forwarding. Thanks to Timo for the help :)
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a91899a6a1cc369223768…
commit a91899a6a1cc3692237688254a1787d731b62c39 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sat Apr 21 18:55:57 2018 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sat Apr 21 18:56:33 2018 +0200 [APISETS] Fix data forwarding. Thanks to Timo for the help :) --- dll/apisets/api-ms-win-core-crt-l2-1-0.spec | 3 +-- dll/apisets/api-ms-win-crt-multibyte-l1-1-0.spec | 3 +-- dll/apisets/update.py | 11 ++--------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/dll/apisets/api-ms-win-core-crt-l2-1-0.spec b/dll/apisets/api-ms-win-core-crt-l2-1-0.spec index 68cf57de66..3acd1f58db 100644 --- a/dll/apisets/api-ms-win-core-crt-l2-1-0.spec +++ b/dll/apisets/api-ms-win-core-crt-l2-1-0.spec @@ -13,8 +13,7 @@ @ stdcall _onexit() msvcrt._onexit @ stdcall _purecall() msvcrt._purecall @ stdcall _time64() msvcrt._time64 -@ extern -arch=arm64,i386,arm atexit msvcrt._imp__atexit -@ extern -arch=x86_64 atexit msvcrt.__imp_atexit +@ extern -stub atexit msvcrt.atexit # the -stub is a HACK to fix VS < 2017 build! @ stdcall exit() msvcrt.exit @ stub hgets @ stub hwprintf diff --git a/dll/apisets/api-ms-win-crt-multibyte-l1-1-0.spec b/dll/apisets/api-ms-win-crt-multibyte-l1-1-0.spec index e723f9d23b..3e169a7401 100644 --- a/dll/apisets/api-ms-win-crt-multibyte-l1-1-0.spec +++ b/dll/apisets/api-ms-win-crt-multibyte-l1-1-0.spec @@ -69,8 +69,7 @@ @ stub _mbbtombc_l @ stdcall _mbbtype() msvcrt._mbbtype @ stub _mbbtype_l -@ extern -arch=arm64,i386,arm _mbcasemap msvcrt._imp___mbcasemap -@ extern -arch=x86_64 _mbcasemap msvcrt.__imp__mbcasemap +@ extern -stub _mbcasemap msvcrt._mbcasemap # the -stub is a HACK to fix VS < 2017 build! @ stdcall _mbccpy() msvcrt._mbccpy @ stub _mbccpy_l @ stub _mbccpy_s diff --git a/dll/apisets/update.py b/dll/apisets/update.py index dc14a162aa..05915532e6 100644 --- a/dll/apisets/update.py +++ b/dll/apisets/update.py @@ -247,15 +247,8 @@ class SpecEntry(object): arch = self.arch if self.callconv == 'extern': args = '' - callconv = 'extern' - if arch.has(Arch.x86_64): - fwd = '{}.__imp_{}'.format(*self._forwarder) - self.arch = arch - Arch(Arch.x86_64) - estimate_size += self.write(spec_file) - self.arch = arch - arch = Arch(Arch.x86_64) - else: - fwd = '{}._imp__{}'.format(*self._forwarder) + callconv = 'extern -stub' # HACK + fwd += ' # the -stub is a HACK to fix VS < 2017 build!' if arch != Arch(Arch.Any): opts = '{} -arch={}'.format(opts, arch.to_str()) spec_file.write('{ord} {cc}{opts} {name}{args} {fwd}{nl}'.format(ord=self._ord,
6 years, 8 months
1
0
0
0
03/03: [KERNEL32] Add Vista exports
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=01ae49857a1ec71034de6…
commit 01ae49857a1ec71034de675b086d12cfb7406392 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Feb 18 22:21:31 2018 +0100 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Apr 21 18:31:27 2018 +0200 [KERNEL32] Add Vista exports --- dll/win32/kernel32/kernel32.spec | 299 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 278 insertions(+), 21 deletions(-) diff --git a/dll/win32/kernel32/kernel32.spec b/dll/win32/kernel32/kernel32.spec index 3bb84242c5..547bcaa83e 100644 --- a/dll/win32/kernel32/kernel32.spec +++ b/dll/win32/kernel32/kernel32.spec @@ -1,3 +1,5 @@ +@ stdcall -stub -version=0x600+ AcquireSRWLockExclusive(ptr) NTDLL.RtlAcquireSRWLockExclusive +@ stdcall -stub -version=0x600+ AcquireSRWLockShared(ptr) NTDLL.RtlAcquireSRWLockShared @ stdcall ActivateActCtx(ptr ptr) @ stdcall AddAtomA(str) @ stdcall AddAtomW(wstr) @@ -6,10 +8,16 @@ @ stdcall AddLocalAlternateComputerNameA(str ptr) @ stdcall AddLocalAlternateComputerNameW(wstr ptr) @ stdcall AddRefActCtx(ptr) +@ stdcall -stub -version=0x600+ AddSIDToBoundaryDescriptor(ptr ptr) +@ stdcall -stub -version=0x600+ AddSecureMemoryCacheCallback(ptr) @ stdcall AddVectoredContinueHandler(long ptr) ntdll.RtlAddVectoredContinueHandler @ stdcall AddVectoredExceptionHandler(long ptr) ntdll.RtlAddVectoredExceptionHandler +@ stdcall -stub -version=0x600+ AdjustCalendarDate(ptr long long) @ stdcall AllocConsole() @ stdcall AllocateUserPhysicalPages(long ptr ptr) +@ stdcall -stub -version=0x600+ AllocateUserPhysicalPagesNuma(ptr ptr ptr long) +@ stdcall -stub -version=0x600+ ApplicationRecoveryFinished(long) +@ stdcall -stub -version=0x600+ ApplicationRecoveryInProgress(ptr) @ stdcall AreFileApisANSI() @ stdcall AssignProcessToJobObject(ptr ptr) @ stdcall AttachConsole(long) @@ -21,12 +29,14 @@ @ stdcall BaseCleanupAppcompatCacheSupport(ptr) @ stdcall BaseDumpAppcompatCache() @ stdcall BaseFlushAppcompatCache() +@ stub -version=0x600+ BaseGenerateAppCompatData @ stdcall BaseInitAppcompatCacheSupport() @ stdcall BaseIsAppcompatInfrastructureDisabled() IsShimInfrastructureDisabled -@ stdcall BaseProcessInitPostImport() ; missing in Win 7 -;@ stdcall -arch=x86_64 BaseProcessStart() +@ stdcall -version=0x501-0x502 BaseProcessInitPostImport() +;@ stdcall -version=0x502 -arch=x86_64 BaseProcessStart() @ stdcall BaseQueryModuleData(str str ptr ptr ptr) ;check -;@ stdcall -arch=x86_64 BaseThreadStart() +@ stub -version=0x600+ BaseThreadInitThunk +;@ stdcall -version=0x502 -arch=x86_64 BaseThreadStart() @ stdcall BaseUpdateAppcompatCache(long long long) @ stdcall BasepCheckBadapp(long ptr long long long long long long long) @ stdcall BasepCheckWinSaferRestrictions(long long long long long long) @@ -41,11 +51,18 @@ @ stdcall BuildCommDCBW(wstr ptr) @ stdcall CallNamedPipeA(str ptr long ptr long ptr long) @ stdcall CallNamedPipeW(wstr ptr long ptr long ptr long) +@ stdcall -stub -version=0x600+ CallbackMayRunLong(ptr) @ stdcall CancelDeviceWakeupRequest(long) @ stdcall CancelIo(long) +@ stdcall -stub -version=0x600+ CancelIoEx(ptr ptr) +@ stdcall -stub -version=0x600+ CancelSynchronousIo(ptr) +@ stdcall -stub -version=0x600+ CancelThreadpoolIo(ptr) @ stdcall CancelTimerQueueTimer(long long) @ stdcall CancelWaitableTimer(long) @ stdcall ChangeTimerQueueTimer(ptr ptr long long) +@ stdcall -stub -version=0x600+ CheckElevation(ptr ptr ptr ptr ptr) +@ stdcall -stub -version=0x600+ CheckElevationEnabled(ptr) +@ stub -version=0x600+ CheckForReadOnlyResource @ stdcall CheckNameLegalDOS8Dot3A(str str long long long) @ stdcall CheckNameLegalDOS8Dot3W(wstr str long long long) @ stdcall CheckRemoteDebuggerPresent(long ptr) @@ -53,42 +70,70 @@ @ stdcall ClearCommError(long ptr ptr) @ stdcall CloseConsoleHandle(long) @ stdcall CloseHandle(long) +@ stdcall -stub -version=0x600+ ClosePrivateNamespace(ptr long) @ stdcall CloseProfileUserMapping() +@ stdcall -stub -version=0x600+ CloseThreadpool(ptr) +@ stdcall -stub -version=0x600+ CloseThreadpoolCleanupGroup(ptr) +@ stdcall -stub -version=0x600+ CloseThreadpoolCleanupGroupMembers(ptr long ptr) +@ stdcall -stub -version=0x600+ CloseThreadpoolIo(ptr) +@ stdcall -stub -version=0x600+ CloseThreadpoolTimer(pti) +@ stdcall -stub -version=0x600+ CloseThreadpoolWait(pwa) +@ stdcall -stub -version=0x600+ CloseThreadpoolWork(ptr) @ stdcall CmdBatNotification(long) @ stdcall CommConfigDialogA(str long ptr) @ stdcall CommConfigDialogW(wstr long ptr) +@ stdcall -stub -version=0x600+ CompareCalendarDates(ptr ptr ptr) @ stdcall CompareFileTime(ptr ptr) @ stdcall CompareStringA(long long str long str long) +@ stdcall -stub -version=0x600+ CompareStringEx(wstr long wstr long wstr long ptr ptr ptr) +@ stdcall -stub -version=0x600+ CompareStringOrdinal(wstr long wstr long long) @ stdcall CompareStringW(long long wstr long wstr long) @ stdcall ConnectNamedPipe(long ptr) ;@ stdcall -arch=x86_64 ConsoleIMERoutine() @ stdcall ConsoleMenuControl(long long long) @ stdcall ContinueDebugEvent(long long long) +@ stdcall -stub -version=0x600+ ConvertCalDateTimeToSystemTime @ stdcall ConvertDefaultLocale (long) @ stdcall ConvertFiberToThread() +@ stdcall -stub -version=0x600+ ConvertNLSDayOfWeekToWin32DayOfWeek(long) +@ stdcall -stub -version=0x600+ ConvertSystemTimeToCalDateTime @ stdcall ConvertThreadToFiber(ptr) @ stdcall ConvertThreadToFiberEx(ptr long) @ stdcall CopyFileA(str str long) @ stdcall CopyFileExA (str str ptr ptr ptr long) @ stdcall CopyFileExW (wstr wstr ptr ptr ptr long) +@ stdcall -stub -version=0x600+ CopyFileTransactedA(str str ptr ptr ptr long ptr) +@ stdcall -stub -version=0x600+ CopyFileTransactedW(wstr wstr ptr ptr ptr long ptr) @ stdcall CopyFileW(wstr wstr long) @ stdcall CopyLZFile(long long) LZCopy @ stdcall CreateActCtxA(ptr) @ stdcall CreateActCtxW(ptr) +@ stdcall -stub -version=0x600+ CreateBoundaryDescriptorA(str long) +@ stdcall -stub -version=0x600+ CreateBoundaryDescriptorW(wstr long) @ stdcall CreateConsoleScreenBuffer(long long ptr long ptr) @ stdcall CreateDirectoryA(str ptr) @ stdcall CreateDirectoryExA(str str ptr) @ stdcall CreateDirectoryExW(wstr wstr ptr) +@ stdcall -stub -version=0x600+ CreateDirectoryTransactedA(str str ptr ptr) +@ stdcall -stub -version=0x600+ CreateDirectoryTransactedW(wstr wstr ptr ptr) @ stdcall CreateDirectoryW(wstr ptr) @ stdcall CreateEventA(ptr long long str) +@ stdcall -stub -version=0x600+ CreateEventExA(ptr str long long) +@ stdcall -stub -version=0x600+ CreateEventExW(ptr wstr long long) @ stdcall CreateEventW(ptr long long wstr) @ stdcall CreateFiber(long ptr ptr) @ stdcall CreateFiberEx(long long long ptr ptr) @ stdcall CreateFileA(str long long ptr long long long) @ stdcall CreateFileMappingA(long ptr long long long str) +@ stdcall -stub -version=0x600+ CreateFileMappingNumaA(ptr ptr long long long str long) +@ stdcall -stub -version=0x600+ CreateFileMappingNumaW(ptr ptr long long long wstr long) @ stdcall CreateFileMappingW(long ptr long long long wstr) +@ stdcall -stub -version=0x600+ CreateFileTransactedA(str long long ptr long long ptr ptr ptr ptr) +@ stdcall -stub -version=0x600+ CreateFileTransactedW(wstr long long ptr long long ptr ptr ptr ptr) @ stdcall CreateFileW(wstr long long ptr long long long) @ stdcall CreateHardLinkA(str str ptr) +@ stdcall -stub -version=0x600+ CreateHardLinkTransactedA(str str ptr ptr) +@ stdcall -stub -version=0x600+ CreateHardLinkTransactedW(wstr wstr ptr ptr) @ stdcall CreateHardLinkW(wstr wstr ptr) @ stdcall CreateIoCompletionPort(long long long long) @ stdcall CreateJobObjectA(ptr str) @@ -98,25 +143,43 @@ @ stdcall CreateMailslotW(ptr long long ptr) @ stdcall CreateMemoryResourceNotification(long) @ stdcall CreateMutexA(ptr long str) +@ stdcall -stub -version=0x600+ CreateMutexExA(ptr str long long) +@ stdcall -stub -version=0x600+ CreateMutexExW(ptr wstr long long) @ stdcall CreateMutexW(ptr long wstr) @ stdcall CreateNamedPipeA(str long long long long long long ptr) @ stdcall CreateNamedPipeW(wstr long long long long long long ptr) -@ stdcall CreateNlsSecurityDescriptor(ptr long long) ; missing in Win 7 +@ stdcall -version=0x501-0x502 CreateNlsSecurityDescriptor(ptr long long) @ stdcall CreatePipe(ptr ptr ptr long) +@ stdcall -stub -version=0x600+ CreatePrivateNamespaceA(ptr ptr str) +@ stdcall -stub -version=0x600+ CreatePrivateNamespaceW(ptr prt wstr) @ stdcall CreateProcessA(str str ptr ptr long long ptr str ptr ptr) @ stdcall CreateProcessInternalA(ptr str str ptr ptr long long ptr str ptr ptr long) @ stdcall CreateProcessInternalW(ptr wstr wstr ptr ptr long long ptr wstr ptr ptr long) @ stdcall CreateProcessW(wstr wstr ptr ptr long long ptr wstr ptr ptr) @ stdcall CreateRemoteThread(long ptr long ptr long long ptr) @ stdcall CreateSemaphoreA(ptr long long str) +@ stdcall -stub -version=0x600+ CreateSemaphoreExA(ptr long long str long long) +@ stdcall -stub -version=0x600+ CreateSemaphoreExW(ptr long long wstr long long) @ stdcall CreateSemaphoreW(ptr long long wstr) @ stdcall -i386 CreateSocketHandle() +@ stdcall -stub -version=0x600+ CreateSymbolicLinkA(str str long) +@ stdcall -stub -version=0x600+ CreateSymbolicLinkTransactedA(str str long ptr) +@ stdcall -stub -version=0x600+ CreateSymbolicLinkTransactedW(wstr wstr long ptr) +@ stdcall -stub -version=0x600+ CreateSymbolicLinkW(wstr wstr long) @ stdcall CreateTapePartition(long long long long) @ stdcall CreateThread(ptr long ptr long long ptr) +@ stub -version=0x600+ CreateThreadpool +@ stub -version=0x600+ CreateThreadpoolCleanupGroup +@ stub -version=0x600+ CreateThreadpoolIo +@ stub -version=0x600+ CreateThreadpoolTimer +@ stub -version=0x600+ CreateThreadpoolWait +@ stub -version=0x600+ CreateThreadpoolWork @ stdcall CreateTimerQueue () @ stdcall CreateTimerQueueTimer(ptr long ptr ptr long long long) @ stdcall CreateToolhelp32Snapshot(long long) @ stdcall CreateWaitableTimerA(ptr long str) +@ stub -version=0x600+ CreateWaitableTimerExA +@ stub -version=0x600+ CreateWaitableTimerExW @ stdcall CreateWaitableTimerW(ptr long wstr) ;@ stdcall -arch=x86_64 CtrlRoutine() @ stdcall DeactivateActCtx(long ptr) @@ -131,10 +194,14 @@ @ stdcall DefineDosDeviceW(long wstr wstr) @ stdcall DelayLoadFailureHook(str str) @ stdcall DeleteAtom(long) +@ stub -version=0x600+ DeleteBoundaryDescriptor @ stdcall DeleteCriticalSection(ptr) ntdll.RtlDeleteCriticalSection @ stdcall DeleteFiber(ptr) @ stdcall DeleteFileA(str) +@ stub -version=0x600+ DeleteFileTransactedA +@ stub -version=0x600+ DeleteFileTransactedW @ stdcall DeleteFileW(wstr) +@ stub -version=0x600+ DeleteProcThreadAttributeList @ stdcall DeleteTimerQueue(long) @ stdcall DeleteTimerQueueEx (long long) @ stdcall DeleteTimerQueueTimer(long long long) @@ -142,6 +209,7 @@ @ stdcall DeleteVolumeMountPointW(wstr) ;check @ stdcall DeviceIoControl(long long ptr long ptr long ptr ptr) @ stdcall DisableThreadLibraryCalls(long) +@ stub -version=0x600+ DisassociateCurrentThreadFromCallback @ stdcall DisconnectNamedPipe(long) @ stdcall DnsHostnameToComputerNameA (str ptr ptr) @ stdcall DnsHostnameToComputerNameW (wstr ptr ptr) @@ -157,19 +225,27 @@ @ stdcall EnterCriticalSection(ptr) ntdll.RtlEnterCriticalSection @ stdcall EnumCalendarInfoA(ptr long long long) @ stdcall EnumCalendarInfoExA(ptr long long long) +@ stub -version=0x600+ EnumCalendarInfoExEx @ stdcall EnumCalendarInfoExW(ptr long long long) @ stdcall EnumCalendarInfoW(ptr long long long) @ stdcall EnumDateFormatsA(ptr long long) @ stdcall EnumDateFormatsExA(ptr long long) +@ stub -version=0x600+ EnumDateFormatsExEx @ stdcall EnumDateFormatsExW(ptr long long) @ stdcall EnumDateFormatsW(ptr long long) @ stdcall EnumLanguageGroupLocalesA(ptr long long ptr) @ stdcall EnumLanguageGroupLocalesW(ptr long long ptr) @ stdcall EnumResourceLanguagesA(long str str ptr long) +@ stub -version=0x600+ EnumResourceLanguagesExA +@ stub -version=0x600+ EnumResourceLanguagesExW @ stdcall EnumResourceLanguagesW(long wstr wstr ptr long) @ stdcall EnumResourceNamesA(long str ptr long) +@ stub -version=0x600+ EnumResourceNamesExA +@ stub -version=0x600+ EnumResourceNamesExW @ stdcall EnumResourceNamesW(long wstr ptr long) @ stdcall EnumResourceTypesA(long ptr long) +@ stub -version=0x600+ EnumResourceTypesExA +@ stub -version=0x600+ EnumResourceTypesExW @ stdcall EnumResourceTypesW(long ptr long) @ stdcall EnumSystemCodePagesA(ptr long) @ stdcall EnumSystemCodePagesW(ptr long) @@ -178,8 +254,10 @@ @ stdcall EnumSystemLanguageGroupsA(ptr long ptr) @ stdcall EnumSystemLanguageGroupsW(ptr long ptr) @ stdcall EnumSystemLocalesA(ptr long) +@ stub -version=0x600+ EnumSystemLocalesEx @ stdcall EnumSystemLocalesW(ptr long) @ stdcall EnumTimeFormatsA(ptr long long) +@ stub -version=0x600+ EnumTimeFormatsEx @ stdcall EnumTimeFormatsW(ptr long long) @ stdcall EnumUILanguagesA(ptr long long) @ stdcall EnumUILanguagesW(ptr long long) @@ -215,14 +293,22 @@ @ stdcall FindFirstFileA(str ptr) @ stdcall FindFirstFileExA(str long ptr long ptr long) @ stdcall FindFirstFileExW(wstr long ptr long ptr long) +@ stub -version=0x600+ FindFirstFileNameTransactedW +@ stub -version=0x600+ FindFirstFileNameW +@ stub -version=0x600+ FindFirstFileTransactedA +@ stub -version=0x600+ FindFirstFileTransactedW @ stdcall FindFirstFileW(wstr ptr) +@ stub -version=0x600+ FindFirstStreamTransactedW @ stdcall FindFirstStreamW(wstr ptr ptr long) @ stdcall FindFirstVolumeA(ptr long) @ stdcall FindFirstVolumeMountPointA(str ptr long) @ stdcall FindFirstVolumeMountPointW(wstr ptr long) @ stdcall FindFirstVolumeW(ptr long) +@ stub -version=0x600+ FindNLSString +@ stub -version=0x600+ FindNLSStringEx @ stdcall FindNextChangeNotification(long) @ stdcall FindNextFileA(long ptr) +@ stub -version=0x600+ FindNextFileNameW @ stdcall FindNextFileW(long ptr) @ stdcall FindNextStreamW(ptr ptr) @ stdcall FindNextVolumeA(long ptr long) @@ -242,6 +328,7 @@ @ stdcall FlushConsoleInputBuffer(long) @ stdcall FlushFileBuffers(long) @ stdcall FlushInstructionCache(long long long) +@ stub -version=0x600+ FlushProcessWriteBuffers @ stdcall FlushViewOfFile(ptr long) @ stdcall FoldStringA(long str long ptr long) @ stdcall FoldStringW(long wstr long ptr long) @@ -252,21 +339,32 @@ @ stdcall FreeEnvironmentStringsW(ptr) @ stdcall FreeLibrary(long) @ stdcall FreeLibraryAndExitThread(long long) +@ stub -version=0x600+ FreeLibraryWhenCallbackReturns @ stdcall FreeResource(long) @ stdcall FreeUserPhysicalPages(long long long) @ stdcall GenerateConsoleCtrlEvent(long long) @ stdcall GetACP() +@ stub -version=0x600+ GetApplicationRecoveryCallback +@ stub -version=0x600+ GetApplicationRestartSettings @ stdcall GetAtomNameA(long ptr long) @ stdcall GetAtomNameW(long ptr long) @ stdcall GetBinaryType(str ptr) GetBinaryTypeA @ stdcall GetBinaryTypeA(str ptr) @ stdcall GetBinaryTypeW(wstr ptr) -@ stdcall GetCPFileNameFromRegistry(long wstr long) ;check missing in Win 7 +@ stdcall -version=0x501-0x600 GetCPFileNameFromRegistry(long wstr long) @ stdcall GetCPInfo(long ptr) @ stdcall GetCPInfoExA(long long ptr) @ stdcall GetCPInfoExW(long long ptr) +@ stub -version=0x600+ GetCalendarDateFormat +@ stub -version=0x600+ GetCalendarDateFormatEx +@ stub -version=0x600+ GetCalendarDaysInMonth +@ stub -version=0x600+ GetCalendarDifferenceInDays @ stdcall GetCalendarInfoA(long long long ptr long ptr) +@ stub -version=0x600+ GetCalendarInfoEx @ stdcall GetCalendarInfoW(long long long ptr long ptr) +@ stub -version=0x600+ GetCalendarMonthsInYear +@ stub -version=0x600+ GetCalendarSupportedDateRange +@ stub -version=0x600+ GetCalendarWeekNumber @ stdcall GetComPlusPackageInstallStatus() @ stdcall GetCommConfig(long ptr long) @ stdcall GetCommMask(long ptr) @@ -277,6 +375,8 @@ @ stdcall GetCommandLineA() @ stdcall GetCommandLineW() @ stdcall GetCompressedFileSizeA(long ptr) +@ stub -version=0x600+ GetCompressedFileSizeTransactedA +@ stub -version=0x600+ GetCompressedFileSizeTransactedW @ stdcall GetCompressedFileSizeW(long ptr) @ stdcall GetComputerNameA(ptr ptr) @ stdcall GetComputerNameExA(long ptr ptr) @@ -304,6 +404,7 @@ @ stdcall GetConsoleFontInfo(long long long ptr) @ stdcall GetConsoleFontSize(long long) @ stdcall GetConsoleHardwareState(long long ptr) +@ stub -version=0x600+ GetConsoleHistoryInfo @ stdcall GetConsoleInputExeNameA(long ptr) @ stdcall GetConsoleInputExeNameW(long ptr) @ stdcall GetConsoleInputWaitHandle() @@ -311,17 +412,22 @@ @ stdcall GetConsoleKeyboardLayoutNameW(ptr) @ stdcall GetConsoleMode(long ptr) @ stdcall GetConsoleNlsMode(long ptr) +@ stub -version=0x600+ GetConsoleOriginalTitleA +@ stub -version=0x600+ GetConsoleOriginalTitleW @ stdcall GetConsoleOutputCP() @ stdcall GetConsoleProcessList(ptr long) ; missing in XP SP3 @ stdcall GetConsoleScreenBufferInfo(long ptr) +@ stub -version=0x600+ GetConsoleScreenBufferInfoEx @ stdcall GetConsoleSelectionInfo(ptr) @ stdcall GetConsoleTitleA(ptr long) @ stdcall GetConsoleTitleW(ptr long) @ stdcall GetConsoleWindow() @ stdcall GetCurrencyFormatA(long long str ptr str long) +@ stub -version=0x600+ GetCurrencyFormatEx @ stdcall GetCurrencyFormatW(long long str ptr str long) @ stdcall GetCurrentActCtx(ptr) @ stdcall GetCurrentConsoleFont(long long ptr) +@ stub -version=0x600+ GetCurrentConsoleFontEx @ stdcall GetCurrentDirectoryA(long ptr) @ stdcall GetCurrentDirectoryW(long ptr) @ stdcall -norelay GetCurrentProcess() @@ -330,10 +436,11 @@ @ stdcall -norelay GetCurrentThread() @ stdcall -norelay GetCurrentThreadId() @ stdcall GetDateFormatA(long long ptr str ptr long) +@ stub -version=0x600+ GetDateFormatEx @ stdcall GetDateFormatW(long long ptr wstr ptr long) @ stdcall GetDefaultCommConfigA(str ptr long) @ stdcall GetDefaultCommConfigW(wstr ptr long) -@ stdcall GetDefaultSortkeySize(ptr) ; missing in Win 7 +@ stdcall -version=0x501-0x502 GetDefaultSortkeySize(ptr) @ stdcall GetDevicePowerState(long ptr) @ stdcall GetDiskFreeSpaceA(str ptr ptr ptr ptr) @ stdcall GetDiskFreeSpaceExA (str ptr ptr ptr) @@ -343,11 +450,15 @@ @ stdcall GetDllDirectoryW(long ptr) @ stdcall GetDriveTypeA(str) @ stdcall GetDriveTypeW(wstr) +@ stub -version=0x600+ GetDurationFormat +@ stub -version=0x600+ GetDurationFormatEx +@ stub -version=0x600+ GetDynamicTimeZoneInformation @ stdcall GetEnvironmentStrings() @ stdcall GetEnvironmentStringsA() GetEnvironmentStrings @ stdcall GetEnvironmentStringsW() @ stdcall GetEnvironmentVariableA(str ptr long) @ stdcall GetEnvironmentVariableW(wstr ptr long) +@ stub -version=0x600+ GetErrorMode @ stdcall GetExitCodeProcess(long ptr) @ stdcall GetExitCodeThread(long ptr) @ stdcall GetExpandedNameA(str ptr) @@ -355,15 +466,25 @@ @ stdcall GetFileAttributesA(str) @ stdcall GetFileAttributesExA(str long ptr) @ stdcall GetFileAttributesExW(wstr long ptr) +@ stub -version=0x600+ GetFileAttributesTransactedA +@ stub -version=0x600+ GetFileAttributesTransactedW @ stdcall GetFileAttributesW(wstr) +@ stub -version=0x600+ GetFileBandwidthReservation @ stdcall GetFileInformationByHandle(long ptr) +@ stub -version=0x600+ GetFileInformationByHandleEx +@ stub -version=0x600+ GetFileMUIInfo +@ stub -version=0x600+ GetFileMUIPath @ stdcall GetFileSize(long ptr) @ stdcall GetFileSizeEx(long ptr) @ stdcall GetFileTime(long ptr ptr ptr) @ stdcall GetFileType(long) +@ stub -version=0x600+ GetFinalPathNameByHandleA +@ stub -version=0x600+ GetFinalPathNameByHandleW @ stdcall GetFirmwareEnvironmentVariableA(str str ptr long) @ stdcall GetFirmwareEnvironmentVariableW(wstr wstr ptr long) @ stdcall GetFullPathNameA(str long ptr ptr) +@ stub -version=0x600+ GetFullPathNameTransactedA +@ stub -version=0x600+ GetFullPathNameTransactedW @ stdcall GetFullPathNameW(wstr long ptr ptr) @ stdcall GetGeoInfoA(long long ptr long long) @ stdcall GetGeoInfoW(long long ptr long long) @@ -372,15 +493,18 @@ @ stdcall GetLargePageMinimum() @ stdcall GetLargestConsoleWindowSize(long) @ stdcall GetLastError() ntdll.RtlGetLastWin32Error -@ stdcall GetLinguistLangSize(ptr) ; missing in Win 7 +@ stdcall -version=0x500-0x502 GetLinguistLangSize(ptr) @ stdcall GetLocalTime(ptr) @ stdcall GetLocaleInfoA(long long ptr long) +@ stub -version=0x600+ GetLocaleInfoEx @ stdcall GetLocaleInfoW(long long ptr long) @ stdcall GetLogicalDriveStringsA(long ptr) @ stdcall GetLogicalDriveStringsW(long ptr) @ stdcall GetLogicalDrives() @ stdcall GetLogicalProcessorInformation(ptr ptr) @ stdcall GetLongPathNameA (str long long) +@ stub -version=0x600+ GetLongPathNameTransactedA +@ stub -version=0x600+ GetLongPathNameTransactedW @ stdcall GetLongPathNameW (wstr long long) @ stdcall GetMailslotInfo(long ptr ptr ptr ptr) @ stdcall GetModuleFileNameA(long ptr long) @@ -390,23 +514,34 @@ @ stdcall GetModuleHandleExW(long ptr ptr) @ stdcall GetModuleHandleW(wstr) @ stdcall GetNLSVersion(long long ptr) +@ stub -version=0x600+ GetNLSVersionEx +@ stub -version=0x600+ GetNamedPipeAttribute +@ stub -version=0x600+ GetNamedPipeClientComputerNameA +@ stub -version=0x600+ GetNamedPipeClientComputerNameW +@ stub -version=0x600+ GetNamedPipeClientProcessId +@ stub -version=0x600+ GetNamedPipeClientSessionId @ stdcall GetNamedPipeHandleStateA(long ptr ptr ptr ptr str long) @ stdcall GetNamedPipeHandleStateW(long ptr ptr ptr ptr wstr long) @ stdcall GetNamedPipeInfo(long ptr ptr ptr ptr) +@ stub -version=0x600+ GetNamedPipeServerProcessId +@ stub -version=0x600+ GetNamedPipeServerSessionId @ stdcall GetNativeSystemInfo(ptr) @ stdcall GetNextVDMCommand(long) -@ stdcall GetNlsSectionName(long long long str str long) ; missing in Win 7 +@ stdcall -version=0x500-0x502 GetNlsSectionName(long long long str str long) @ stdcall GetNumaAvailableMemoryNode(long ptr) @ stdcall GetNumaHighestNodeNumber(ptr) @ stdcall GetNumaNodeProcessorMask(long ptr) @ stdcall GetNumaProcessorNode(long ptr) +@ stub -version=0x600+ GetNumaProximityNode @ stdcall GetNumberFormatA(long long str ptr ptr long) +@ stub -version=0x600+ GetNumberFormatEx @ stdcall GetNumberFormatW(long long wstr ptr ptr long) @ stdcall GetNumberOfConsoleFonts() @ stdcall GetNumberOfConsoleInputEvents(long ptr) @ stdcall GetNumberOfConsoleMouseButtons(ptr) @ stdcall GetOEMCP() @ stdcall GetOverlappedResult(long ptr ptr long) +@ stub -version=0x600+ GetPhysicallyInstalledSystemMemory @ stdcall GetPriorityClass(long) @ stdcall GetPrivateProfileIntA(str str long str) @ stdcall GetPrivateProfileIntW(wstr wstr long wstr) @@ -420,6 +555,7 @@ @ stdcall GetPrivateProfileStructW(wstr wstr ptr long wstr) @ stdcall GetProcAddress(long str) @ stdcall GetProcessAffinityMask(long ptr ptr) +@ stub -version=0x600+ GetProcessDEPPolicy @ stdcall GetProcessHandleCount(long ptr) @ stdcall -norelay GetProcessHeap() @ stdcall GetProcessHeaps(long ptr) @@ -432,6 +568,7 @@ @ stdcall GetProcessVersion(long) @ stdcall GetProcessWorkingSetSize(long ptr ptr) @ stdcall GetProcessWorkingSetSizeEx(long ptr ptr long) +@ stub -version=0x600+ GetProductInfo @ stdcall GetProfileIntA(str str long) @ stdcall GetProfileIntW(wstr wstr long) @ stdcall GetProfileSectionA(str ptr long) @@ -439,17 +576,21 @@ @ stdcall GetProfileStringA(str str str ptr long) @ stdcall GetProfileStringW(wstr wstr wstr ptr long) @ stdcall GetQueuedCompletionStatus(long ptr ptr ptr long) +@ stub -version=0x600+ GetQueuedCompletionStatusEx @ stdcall GetShortPathNameA(str ptr long) @ stdcall GetShortPathNameW(wstr ptr long) @ stdcall GetStartupInfoA(ptr) @ stdcall GetStartupInfoW(ptr) @ stdcall GetStdHandle(long) +@ stub -version=0x600+ GetStringScripts @ stdcall GetStringTypeA(long long str long ptr) @ stdcall GetStringTypeExA(long long str long ptr) @ stdcall GetStringTypeExW(long long wstr long ptr) @ stdcall GetStringTypeW(long wstr long ptr) +@ stub -version=0x600+ GetSystemDEPPolicy @ stdcall GetSystemDefaultLCID() @ stdcall GetSystemDefaultLangID() +@ stub -version=0x600+ GetSystemDefaultLocaleName @ stdcall GetSystemDefaultUILanguage() @ stdcall GetSystemDirectoryA(ptr long) @ stdcall GetSystemDirectoryW(ptr long) @@ -457,6 +598,7 @@ @ stdcall GetSystemFirmwareTable(long long ptr long) @ stdcall GetSystemInfo(ptr) @ stdcall GetSystemPowerStatus(ptr) +@ stub -version=0x600+ GetSystemPreferredUILanguages @ stdcall GetSystemRegistryQuota(ptr ptr) @ stdcall GetSystemTime(ptr) @ stdcall GetSystemTimeAdjustment(ptr ptr ptr) @@ -477,23 +619,32 @@ @ stdcall GetThreadIOPendingFlag(long ptr) @ stdcall GetThreadId(ptr) @ stdcall GetThreadLocale() +@ stub -version=0x600+ GetThreadPreferredUILanguages @ stdcall GetThreadPriority(long) @ stdcall GetThreadPriorityBoost(long ptr) @ stdcall GetThreadSelectorEntry(long long ptr) @ stdcall GetThreadTimes(long ptr ptr ptr ptr) +@ stub -version=0x600+ GetThreadUILanguage @ stdcall GetTickCount() +@ stub -version=0x600+ GetTickCount64 @ stdcall GetTimeFormatA(long long ptr str ptr long) +@ stub -version=0x600+ GetTimeFormatEx @ stdcall GetTimeFormatW(long long ptr wstr ptr long) @ stdcall GetTimeZoneInformation(ptr) +@ stub -version=0x600+ GetTimeZoneInformationForYear +@ stub -version=0x600+ GetUILanguageInfo @ stdcall GetUserDefaultLCID() @ stdcall GetUserDefaultLangID() +@ stub -version=0x600+ GetUserDefaultLocaleName @ stdcall GetUserDefaultUILanguage() @ stdcall GetUserGeoID(long) +@ stub -version=0x600+ GetUserPreferredUILanguages @ stdcall GetVDMCurrentDirectories(long long) @ stdcall GetVersion() @ stdcall GetVersionExA(ptr) @ stdcall GetVersionExW(ptr) @ stdcall GetVolumeInformationA(str ptr long ptr ptr ptr ptr long) +@ stub -version=0x600+ GetVolumeInformationByHandleW @ stdcall GetVolumeInformationW(wstr ptr long ptr ptr ptr ptr long) @ stdcall GetVolumeNameForVolumeMountPointA(str ptr long) @ stdcall GetVolumeNameForVolumeMountPointW(wstr ptr long) @@ -533,25 +684,36 @@ @ stdcall HeapAlloc(long long long) ntdll.RtlAllocateHeap @ stdcall HeapCompact(long long) @ stdcall HeapCreate(long long long) -@ stdcall HeapCreateTagsW(long long wstr wstr) ; missing in Win 7 +@ stdcall -version=0x351-0x502 HeapCreateTagsW(long long wstr wstr) @ stdcall HeapDestroy(long) -@ stdcall HeapExtend(long long ptr long) ; missing in Win 7 +@ stdcall -version=0x351-0x502 HeapExtend(long long ptr long) @ stdcall HeapFree(long long long) ntdll.RtlFreeHeap @ stdcall HeapLock(long) @ stdcall HeapQueryInformation(long long ptr long ptr) -@ stdcall HeapQueryTagW(long long long long ptr) ; missing in Win 7 +@ stdcall -version=0x351-0x502 HeapQueryTagW(long long long long ptr) @ stdcall HeapReAlloc(long long ptr long) ntdll.RtlReAllocateHeap @ stdcall HeapSetInformation(ptr long ptr long) @ stdcall HeapSize(long long ptr) ntdll.RtlSizeHeap @ stdcall HeapSummary(long long ptr) @ stdcall HeapUnlock(long) -@ stdcall HeapUsage(long long long long ptr) ; missing in Win 7 +@ stdcall -version=0x351-0x502 HeapUsage(long long long long ptr) @ stdcall HeapValidate(long long ptr) @ stdcall HeapWalk(long ptr) +@ stub -version=0x600+ IdnToAscii +@ stub -version=0x600+ IdnToNameprepUnicode +@ stub -version=0x600+ IdnToUnicode @ stdcall InitAtomTable(long) +@ stub -version=0x600+ InitOnceBeginInitialize +@ stub -version=0x600+ InitOnceComplete +@ stub -version=0x600+ InitOnceExecuteOnce +@ stub -version=0x600+ InitOnceInitialize +@ stub -version=0x600+ InitializeConditionVariable @ stdcall InitializeCriticalSection(ptr) @ stdcall InitializeCriticalSectionAndSpinCount(ptr long) +@ stub -version=0x600+ InitializeCriticalSectionEx +@ stub -version=0x600+ InitializeProcThreadAttributeList @ stdcall InitializeSListHead(ptr) ntdll.RtlInitializeSListHead +@ stub -version=0x600+ InitializeSRWLock @ stdcall -arch=i386 -ret64 InterlockedCompareExchange64(ptr double double) ntdll.RtlInterlockedCompareExchange64 @ stdcall -arch=i386 InterlockedCompareExchange (ptr long long) @ stdcall -arch=i386 InterlockedDecrement(ptr) @@ -561,6 +723,7 @@ @ stdcall -arch=i386 InterlockedIncrement(ptr) @ stdcall InterlockedPopEntrySList(ptr) ntdll.RtlInterlockedPopEntrySList @ stdcall InterlockedPushEntrySList(ptr ptr) ntdll.RtlInterlockedPushEntrySList +@ stub -version=0x600+ InterlockedPushListSList @ stdcall InvalidateConsoleDIBits(long long) @ stdcall IsBadCodePtr(ptr) @ stdcall IsBadHugeReadPtr(ptr long) @@ -569,20 +732,29 @@ @ stdcall IsBadStringPtrA(ptr long) @ stdcall IsBadStringPtrW(ptr long) @ stdcall IsBadWritePtr(ptr long) +@ stub -version=0x600+ IsCalendarLeapDay +@ stub -version=0x600+ IsCalendarLeapMonth +@ stub -version=0x600+ IsCalendarLeapYear @ stdcall IsDBCSLeadByte(long) @ stdcall IsDBCSLeadByteEx(long long) @ stdcall IsDebuggerPresent() @ stdcall IsNLSDefinedString(long long ptr long long) +@ stub -version=0x600+ IsNormalizedString @ stdcall IsProcessInJob(long long ptr) @ stdcall IsProcessorFeaturePresent(long) @ stdcall IsSystemResumeAutomatic() +@ stub -version=0x600+ IsThreadAFiber +@ stub -version=0x600+ IsThreadpoolTimerSet @ stdcall IsTimeZoneRedirectionEnabled() +@ stub -version=0x600+ IsValidCalDateTime @ stdcall IsValidCodePage(long) @ stdcall IsValidLanguageGroup(long long) @ stdcall IsValidLocale(long long) -@ stdcall IsValidUILanguage(long) ; missing in Win 7 +@ stdcall -version=0x501-0x502 IsValidUILanguage(long) @ stdcall IsWow64Process(ptr ptr) +@ stub -version=0x600+ LCIDToLocaleName @ stdcall LCMapStringA(long long str long ptr long) +@ stub -version=0x600+ LCMapStringEx @ stdcall LCMapStringW(long long wstr long ptr long) @ stdcall LZClose(long) @ stdcall LZCloseFile(long) @@ -596,12 +768,15 @@ @ stdcall LZSeek(long long long) @ stdcall LZStart() @ stdcall LeaveCriticalSection(ptr) ntdll.RtlLeaveCriticalSection +@ stub -version=0x600+ LeaveCriticalSectionWhenCallbackReturns @ stdcall LoadLibraryA(str) @ stdcall LoadLibraryExA( str long long) @ stdcall LoadLibraryExW(wstr long long) @ stdcall LoadLibraryW(wstr) @ stdcall LoadModule(str ptr) @ stdcall LoadResource(long long) +@ stub -version=0x600+ LoadStringBaseExW +@ stub -version=0x600+ LoadStringBaseW @ stdcall LocalAlloc(long long) @ stdcall LocalCompact(long) @ stdcall LocalFileTimeToFileTime(ptr ptr) @@ -613,6 +788,7 @@ @ stdcall LocalShrink(long long) @ stdcall LocalSize(long) @ stdcall LocalUnlock(long) +@ stub -version=0x600+ LocaleNameToLCID @ stdcall LockFile(long long long long long) @ stdcall LockFileEx(long long long long long ptr) @ stdcall LockResource(long) @@ -620,6 +796,7 @@ @ stdcall MapUserPhysicalPagesScatter(ptr long ptr) @ stdcall MapViewOfFile(long long long long long) @ stdcall MapViewOfFileEx(long long long long long ptr) +@ stub -version=0x600+ MapViewOfFileExNuma @ stdcall Module32First(long ptr) @ stdcall Module32FirstW(long ptr) @ stdcall Module32Next(long ptr) @@ -627,6 +804,8 @@ @ stdcall MoveFileA(str str) @ stdcall MoveFileExA(str str long) @ stdcall MoveFileExW(wstr wstr long) +@ stub -version=0x600+ MoveFileTransactedA +@ stub -version=0x600+ MoveFileTransactedW @ stdcall MoveFileW(wstr wstr) @ stdcall MoveFileWithProgressA(str str ptr ptr long) @ stdcall MoveFileWithProgressW(wstr wstr ptr ptr long) @@ -634,20 +813,30 @@ @ stdcall MultiByteToWideChar(long long str long ptr long) @ stdcall NeedCurrentDirectoryForExePathA(str) @ stdcall NeedCurrentDirectoryForExePathW(wstr) -@ stdcall NlsConvertIntegerToString(long long long wstr long) ; missing in Win 7 +@ stub -version=0x600+ NlsCheckPolicy +@ stdcall -version=0x500-0x600 NlsConvertIntegerToString(long long long wstr long) +@ stub -version=0x600+ NlsEventDataDescCreate @ stdcall NlsGetCacheUpdateCount() -@ stdcall NlsResetProcessLocale() +@ stdcall -version=0x500-0x502 NlsResetProcessLocale() +@ stub -version=0x600+ NlsUpdateLocale +@ stub -version=0x600+ NlsUpdateSystemLocale +@ stub -version=0x600+ NlsWriteEtwEvent +@ stub -version=0x600+ NormalizeString +@ stub -version=0x600+ NotifyUILanguageChange @ stdcall OpenConsoleW(wstr long long long) -@ stdcall OpenDataFile(long long) ; missing in Win 7 +@ stdcall -version=0x500-0x502 OpenDataFile(long long) @ stdcall OpenEventA(long long str) @ stdcall OpenEventW(long long wstr) @ stdcall OpenFile(str ptr long) +@ stub -version=0x600+ OpenFileById @ stdcall OpenFileMappingA(long long str) @ stdcall OpenFileMappingW(long long wstr) @ stdcall OpenJobObjectA(long long str) @ stdcall OpenJobObjectW(long long wstr) @ stdcall OpenMutexA(long long str) @ stdcall OpenMutexW(long long wstr) +@ stub -version=0x600+ OpenPrivateNamespaceA +@ stub -version=0x600+ OpenPrivateNamespaceW @ stdcall OpenProcess(long long long) @ stdcall OpenProfileUserMapping() @ stdcall OpenSemaphoreA(long long str) @@ -671,14 +860,21 @@ @ stdcall ProcessIdToSessionId(long ptr) @ stdcall PulseEvent(long) @ stdcall PurgeComm(long long) +@ stub -version=0x600+ QueryActCtxSettingsW @ stdcall QueryActCtxW(long ptr ptr long ptr long ptr) @ stdcall QueryDepthSList(ptr) ntdll.RtlQueryDepthSList @ stdcall QueryDosDeviceA(str ptr long) @ stdcall QueryDosDeviceW(wstr ptr long) +@ stub -version=0x600+ QueryFullProcessImageNameA +@ stub -version=0x600+ QueryFullProcessImageNameW +@ stub -version=0x600+ QueryIdleProcessorCycleTime @ stdcall QueryInformationJobObject(long long ptr long ptr) @ stdcall QueryMemoryResourceNotification(ptr ptr) @ stdcall QueryPerformanceCounter(ptr) @ stdcall QueryPerformanceFrequency(ptr) +@ stub -version=0x600+ QueryProcessAffinityUpdateMode +@ stub -version=0x600+ QueryProcessCycleTime +@ stub -version=0x600+ QueryThreadCycleTime @ stdcall QueueUserAPC(ptr long long) @ stdcall QueueUserWorkItem(ptr ptr long) @ stdcall -norelay RaiseException(long long long ptr) @@ -699,6 +895,8 @@ @ stdcall ReadFileEx(long ptr long ptr ptr) @ stdcall ReadFileScatter(long ptr long ptr ptr) @ stdcall ReadProcessMemory(long ptr ptr long ptr) +@ stub -version=0x600+ RegisterApplicationRecoveryCallback +@ stub -version=0x600+ RegisterApplicationRestart @ stdcall RegisterConsoleIME(ptr ptr) @ stdcall RegisterConsoleOS2(long) @ stdcall RegisterConsoleVDM(long long long long long long long long long long long) @@ -709,16 +907,24 @@ @ stdcall RegisterWowExec(long) @ stdcall ReleaseActCtx(ptr) @ stdcall ReleaseMutex(long) +@ stub -version=0x600+ ReleaseMutexWhenCallbackReturns +@ stub -version=0x600+ ReleaseSRWLockExclusive +@ stub -version=0x600+ ReleaseSRWLockShared @ stdcall ReleaseSemaphore(long long ptr) +@ stub -version=0x600+ ReleaseSemaphoreWhenCallbackReturns @ stdcall RemoveDirectoryA(str) +@ stub -version=0x600+ RemoveDirectoryTransactedA +@ stub -version=0x600+ RemoveDirectoryTransactedW @ stdcall RemoveDirectoryW(wstr) @ stdcall RemoveLocalAlternateComputerNameA(str long) @ stdcall RemoveLocalAlternateComputerNameW(wstr long) +@ stub -version=0x600+ RemoveSecureMemoryCacheCallback @ stdcall RemoveVectoredContinueHandler(ptr) ntdll.RtlRemoveVectoredContinueHandler @ stdcall RemoveVectoredExceptionHandler(ptr) ntdll.RtlRemoveVectoredExceptionHandler @ stdcall ReplaceFile(wstr wstr wstr long ptr ptr) ReplaceFileW @ stdcall ReplaceFileA(str str str long ptr ptr) @ stdcall ReplaceFileW(wstr wstr wstr long ptr ptr) +@ stub -version=0x600+ ReplacePartitionUnit @ stdcall RequestDeviceWakeup(long) @ stdcall RequestWakeupLatency(long) @ stdcall ResetEvent(long) @@ -746,7 +952,7 @@ @ stdcall ScrollConsoleScreenBufferW(long ptr ptr ptr ptr) @ stdcall SearchPathA(str str str long ptr ptr) @ stdcall SearchPathW(wstr wstr wstr long ptr ptr) -@ stdcall SetCPGlobal(long) ; missing in Win 7 +@ stdcall -version=0x500-0x502 SetCPGlobal(long) @ stdcall SetCalendarInfoA(long long long str) @ stdcall SetCalendarInfoW(long long long wstr) @ stdcall SetClientTimeZoneInformation(ptr) @@ -762,7 +968,7 @@ @ stdcall SetComputerNameW(wstr) @ stdcall SetConsoleActiveScreenBuffer(long) @ stdcall SetConsoleCP(long) -@ stdcall SetConsoleCommandHistoryMode(long) ; missing in win 7 +@ stdcall -version=0x351-0x502 SetConsoleCommandHistoryMode(long) @ stdcall SetConsoleCtrlHandler(ptr long) @ stdcall SetConsoleCursor(long long) @ stdcall SetConsoleCursorInfo(long ptr) @@ -771,6 +977,7 @@ @ stdcall SetConsoleDisplayMode(long long ptr) @ stdcall SetConsoleFont(long long) @ stdcall SetConsoleHardwareState(long long long) +@ stub -version=0x600+ SetConsoleHistoryInfo @ stdcall SetConsoleIcon(ptr) @ stdcall SetConsoleInputExeNameA(ptr) @ stdcall SetConsoleInputExeNameW(ptr) @@ -785,18 +992,21 @@ @ stdcall SetConsoleOS2OemFormat(long) @ stdcall SetConsoleOutputCP(long) @ stdcall SetConsolePalette(long long long) +@ stub -version=0x600+ SetConsoleScreenBufferInfoEx @ stdcall SetConsoleScreenBufferSize(long long) @ stdcall SetConsoleTextAttribute(long long) @ stdcall SetConsoleTitleA(str) @ stdcall SetConsoleTitleW(wstr) @ stdcall SetConsoleWindowInfo(long long ptr) @ stdcall SetCriticalSectionSpinCount(ptr long) ntdll.RtlSetCriticalSectionSpinCount +@ stub -version=0x600+ SetCurrentConsoleFontEx @ stdcall SetCurrentDirectoryA(str) @ stdcall SetCurrentDirectoryW(wstr) @ stdcall SetDefaultCommConfigA(str ptr long) @ stdcall SetDefaultCommConfigW(wstr ptr long) @ stdcall SetDllDirectoryA(str) @ stdcall SetDllDirectoryW(wstr) +@ stub -version=0x600+ SetDynamicTimeZoneInformation @ stdcall SetEndOfFile(long) @ stdcall SetEnvironmentStringsA(ptr) @ stdcall SetEnvironmentStringsW(ptr) @@ -804,11 +1014,17 @@ @ stdcall SetEnvironmentVariableW(wstr wstr) @ stdcall SetErrorMode(long) @ stdcall SetEvent(long) +@ stub -version=0x600+ SetEventWhenCallbackReturns @ stdcall SetFileApisToANSI() @ stdcall SetFileApisToOEM() @ stdcall SetFileAttributesA(str long) +@ stub -version=0x600+ SetFileAttributesTransactedA +@ stub -version=0x600+ SetFileAttributesTransactedW @ stdcall SetFileAttributesW(wstr long) +@ stub -version=0x600+ SetFileBandwidthReservation @ stdcall SetFileCompletionNotificationModes(ptr long) +@ stub -version=0x600+ SetFileInformationByHandle +@ stub -version=0x600+ SetFileIoOverlappedRange @ stdcall SetFilePointer(long long ptr long) @ stdcall SetFilePointerEx(long double ptr long) @ stdcall SetFileShortNameA(long str) @@ -817,7 +1033,7 @@ @ stdcall SetFileValidData(long double) @ stdcall SetFirmwareEnvironmentVariableA(str str ptr long) @ stdcall SetFirmwareEnvironmentVariableW(wstr wstr ptr long) -@ stdcall -i386 SetHandleContext(long long) ; missing in Win 7 x64 +@ stdcall -i386 SetHandleContext(long long) @ stdcall SetHandleCount(long) @ stdcall SetHandleInformation(long long long) @ stdcall SetInformationJobObject(long long ptr long) @@ -830,14 +1046,18 @@ @ stdcall SetLocaleInfoW(long long wstr) @ stdcall SetMailslotInfo(long long) @ stdcall SetMessageWaitingIndicator(ptr long) +@ stub -version=0x600+ SetNamedPipeAttribute @ stdcall SetNamedPipeHandleState(long ptr ptr ptr) @ stdcall SetPriorityClass(long long) @ stdcall SetProcessAffinityMask(long long) +@ stub -version=0x600+ SetProcessAffinityUpdateMode +@ stub -version=0x600+ SetProcessDEPPolicy @ stdcall SetProcessPriorityBoost(long long) @ stdcall SetProcessShutdownParameters(long long) @ stdcall SetProcessWorkingSetSize(long long long) @ stdcall SetProcessWorkingSetSizeEx(long long long long) @ stdcall SetStdHandle(long long) +@ stub -version=0x600+ SetStdHandleEx @ stdcall SetSystemFileCacheSize(long long long) @ stdcall SetSystemPowerState(long long) @ stdcall SetSystemTime(ptr) @@ -850,10 +1070,15 @@ @ stdcall SetThreadExecutionState(long) @ stdcall SetThreadIdealProcessor(long long) @ stdcall SetThreadLocale(long) +@ stub -version=0x600+ SetThreadPreferredUILanguages @ stdcall SetThreadPriority(long long) @ stdcall SetThreadPriorityBoost(long long) @ stdcall SetThreadStackGuarantee(ptr) @ stdcall SetThreadUILanguage(long) +@ stub -version=0x600+ SetThreadpoolThreadMaximum +@ stub -version=0x600+ SetThreadpoolThreadMinimum +@ stub -version=0x600+ SetThreadpoolTimer +@ stub -version=0x600+ SetThreadpoolWait @ stdcall SetTimeZoneInformation(ptr) @ stdcall SetTimerQueueTimer(long ptr ptr long long long) @ stdcall SetUnhandledExceptionFilter(ptr) @@ -869,7 +1094,11 @@ @ stdcall SignalObjectAndWait(long long long long) @ stdcall SizeofResource(long long) @ stdcall Sleep(long) +@ stub -version=0x600+ SleepConditionVariableCS +@ stub -version=0x600+ SleepConditionVariableSRW @ stdcall SleepEx(long long) +@ stub -version=0x600+ StartThreadpoolIo +@ stub -version=0x600+ SubmitThreadpoolWork @ stdcall SuspendThread(long) @ stdcall SwitchToFiber(ptr) @ stdcall SwitchToThread() @@ -889,6 +1118,7 @@ @ stdcall TransactNamedPipe(long ptr long ptr long ptr ptr) @ stdcall TransmitCommChar(long long) @ stdcall TryEnterCriticalSection(ptr) ntdll.RtlTryEnterCriticalSection +@ stub -version=0x600+ TrySubmitThreadpoolCallback @ stdcall TzSpecificLocalTimeToSystemTime(ptr ptr ptr) @ stdcall UTRegister(long str str str ptr ptr ptr) @ stdcall UTUnRegister(long) @@ -896,23 +1126,29 @@ @ stdcall UnlockFile(long long long long long) @ stdcall UnlockFileEx(long long long long ptr) @ stdcall UnmapViewOfFile(ptr) +@ stub -version=0x600+ UnregisterApplicationRecoveryCallback +@ stub -version=0x600+ UnregisterApplicationRestart @ stdcall UnregisterConsoleIME() @ stdcall UnregisterWait(long) @ stdcall UnregisterWaitEx(long long) +@ stub -version=0x600+ UpdateCalendarDayOfWeek +@ stub -version=0x600+ UpdateProcThreadAttribute @ stdcall UpdateResourceA(long str str long ptr long) @ stdcall UpdateResourceW(long wstr wstr long ptr long) @ stdcall VDMConsoleOperation(long long) @ stdcall VDMOperationStarted(long) -@ stdcall ValidateLCType(long long ptr ptr) -@ stdcall ValidateLocale(long) +@ stdcall -version=0x500-0x502 ValidateLCType(long long ptr ptr) +@ stdcall -version=0x500-0x502 ValidateLocale(long) @ stdcall VerLanguageNameA(long str long) @ stdcall VerLanguageNameW(long wstr long) @ stdcall -ret64 VerSetConditionMask(long long long long) ntdll.VerSetConditionMask @ stdcall VerifyConsoleIoHandle(long) +@ stub -version=0x600+ VerifyScripts @ stdcall VerifyVersionInfoA(long long double) @ stdcall VerifyVersionInfoW(long long double) @ stdcall VirtualAlloc(ptr long long long) @ stdcall VirtualAllocEx(long ptr long long long) +@ stub -version=0x600+ VirtualAllocExNuma @ stdcall VirtualFree(ptr long long) @ stdcall VirtualFreeEx(long ptr long long) @ stdcall VirtualLock(ptr long) @@ -928,13 +1164,34 @@ @ stdcall WaitForMultipleObjectsEx(long ptr long long long) @ stdcall WaitForSingleObject(long long) @ stdcall WaitForSingleObjectEx(long long long) +@ stub -version=0x600+ WaitForThreadpoolIoCallbacks +@ stub -version=0x600+ WaitForThreadpoolTimerCallbacks +@ stub -version=0x600+ WaitForThreadpoolWaitCallbacks +@ stub -version=0x600+ WaitForThreadpoolWorkCallbacks @ stdcall WaitNamedPipeA (str long) @ stdcall WaitNamedPipeW (wstr long) +@ stub -version=0x600+ WakeAllConditionVariable +@ stub -version=0x600+ WakeConditionVariable +@ stub -version=0x600+ WerGetFlags +@ stub -version=0x600+ WerRegisterFile +@ stub -version=0x600+ WerRegisterMemoryBlock +@ stub -version=0x600+ WerSetFlags +@ stub -version=0x600+ WerUnregisterFile +@ stub -version=0x600+ WerUnregisterMemoryBlock +@ stub -version=0x600+ WerpCleanupMessageMapping +@ stub -version=0x600+ WerpInitiateRemoteRecovery +@ stub -version=0x600+ WerpNotifyLoadStringResource +@ stub -version=0x600+ WerpNotifyLoadStringResourceEx +@ stub -version=0x600+ WerpNotifyUseStringResource +@ stub -version=0x600+ WerpStringLookup @ stdcall WideCharToMultiByte(long long wstr long ptr long ptr ptr) @ stdcall WinExec(str long) @ stdcall Wow64DisableWow64FsRedirection(ptr) @ stdcall Wow64EnableWow64FsRedirection(long) +@ stub -version=0x600+ Wow64GetThreadContext @ stdcall Wow64RevertWow64FsRedirection(ptr) +@ stub -version=0x600+ Wow64SetThreadContext +@ stub -version=0x600+ Wow64SuspendThread @ stdcall WriteConsoleA(long ptr long ptr ptr) @ stdcall WriteConsoleInputA(long ptr long ptr) @ stdcall WriteConsoleInputVDMA(long long long long)
6 years, 8 months
1
0
0
0
02/03: [KERNEL32] Go back to auto-numbering of export ordinals Using static numbers was a bad idea in the first place, since we already deal with x64, which has different ordinals. Also @ will automatically do the same thing! It does not mean "no ordinal", it only means automatically apply incrementing numbers.
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=87d3f1005b8104da72c6c…
commit 87d3f1005b8104da72c6c14ffd2c5611f6c4a98d Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Feb 18 22:06:30 2018 +0100 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Apr 21 18:31:27 2018 +0200 [KERNEL32] Go back to auto-numbering of export ordinals Using static numbers was a bad idea in the first place, since we already deal with x64, which has different ordinals. Also @ will automatically do the same thing! It does not mean "no ordinal", it only means automatically apply incrementing numbers. --- dll/win32/kernel32/kernel32.spec | 1950 +++++++++++++++++++------------------- 1 file changed, 975 insertions(+), 975 deletions(-) diff --git a/dll/win32/kernel32/kernel32.spec b/dll/win32/kernel32/kernel32.spec index 25b47afc8e..3bb84242c5 100644 --- a/dll/win32/kernel32/kernel32.spec +++ b/dll/win32/kernel32/kernel32.spec @@ -1,997 +1,997 @@ -1 stdcall ActivateActCtx(ptr ptr) -2 stdcall AddAtomA(str) -3 stdcall AddAtomW(wstr) -4 stdcall AddConsoleAliasA(str str str) ;check -5 stdcall AddConsoleAliasW(wstr wstr wstr) ;check -6 stdcall AddLocalAlternateComputerNameA(str ptr) -7 stdcall AddLocalAlternateComputerNameW(wstr ptr) -8 stdcall AddRefActCtx(ptr) -9 stdcall AddVectoredContinueHandler(long ptr) ntdll.RtlAddVectoredContinueHandler -10 stdcall AddVectoredExceptionHandler(long ptr) ntdll.RtlAddVectoredExceptionHandler -11 stdcall AllocConsole() -12 stdcall AllocateUserPhysicalPages(long ptr ptr) -13 stdcall AreFileApisANSI() -14 stdcall AssignProcessToJobObject(ptr ptr) -15 stdcall AttachConsole(long) -16 stdcall BackupRead(ptr ptr long ptr long long ptr) -17 stdcall BackupSeek(ptr long long ptr ptr ptr) -18 stdcall BackupWrite(ptr ptr long ptr long long ptr) -19 stdcall BaseCheckAppcompatCache(long long long ptr) -20 stdcall BaseCheckRunApp(long ptr long long long long long long long long) -21 stdcall BaseCleanupAppcompatCacheSupport(ptr) -22 stdcall BaseDumpAppcompatCache() -23 stdcall BaseFlushAppcompatCache() -24 stdcall BaseInitAppcompatCacheSupport() -25 stdcall BaseIsAppcompatInfrastructureDisabled() IsShimInfrastructureDisabled -26 stdcall BaseProcessInitPostImport() ; missing in Win 7 +@ stdcall ActivateActCtx(ptr ptr) +@ stdcall AddAtomA(str) +@ stdcall AddAtomW(wstr) +@ stdcall AddConsoleAliasA(str str str) ;check +@ stdcall AddConsoleAliasW(wstr wstr wstr) ;check +@ stdcall AddLocalAlternateComputerNameA(str ptr) +@ stdcall AddLocalAlternateComputerNameW(wstr ptr) +@ stdcall AddRefActCtx(ptr) +@ stdcall AddVectoredContinueHandler(long ptr) ntdll.RtlAddVectoredContinueHandler +@ stdcall AddVectoredExceptionHandler(long ptr) ntdll.RtlAddVectoredExceptionHandler +@ stdcall AllocConsole() +@ stdcall AllocateUserPhysicalPages(long ptr ptr) +@ stdcall AreFileApisANSI() +@ stdcall AssignProcessToJobObject(ptr ptr) +@ stdcall AttachConsole(long) +@ stdcall BackupRead(ptr ptr long ptr long long ptr) +@ stdcall BackupSeek(ptr long long ptr ptr ptr) +@ stdcall BackupWrite(ptr ptr long ptr long long ptr) +@ stdcall BaseCheckAppcompatCache(long long long ptr) +@ stdcall BaseCheckRunApp(long ptr long long long long long long long long) +@ stdcall BaseCleanupAppcompatCacheSupport(ptr) +@ stdcall BaseDumpAppcompatCache() +@ stdcall BaseFlushAppcompatCache() +@ stdcall BaseInitAppcompatCacheSupport() +@ stdcall BaseIsAppcompatInfrastructureDisabled() IsShimInfrastructureDisabled +@ stdcall BaseProcessInitPostImport() ; missing in Win 7 ;@ stdcall -arch=x86_64 BaseProcessStart() -27 stdcall BaseQueryModuleData(str str ptr ptr ptr) ;check +@ stdcall BaseQueryModuleData(str str ptr ptr ptr) ;check ;@ stdcall -arch=x86_64 BaseThreadStart() -28 stdcall BaseUpdateAppcompatCache(long long long) -29 stdcall BasepCheckBadapp(long ptr long long long long long long long) -30 stdcall BasepCheckWinSaferRestrictions(long long long long long long) -31 stdcall BasepFreeAppCompatData(ptr ptr) -32 stdcall Beep(long long) -33 stdcall BeginUpdateResourceA(str long) -34 stdcall BeginUpdateResourceW(wstr long) -35 stdcall BindIoCompletionCallback(long ptr long) -36 stdcall BuildCommDCBA(str ptr) -37 stdcall BuildCommDCBAndTimeoutsA(str ptr ptr) -38 stdcall BuildCommDCBAndTimeoutsW(wstr ptr ptr) -39 stdcall BuildCommDCBW(wstr ptr) -40 stdcall CallNamedPipeA(str ptr long ptr long ptr long) -41 stdcall CallNamedPipeW(wstr ptr long ptr long ptr long) -42 stdcall CancelDeviceWakeupRequest(long) -43 stdcall CancelIo(long) -44 stdcall CancelTimerQueueTimer(long long) -45 stdcall CancelWaitableTimer(long) -46 stdcall ChangeTimerQueueTimer(ptr ptr long long) -47 stdcall CheckNameLegalDOS8Dot3A(str str long long long) -48 stdcall CheckNameLegalDOS8Dot3W(wstr str long long long) -49 stdcall CheckRemoteDebuggerPresent(long ptr) -50 stdcall ClearCommBreak(long) -51 stdcall ClearCommError(long ptr ptr) -52 stdcall CloseConsoleHandle(long) -53 stdcall CloseHandle(long) -54 stdcall CloseProfileUserMapping() -55 stdcall CmdBatNotification(long) -56 stdcall CommConfigDialogA(str long ptr) -57 stdcall CommConfigDialogW(wstr long ptr) -58 stdcall CompareFileTime(ptr ptr) -59 stdcall CompareStringA(long long str long str long) -60 stdcall CompareStringW(long long wstr long wstr long) -61 stdcall ConnectNamedPipe(long ptr) +@ stdcall BaseUpdateAppcompatCache(long long long) +@ stdcall BasepCheckBadapp(long ptr long long long long long long long) +@ stdcall BasepCheckWinSaferRestrictions(long long long long long long) +@ stdcall BasepFreeAppCompatData(ptr ptr) +@ stdcall Beep(long long) +@ stdcall BeginUpdateResourceA(str long) +@ stdcall BeginUpdateResourceW(wstr long) +@ stdcall BindIoCompletionCallback(long ptr long) +@ stdcall BuildCommDCBA(str ptr) +@ stdcall BuildCommDCBAndTimeoutsA(str ptr ptr) +@ stdcall BuildCommDCBAndTimeoutsW(wstr ptr ptr) +@ stdcall BuildCommDCBW(wstr ptr) +@ stdcall CallNamedPipeA(str ptr long ptr long ptr long) +@ stdcall CallNamedPipeW(wstr ptr long ptr long ptr long) +@ stdcall CancelDeviceWakeupRequest(long) +@ stdcall CancelIo(long) +@ stdcall CancelTimerQueueTimer(long long) +@ stdcall CancelWaitableTimer(long) +@ stdcall ChangeTimerQueueTimer(ptr ptr long long) +@ stdcall CheckNameLegalDOS8Dot3A(str str long long long) +@ stdcall CheckNameLegalDOS8Dot3W(wstr str long long long) +@ stdcall CheckRemoteDebuggerPresent(long ptr) +@ stdcall ClearCommBreak(long) +@ stdcall ClearCommError(long ptr ptr) +@ stdcall CloseConsoleHandle(long) +@ stdcall CloseHandle(long) +@ stdcall CloseProfileUserMapping() +@ stdcall CmdBatNotification(long) +@ stdcall CommConfigDialogA(str long ptr) +@ stdcall CommConfigDialogW(wstr long ptr) +@ stdcall CompareFileTime(ptr ptr) +@ stdcall CompareStringA(long long str long str long) +@ stdcall CompareStringW(long long wstr long wstr long) +@ stdcall ConnectNamedPipe(long ptr) ;@ stdcall -arch=x86_64 ConsoleIMERoutine() -62 stdcall ConsoleMenuControl(long long long) -63 stdcall ContinueDebugEvent(long long long) -64 stdcall ConvertDefaultLocale (long) -65 stdcall ConvertFiberToThread() -66 stdcall ConvertThreadToFiber(ptr) -67 stdcall ConvertThreadToFiberEx(ptr long) -68 stdcall CopyFileA(str str long) -69 stdcall CopyFileExA (str str ptr ptr ptr long) -70 stdcall CopyFileExW (wstr wstr ptr ptr ptr long) -71 stdcall CopyFileW(wstr wstr long) -72 stdcall CopyLZFile(long long) LZCopy -73 stdcall CreateActCtxA(ptr) -74 stdcall CreateActCtxW(ptr) -75 stdcall CreateConsoleScreenBuffer(long long ptr long ptr) -76 stdcall CreateDirectoryA(str ptr) -77 stdcall CreateDirectoryExA(str str ptr) -78 stdcall CreateDirectoryExW(wstr wstr ptr) -79 stdcall CreateDirectoryW(wstr ptr) -80 stdcall CreateEventA(ptr long long str) -81 stdcall CreateEventW(ptr long long wstr) -82 stdcall CreateFiber(long ptr ptr) -83 stdcall CreateFiberEx(long long long ptr ptr) -84 stdcall CreateFileA(str long long ptr long long long) -85 stdcall CreateFileMappingA(long ptr long long long str) -86 stdcall CreateFileMappingW(long ptr long long long wstr) -87 stdcall CreateFileW(wstr long long ptr long long long) -88 stdcall CreateHardLinkA(str str ptr) -89 stdcall CreateHardLinkW(wstr wstr ptr) -90 stdcall CreateIoCompletionPort(long long long long) -91 stdcall CreateJobObjectA(ptr str) -92 stdcall CreateJobObjectW(ptr wstr) -93 stdcall CreateJobSet(long ptr long) -94 stdcall CreateMailslotA(ptr long long ptr) -95 stdcall CreateMailslotW(ptr long long ptr) -96 stdcall CreateMemoryResourceNotification(long) -97 stdcall CreateMutexA(ptr long str) -98 stdcall CreateMutexW(ptr long wstr) -99 stdcall CreateNamedPipeA(str long long long long long long ptr) -100 stdcall CreateNamedPipeW(wstr long long long long long long ptr) -101 stdcall CreateNlsSecurityDescriptor(ptr long long) ; missing in Win 7 -102 stdcall CreatePipe(ptr ptr ptr long) -103 stdcall CreateProcessA(str str ptr ptr long long ptr str ptr ptr) -104 stdcall CreateProcessInternalA(ptr str str ptr ptr long long ptr str ptr ptr long) -105 stdcall CreateProcessInternalW(ptr wstr wstr ptr ptr long long ptr wstr ptr ptr long) -106 stdcall CreateProcessW(wstr wstr ptr ptr long long ptr wstr ptr ptr) -107 stdcall CreateRemoteThread(long ptr long ptr long long ptr) -108 stdcall CreateSemaphoreA(ptr long long str) -109 stdcall CreateSemaphoreW(ptr long long wstr) -110 stdcall -i386 CreateSocketHandle() -111 stdcall CreateTapePartition(long long long long) -112 stdcall CreateThread(ptr long ptr long long ptr) -113 stdcall CreateTimerQueue () -114 stdcall CreateTimerQueueTimer(ptr long ptr ptr long long long) -115 stdcall CreateToolhelp32Snapshot(long long) -116 stdcall CreateWaitableTimerA(ptr long str) -117 stdcall CreateWaitableTimerW(ptr long wstr) +@ stdcall ConsoleMenuControl(long long long) +@ stdcall ContinueDebugEvent(long long long) +@ stdcall ConvertDefaultLocale (long) +@ stdcall ConvertFiberToThread() +@ stdcall ConvertThreadToFiber(ptr) +@ stdcall ConvertThreadToFiberEx(ptr long) +@ stdcall CopyFileA(str str long) +@ stdcall CopyFileExA (str str ptr ptr ptr long) +@ stdcall CopyFileExW (wstr wstr ptr ptr ptr long) +@ stdcall CopyFileW(wstr wstr long) +@ stdcall CopyLZFile(long long) LZCopy +@ stdcall CreateActCtxA(ptr) +@ stdcall CreateActCtxW(ptr) +@ stdcall CreateConsoleScreenBuffer(long long ptr long ptr) +@ stdcall CreateDirectoryA(str ptr) +@ stdcall CreateDirectoryExA(str str ptr) +@ stdcall CreateDirectoryExW(wstr wstr ptr) +@ stdcall CreateDirectoryW(wstr ptr) +@ stdcall CreateEventA(ptr long long str) +@ stdcall CreateEventW(ptr long long wstr) +@ stdcall CreateFiber(long ptr ptr) +@ stdcall CreateFiberEx(long long long ptr ptr) +@ stdcall CreateFileA(str long long ptr long long long) +@ stdcall CreateFileMappingA(long ptr long long long str) +@ stdcall CreateFileMappingW(long ptr long long long wstr) +@ stdcall CreateFileW(wstr long long ptr long long long) +@ stdcall CreateHardLinkA(str str ptr) +@ stdcall CreateHardLinkW(wstr wstr ptr) +@ stdcall CreateIoCompletionPort(long long long long) +@ stdcall CreateJobObjectA(ptr str) +@ stdcall CreateJobObjectW(ptr wstr) +@ stdcall CreateJobSet(long ptr long) +@ stdcall CreateMailslotA(ptr long long ptr) +@ stdcall CreateMailslotW(ptr long long ptr) +@ stdcall CreateMemoryResourceNotification(long) +@ stdcall CreateMutexA(ptr long str) +@ stdcall CreateMutexW(ptr long wstr) +@ stdcall CreateNamedPipeA(str long long long long long long ptr) +@ stdcall CreateNamedPipeW(wstr long long long long long long ptr) +@ stdcall CreateNlsSecurityDescriptor(ptr long long) ; missing in Win 7 +@ stdcall CreatePipe(ptr ptr ptr long) +@ stdcall CreateProcessA(str str ptr ptr long long ptr str ptr ptr) +@ stdcall CreateProcessInternalA(ptr str str ptr ptr long long ptr str ptr ptr long) +@ stdcall CreateProcessInternalW(ptr wstr wstr ptr ptr long long ptr wstr ptr ptr long) +@ stdcall CreateProcessW(wstr wstr ptr ptr long long ptr wstr ptr ptr) +@ stdcall CreateRemoteThread(long ptr long ptr long long ptr) +@ stdcall CreateSemaphoreA(ptr long long str) +@ stdcall CreateSemaphoreW(ptr long long wstr) +@ stdcall -i386 CreateSocketHandle() +@ stdcall CreateTapePartition(long long long long) +@ stdcall CreateThread(ptr long ptr long long ptr) +@ stdcall CreateTimerQueue () +@ stdcall CreateTimerQueueTimer(ptr long ptr ptr long long long) +@ stdcall CreateToolhelp32Snapshot(long long) +@ stdcall CreateWaitableTimerA(ptr long str) +@ stdcall CreateWaitableTimerW(ptr long wstr) ;@ stdcall -arch=x86_64 CtrlRoutine() -118 stdcall DeactivateActCtx(long ptr) -119 stdcall DebugActiveProcess(long) -120 stdcall DebugActiveProcessStop(long) -121 stdcall DebugBreak() ntdll.DbgBreakPoint -122 stdcall DebugBreakProcess(long) -123 stdcall DebugSetProcessKillOnExit(long) -124 stdcall DecodePointer(ptr) ntdll.RtlDecodePointer -125 stdcall DecodeSystemPointer(ptr) ntdll.RtlDecodeSystemPointer -126 stdcall DefineDosDeviceA(long str str) -127 stdcall DefineDosDeviceW(long wstr wstr) -128 stdcall DelayLoadFailureHook(str str) -129 stdcall DeleteAtom(long) -130 stdcall DeleteCriticalSection(ptr) ntdll.RtlDeleteCriticalSection -131 stdcall DeleteFiber(ptr) -132 stdcall DeleteFileA(str) -133 stdcall DeleteFileW(wstr) -134 stdcall DeleteTimerQueue(long) -135 stdcall DeleteTimerQueueEx (long long) -136 stdcall DeleteTimerQueueTimer(long long long) -137 stdcall DeleteVolumeMountPointA(str) ;check -138 stdcall DeleteVolumeMountPointW(wstr) ;check -139 stdcall DeviceIoControl(long long ptr long ptr long ptr ptr) -140 stdcall DisableThreadLibraryCalls(long) -141 stdcall DisconnectNamedPipe(long) -142 stdcall DnsHostnameToComputerNameA (str ptr ptr) -143 stdcall DnsHostnameToComputerNameW (wstr ptr ptr) -144 stdcall DosDateTimeToFileTime(long long ptr) -145 stdcall DosPathToSessionPathA(long str str) -146 stdcall DosPathToSessionPathW(long wstr wstr) -147 stdcall DuplicateConsoleHandle(long long long long) -148 stdcall DuplicateHandle(long long long ptr long long long) -149 stdcall EncodePointer(ptr) ntdll.RtlEncodePointer -150 stdcall EncodeSystemPointer(ptr) ntdll.RtlEncodeSystemPointer -151 stdcall EndUpdateResourceA(long long) -152 stdcall EndUpdateResourceW(long long) -153 stdcall EnterCriticalSection(ptr) ntdll.RtlEnterCriticalSection -154 stdcall EnumCalendarInfoA(ptr long long long) -155 stdcall EnumCalendarInfoExA(ptr long long long) -156 stdcall EnumCalendarInfoExW(ptr long long long) -157 stdcall EnumCalendarInfoW(ptr long long long) -158 stdcall EnumDateFormatsA(ptr long long) -159 stdcall EnumDateFormatsExA(ptr long long) -160 stdcall EnumDateFormatsExW(ptr long long) -161 stdcall EnumDateFormatsW(ptr long long) -162 stdcall EnumLanguageGroupLocalesA(ptr long long ptr) -163 stdcall EnumLanguageGroupLocalesW(ptr long long ptr) -164 stdcall EnumResourceLanguagesA(long str str ptr long) -165 stdcall EnumResourceLanguagesW(long wstr wstr ptr long) -166 stdcall EnumResourceNamesA(long str ptr long) -167 stdcall EnumResourceNamesW(long wstr ptr long) -168 stdcall EnumResourceTypesA(long ptr long) -169 stdcall EnumResourceTypesW(long ptr long) -170 stdcall EnumSystemCodePagesA(ptr long) -171 stdcall EnumSystemCodePagesW(ptr long) -172 stdcall EnumSystemFirmwareTables(long ptr long) -173 stdcall EnumSystemGeoID(long long ptr) -174 stdcall EnumSystemLanguageGroupsA(ptr long ptr) -175 stdcall EnumSystemLanguageGroupsW(ptr long ptr) -176 stdcall EnumSystemLocalesA(ptr long) -177 stdcall EnumSystemLocalesW(ptr long) -178 stdcall EnumTimeFormatsA(ptr long long) -179 stdcall EnumTimeFormatsW(ptr long long) -180 stdcall EnumUILanguagesA(ptr long long) -181 stdcall EnumUILanguagesW(ptr long long) -182 stdcall EnumerateLocalComputerNamesA(ptr long str ptr) -183 stdcall EnumerateLocalComputerNamesW(ptr long wstr ptr) -184 stdcall EraseTape(ptr long long) -185 stdcall EscapeCommFunction(long long) -186 stdcall ExitProcess(long) ; FIXME: ntdll.RtlExitUserProcess -187 stdcall ExitThread(long) ; FIXME: ntdll.RtlExitUserThread -188 stdcall ExitVDM(long long) -189 stdcall ExpandEnvironmentStringsA(str ptr long) -190 stdcall ExpandEnvironmentStringsW(wstr ptr long) -191 stdcall ExpungeConsoleCommandHistoryA(long) -192 stdcall ExpungeConsoleCommandHistoryW(long) -193 stdcall FatalAppExitA(long str) -194 stdcall FatalAppExitW(long wstr) -195 stdcall FatalExit(long) -196 stdcall FileTimeToDosDateTime(ptr ptr ptr) -197 stdcall FileTimeToLocalFileTime(ptr ptr) -198 stdcall FileTimeToSystemTime(ptr ptr) -199 stdcall FillConsoleOutputAttribute(long long long long ptr) -200 stdcall FillConsoleOutputCharacterA(long long long long ptr) -201 stdcall FillConsoleOutputCharacterW(long long long long ptr) -202 stdcall FindActCtxSectionGuid(long ptr long ptr ptr) -203 stdcall FindActCtxSectionStringA(long ptr long str ptr) -204 stdcall FindActCtxSectionStringW(long ptr long wstr ptr) -205 stdcall FindAtomA(str) -206 stdcall FindAtomW(wstr) -207 stdcall FindClose(long) -208 stdcall FindCloseChangeNotification(long) -209 stdcall FindFirstChangeNotificationA(str long long) -210 stdcall FindFirstChangeNotificationW(wstr long long) -211 stdcall FindFirstFileA(str ptr) -212 stdcall FindFirstFileExA(str long ptr long ptr long) -213 stdcall FindFirstFileExW(wstr long ptr long ptr long) -214 stdcall FindFirstFileW(wstr ptr) -215 stdcall FindFirstStreamW(wstr ptr ptr long) -216 stdcall FindFirstVolumeA(ptr long) -217 stdcall FindFirstVolumeMountPointA(str ptr long) -218 stdcall FindFirstVolumeMountPointW(wstr ptr long) -219 stdcall FindFirstVolumeW(ptr long) -220 stdcall FindNextChangeNotification(long) -221 stdcall FindNextFileA(long ptr) -222 stdcall FindNextFileW(long ptr) -223 stdcall FindNextStreamW(ptr ptr) -224 stdcall FindNextVolumeA(long ptr long) -225 stdcall FindNextVolumeMountPointA(long str long) -226 stdcall FindNextVolumeMountPointW(long wstr long) -227 stdcall FindNextVolumeW(long ptr long) -228 stdcall FindResourceA(long str str) -229 stdcall FindResourceExA(long str str long) -230 stdcall FindResourceExW(long wstr wstr long) -231 stdcall FindResourceW(long wstr wstr) -232 stdcall FindVolumeClose(ptr) -233 stdcall FindVolumeMountPointClose(ptr) -234 stdcall FlsAlloc(ptr) -235 stdcall FlsFree(long) -236 stdcall FlsGetValue(long) -237 stdcall FlsSetValue(long ptr) -238 stdcall FlushConsoleInputBuffer(long) -239 stdcall FlushFileBuffers(long) -240 stdcall FlushInstructionCache(long long long) -241 stdcall FlushViewOfFile(ptr long) -242 stdcall FoldStringA(long str long ptr long) -243 stdcall FoldStringW(long wstr long ptr long) -244 stdcall FormatMessageA(long ptr long long ptr long ptr) -245 stdcall FormatMessageW(long ptr long long ptr long ptr) -246 stdcall FreeConsole() -247 stdcall FreeEnvironmentStringsA(ptr) -248 stdcall FreeEnvironmentStringsW(ptr) -249 stdcall FreeLibrary(long) -250 stdcall FreeLibraryAndExitThread(long long) -251 stdcall FreeResource(long) -252 stdcall FreeUserPhysicalPages(long long long) -253 stdcall GenerateConsoleCtrlEvent(long long) -254 stdcall GetACP() -255 stdcall GetAtomNameA(long ptr long) -256 stdcall GetAtomNameW(long ptr long) -257 stdcall GetBinaryType(str ptr) GetBinaryTypeA -258 stdcall GetBinaryTypeA(str ptr) -259 stdcall GetBinaryTypeW(wstr ptr) -260 stdcall GetCPFileNameFromRegistry(long wstr long) ;check missing in Win 7 -261 stdcall GetCPInfo(long ptr) -262 stdcall GetCPInfoExA(long long ptr) -263 stdcall GetCPInfoExW(long long ptr) -264 stdcall GetCalendarInfoA(long long long ptr long ptr) -265 stdcall GetCalendarInfoW(long long long ptr long ptr) -266 stdcall GetComPlusPackageInstallStatus() -267 stdcall GetCommConfig(long ptr long) -268 stdcall GetCommMask(long ptr) -269 stdcall GetCommModemStatus(long ptr) -270 stdcall GetCommProperties(long ptr) -271 stdcall GetCommState(long ptr) -272 stdcall GetCommTimeouts(long ptr) -273 stdcall GetCommandLineA() -274 stdcall GetCommandLineW() -275 stdcall GetCompressedFileSizeA(long ptr) -276 stdcall GetCompressedFileSizeW(long ptr) -277 stdcall GetComputerNameA(ptr ptr) -278 stdcall GetComputerNameExA(long ptr ptr) -279 stdcall GetComputerNameExW(long ptr ptr) -280 stdcall GetComputerNameW(ptr ptr) -281 stdcall GetConsoleAliasA(str str long str) -282 stdcall GetConsoleAliasExesA(str long) -283 stdcall GetConsoleAliasExesLengthA() -284 stdcall GetConsoleAliasExesLengthW() -285 stdcall GetConsoleAliasExesW(wstr long) -286 stdcall GetConsoleAliasW(wstr ptr long wstr) -287 stdcall GetConsoleAliasesA(str long str) -288 stdcall GetConsoleAliasesLengthA(str) -289 stdcall GetConsoleAliasesLengthW(wstr) -290 stdcall GetConsoleAliasesW(wstr long wstr) -291 stdcall GetConsoleCP() -292 stdcall GetConsoleCharType(long long ptr) -293 stdcall GetConsoleCommandHistoryA(long long long) -294 stdcall GetConsoleCommandHistoryLengthA(long) -295 stdcall GetConsoleCommandHistoryLengthW(long) -296 stdcall GetConsoleCommandHistoryW(long long long) -297 stdcall GetConsoleCursorInfo(long ptr) -298 stdcall GetConsoleCursorMode(long ptr ptr) -299 stdcall GetConsoleDisplayMode(ptr) -300 stdcall GetConsoleFontInfo(long long long ptr) -301 stdcall GetConsoleFontSize(long long) -302 stdcall GetConsoleHardwareState(long long ptr) -303 stdcall GetConsoleInputExeNameA(long ptr) -304 stdcall GetConsoleInputExeNameW(long ptr) -305 stdcall GetConsoleInputWaitHandle() -306 stdcall GetConsoleKeyboardLayoutNameA(ptr) -307 stdcall GetConsoleKeyboardLayoutNameW(ptr) -308 stdcall GetConsoleMode(long ptr) -309 stdcall GetConsoleNlsMode(long ptr) -310 stdcall GetConsoleOutputCP() -311 stdcall GetConsoleProcessList(ptr long) ; missing in XP SP3 -312 stdcall GetConsoleScreenBufferInfo(long ptr) -313 stdcall GetConsoleSelectionInfo(ptr) -314 stdcall GetConsoleTitleA(ptr long) -315 stdcall GetConsoleTitleW(ptr long) -316 stdcall GetConsoleWindow() -317 stdcall GetCurrencyFormatA(long long str ptr str long) -318 stdcall GetCurrencyFormatW(long long str ptr str long) -319 stdcall GetCurrentActCtx(ptr) -320 stdcall GetCurrentConsoleFont(long long ptr) -321 stdcall GetCurrentDirectoryA(long ptr) -322 stdcall GetCurrentDirectoryW(long ptr) -323 stdcall -norelay GetCurrentProcess() -324 stdcall -norelay GetCurrentProcessId() -325 stdcall GetCurrentProcessorNumber() ntdll.RtlGetCurrentProcessorNumber -326 stdcall -norelay GetCurrentThread() -327 stdcall -norelay GetCurrentThreadId() -328 stdcall GetDateFormatA(long long ptr str ptr long) -329 stdcall GetDateFormatW(long long ptr wstr ptr long) -330 stdcall GetDefaultCommConfigA(str ptr long) -331 stdcall GetDefaultCommConfigW(wstr ptr long) -332 stdcall GetDefaultSortkeySize(ptr) ; missing in Win 7 -333 stdcall GetDevicePowerState(long ptr) -334 stdcall GetDiskFreeSpaceA(str ptr ptr ptr ptr) -335 stdcall GetDiskFreeSpaceExA (str ptr ptr ptr) -336 stdcall GetDiskFreeSpaceExW (wstr ptr ptr ptr) -337 stdcall GetDiskFreeSpaceW(wstr ptr ptr ptr ptr) -338 stdcall GetDllDirectoryA(long ptr) -339 stdcall GetDllDirectoryW(long ptr) -340 stdcall GetDriveTypeA(str) -341 stdcall GetDriveTypeW(wstr) -342 stdcall GetEnvironmentStrings() -343 stdcall GetEnvironmentStringsA() GetEnvironmentStrings -344 stdcall GetEnvironmentStringsW() -345 stdcall GetEnvironmentVariableA(str ptr long) -346 stdcall GetEnvironmentVariableW(wstr ptr long) -347 stdcall GetExitCodeProcess(long ptr) -348 stdcall GetExitCodeThread(long ptr) -349 stdcall GetExpandedNameA(str ptr) -350 stdcall GetExpandedNameW(wstr ptr) -351 stdcall GetFileAttributesA(str) -352 stdcall GetFileAttributesExA(str long ptr) -353 stdcall GetFileAttributesExW(wstr long ptr) -354 stdcall GetFileAttributesW(wstr) -355 stdcall GetFileInformationByHandle(long ptr) -356 stdcall GetFileSize(long ptr) -357 stdcall GetFileSizeEx(long ptr) -358 stdcall GetFileTime(long ptr ptr ptr) -359 stdcall GetFileType(long) -360 stdcall GetFirmwareEnvironmentVariableA(str str ptr long) -361 stdcall GetFirmwareEnvironmentVariableW(wstr wstr ptr long) -362 stdcall GetFullPathNameA(str long ptr ptr) -363 stdcall GetFullPathNameW(wstr long ptr ptr) -364 stdcall GetGeoInfoA(long long ptr long long) -365 stdcall GetGeoInfoW(long long ptr long long) -366 stdcall -i386 GetHandleContext(long) ; missing on x64 -367 stdcall GetHandleInformation(long ptr) -368 stdcall GetLargePageMinimum() -369 stdcall GetLargestConsoleWindowSize(long) -370 stdcall GetLastError() ntdll.RtlGetLastWin32Error -371 stdcall GetLinguistLangSize(ptr) ; missing in Win 7 -372 stdcall GetLocalTime(ptr) -373 stdcall GetLocaleInfoA(long long ptr long) -374 stdcall GetLocaleInfoW(long long ptr long) -375 stdcall GetLogicalDriveStringsA(long ptr) -376 stdcall GetLogicalDriveStringsW(long ptr) -377 stdcall GetLogicalDrives() -378 stdcall GetLogicalProcessorInformation(ptr ptr) -379 stdcall GetLongPathNameA (str long long) -380 stdcall GetLongPathNameW (wstr long long) -381 stdcall GetMailslotInfo(long ptr ptr ptr ptr) -382 stdcall GetModuleFileNameA(long ptr long) -383 stdcall GetModuleFileNameW(long ptr long) -384 stdcall GetModuleHandleA(str) -385 stdcall GetModuleHandleExA(long ptr ptr) -386 stdcall GetModuleHandleExW(long ptr ptr) -387 stdcall GetModuleHandleW(wstr) -388 stdcall GetNLSVersion(long long ptr) -389 stdcall GetNamedPipeHandleStateA(long ptr ptr ptr ptr str long) -390 stdcall GetNamedPipeHandleStateW(long ptr ptr ptr ptr wstr long) -391 stdcall GetNamedPipeInfo(long ptr ptr ptr ptr) -392 stdcall GetNativeSystemInfo(ptr) -393 stdcall GetNextVDMCommand(long) -394 stdcall GetNlsSectionName(long long long str str long) ; missing in Win 7 -395 stdcall GetNumaAvailableMemoryNode(long ptr) -396 stdcall GetNumaHighestNodeNumber(ptr) -397 stdcall GetNumaNodeProcessorMask(long ptr) -398 stdcall GetNumaProcessorNode(long ptr) -399 stdcall GetNumberFormatA(long long str ptr ptr long) -400 stdcall GetNumberFormatW(long long wstr ptr ptr long) -401 stdcall GetNumberOfConsoleFonts() -402 stdcall GetNumberOfConsoleInputEvents(long ptr) -403 stdcall GetNumberOfConsoleMouseButtons(ptr) -404 stdcall GetOEMCP() -405 stdcall GetOverlappedResult(long ptr ptr long) -406 stdcall GetPriorityClass(long) -407 stdcall GetPrivateProfileIntA(str str long str) -408 stdcall GetPrivateProfileIntW(wstr wstr long wstr) -409 stdcall GetPrivateProfileSectionA(str ptr long str) -410 stdcall GetPrivateProfileSectionNamesA(ptr long str) -411 stdcall GetPrivateProfileSectionNamesW(ptr long wstr) -412 stdcall GetPrivateProfileSectionW(wstr ptr long wstr) -413 stdcall GetPrivateProfileStringA(str str str ptr long str) -414 stdcall GetPrivateProfileStringW(wstr wstr wstr ptr long wstr) -415 stdcall GetPrivateProfileStructA (str str ptr long str) -416 stdcall GetPrivateProfileStructW(wstr wstr ptr long wstr) -417 stdcall GetProcAddress(long str) -418 stdcall GetProcessAffinityMask(long ptr ptr) -419 stdcall GetProcessHandleCount(long ptr) -420 stdcall -norelay GetProcessHeap() -421 stdcall GetProcessHeaps(long ptr) -422 stdcall GetProcessId(long) -423 stdcall GetProcessIdOfThread(ptr) -424 stdcall GetProcessIoCounters(long ptr) -425 stdcall GetProcessPriorityBoost(long ptr) -426 stdcall GetProcessShutdownParameters(ptr ptr) -427 stdcall GetProcessTimes(long ptr ptr ptr ptr) -428 stdcall GetProcessVersion(long) -429 stdcall GetProcessWorkingSetSize(long ptr ptr) -430 stdcall GetProcessWorkingSetSizeEx(long ptr ptr long) -431 stdcall GetProfileIntA(str str long) -432 stdcall GetProfileIntW(wstr wstr long) -433 stdcall GetProfileSectionA(str ptr long) -434 stdcall GetProfileSectionW(wstr ptr long) -435 stdcall GetProfileStringA(str str str ptr long) -436 stdcall GetProfileStringW(wstr wstr wstr ptr long) -437 stdcall GetQueuedCompletionStatus(long ptr ptr ptr long) -438 stdcall GetShortPathNameA(str ptr long) -439 stdcall GetShortPathNameW(wstr ptr long) -440 stdcall GetStartupInfoA(ptr) -441 stdcall GetStartupInfoW(ptr) -442 stdcall GetStdHandle(long) -443 stdcall GetStringTypeA(long long str long ptr) -444 stdcall GetStringTypeExA(long long str long ptr) -445 stdcall GetStringTypeExW(long long wstr long ptr) -446 stdcall GetStringTypeW(long wstr long ptr) -447 stdcall GetSystemDefaultLCID() -448 stdcall GetSystemDefaultLangID() -449 stdcall GetSystemDefaultUILanguage() -450 stdcall GetSystemDirectoryA(ptr long) -451 stdcall GetSystemDirectoryW(ptr long) -452 stdcall GetSystemFileCacheSize(ptr ptr ptr) -453 stdcall GetSystemFirmwareTable(long long ptr long) -454 stdcall GetSystemInfo(ptr) -455 stdcall GetSystemPowerStatus(ptr) -456 stdcall GetSystemRegistryQuota(ptr ptr) -457 stdcall GetSystemTime(ptr) -458 stdcall GetSystemTimeAdjustment(ptr ptr ptr) -459 stdcall GetSystemTimeAsFileTime(ptr) -460 stdcall GetSystemTimes(ptr ptr ptr) -461 stdcall GetSystemWindowsDirectoryA(ptr long) -462 stdcall GetSystemWindowsDirectoryW(ptr long) -463 stdcall GetSystemWow64DirectoryA(ptr long) -464 stdcall GetSystemWow64DirectoryW(ptr long) -465 stdcall GetTapeParameters(ptr long ptr ptr) -466 stdcall GetTapePosition(ptr long ptr ptr ptr) -467 stdcall GetTapeStatus(ptr) -468 stdcall GetTempFileNameA(str str long ptr) -469 stdcall GetTempFileNameW(wstr wstr long ptr) -470 stdcall GetTempPathA(long ptr) -471 stdcall GetTempPathW(long ptr) -472 stdcall GetThreadContext(long ptr) -473 stdcall GetThreadIOPendingFlag(long ptr) -474 stdcall GetThreadId(ptr) -475 stdcall GetThreadLocale() -476 stdcall GetThreadPriority(long) -477 stdcall GetThreadPriorityBoost(long ptr) -478 stdcall GetThreadSelectorEntry(long long ptr) -479 stdcall GetThreadTimes(long ptr ptr ptr ptr) -480 stdcall GetTickCount() -481 stdcall GetTimeFormatA(long long ptr str ptr long) -482 stdcall GetTimeFormatW(long long ptr wstr ptr long) -483 stdcall GetTimeZoneInformation(ptr) -484 stdcall GetUserDefaultLCID() -485 stdcall GetUserDefaultLangID() -486 stdcall GetUserDefaultUILanguage() -487 stdcall GetUserGeoID(long) -488 stdcall GetVDMCurrentDirectories(long long) -489 stdcall GetVersion() -490 stdcall GetVersionExA(ptr) -491 stdcall GetVersionExW(ptr) -492 stdcall GetVolumeInformationA(str ptr long ptr ptr ptr ptr long) -493 stdcall GetVolumeInformationW(wstr ptr long ptr ptr ptr ptr long) -494 stdcall GetVolumeNameForVolumeMountPointA(str ptr long) -495 stdcall GetVolumeNameForVolumeMountPointW(wstr ptr long) -496 stdcall GetVolumePathNameA(str ptr long) -497 stdcall GetVolumePathNameW(wstr ptr long) -498 stdcall GetVolumePathNamesForVolumeNameA(str str long ptr) -499 stdcall GetVolumePathNamesForVolumeNameW(wstr wstr long ptr) -500 stdcall GetWindowsDirectoryA(ptr long) -501 stdcall GetWindowsDirectoryW(ptr long) -502 stdcall GetWriteWatch(long ptr long ptr ptr ptr) -503 stdcall GlobalAddAtomA(str) -504 stdcall GlobalAddAtomW(wstr) -505 stdcall GlobalAlloc(long long) -506 stdcall GlobalCompact(long) -507 stdcall GlobalDeleteAtom(long) -508 stdcall GlobalFindAtomA(str) -509 stdcall GlobalFindAtomW(wstr) -510 stdcall GlobalFix(long) -511 stdcall GlobalFlags(long) -512 stdcall GlobalFree(long) -513 stdcall GlobalGetAtomNameA(long ptr long) -514 stdcall GlobalGetAtomNameW(long ptr long) -515 stdcall GlobalHandle(ptr) -516 stdcall GlobalLock(long) -517 stdcall GlobalMemoryStatus(ptr) -518 stdcall GlobalMemoryStatusEx(ptr) -519 stdcall GlobalReAlloc(long long long) -520 stdcall GlobalSize(long) -521 stdcall GlobalUnWire(long) -522 stdcall GlobalUnfix(long) -523 stdcall GlobalUnlock(long) -524 stdcall GlobalWire(long) -525 stdcall Heap32First(ptr long long) -526 stdcall Heap32ListFirst(long ptr) -527 stdcall Heap32ListNext(long ptr) -528 stdcall Heap32Next(ptr) -529 stdcall HeapAlloc(long long long) ntdll.RtlAllocateHeap -530 stdcall HeapCompact(long long) -531 stdcall HeapCreate(long long long) -532 stdcall HeapCreateTagsW(long long wstr wstr) ; missing in Win 7 -533 stdcall HeapDestroy(long) -534 stdcall HeapExtend(long long ptr long) ; missing in Win 7 -535 stdcall HeapFree(long long long) ntdll.RtlFreeHeap -536 stdcall HeapLock(long) -537 stdcall HeapQueryInformation(long long ptr long ptr) -538 stdcall HeapQueryTagW(long long long long ptr) ; missing in Win 7 -539 stdcall HeapReAlloc(long long ptr long) ntdll.RtlReAllocateHeap -540 stdcall HeapSetInformation(ptr long ptr long) -541 stdcall HeapSize(long long ptr) ntdll.RtlSizeHeap -542 stdcall HeapSummary(long long ptr) -543 stdcall HeapUnlock(long) -544 stdcall HeapUsage(long long long long ptr) ; missing in Win 7 -545 stdcall HeapValidate(long long ptr) -546 stdcall HeapWalk(long ptr) -547 stdcall InitAtomTable(long) -548 stdcall InitializeCriticalSection(ptr) -549 stdcall InitializeCriticalSectionAndSpinCount(ptr long) -550 stdcall InitializeSListHead(ptr) ntdll.RtlInitializeSListHead -551 stdcall -arch=i386 -ret64 InterlockedCompareExchange64(ptr double double) ntdll.RtlInterlockedCompareExchange64 -552 stdcall -arch=i386 InterlockedCompareExchange (ptr long long) -553 stdcall -arch=i386 InterlockedDecrement(ptr) -554 stdcall -arch=i386 InterlockedExchange(ptr long) -555 stdcall -arch=i386 InterlockedExchangeAdd(ptr long) -556 stdcall InterlockedFlushSList(ptr) ntdll.RtlInterlockedFlushSList -557 stdcall -arch=i386 InterlockedIncrement(ptr) -558 stdcall InterlockedPopEntrySList(ptr) ntdll.RtlInterlockedPopEntrySList -559 stdcall InterlockedPushEntrySList(ptr ptr) ntdll.RtlInterlockedPushEntrySList -560 stdcall InvalidateConsoleDIBits(long long) -561 stdcall IsBadCodePtr(ptr) -562 stdcall IsBadHugeReadPtr(ptr long) -563 stdcall IsBadHugeWritePtr(ptr long) -564 stdcall IsBadReadPtr(ptr long) -565 stdcall IsBadStringPtrA(ptr long) -566 stdcall IsBadStringPtrW(ptr long) -567 stdcall IsBadWritePtr(ptr long) -568 stdcall IsDBCSLeadByte(long) -569 stdcall IsDBCSLeadByteEx(long long) -570 stdcall IsDebuggerPresent() -571 stdcall IsNLSDefinedString(long long ptr long long) -572 stdcall IsProcessInJob(long long ptr) -573 stdcall IsProcessorFeaturePresent(long) -574 stdcall IsSystemResumeAutomatic() -575 stdcall IsTimeZoneRedirectionEnabled() -576 stdcall IsValidCodePage(long) -577 stdcall IsValidLanguageGroup(long long) -578 stdcall IsValidLocale(long long) -579 stdcall IsValidUILanguage(long) ; missing in Win 7 -580 stdcall IsWow64Process(ptr ptr) -581 stdcall LCMapStringA(long long str long ptr long) -582 stdcall LCMapStringW(long long wstr long ptr long) -583 stdcall LZClose(long) -584 stdcall LZCloseFile(long) -585 stdcall LZCopy(long long) -586 stdcall LZCreateFileW(ptr long long long ptr) -587 stdcall LZDone() -588 stdcall LZInit(long) -589 stdcall LZOpenFileA(str ptr long) -590 stdcall LZOpenFileW(wstr ptr long) -591 stdcall LZRead(long str long) -592 stdcall LZSeek(long long long) -593 stdcall LZStart() -594 stdcall LeaveCriticalSection(ptr) ntdll.RtlLeaveCriticalSection -595 stdcall LoadLibraryA(str) -596 stdcall LoadLibraryExA( str long long) -597 stdcall LoadLibraryExW(wstr long long) -598 stdcall LoadLibraryW(wstr) -599 stdcall LoadModule(str ptr) -600 stdcall LoadResource(long long) -601 stdcall LocalAlloc(long long) -602 stdcall LocalCompact(long) -603 stdcall LocalFileTimeToFileTime(ptr ptr) -604 stdcall LocalFlags(long) -605 stdcall LocalFree(long) -606 stdcall LocalHandle(ptr) -607 stdcall LocalLock(long) -608 stdcall LocalReAlloc(long long long) -609 stdcall LocalShrink(long long) -610 stdcall LocalSize(long) -611 stdcall LocalUnlock(long) -612 stdcall LockFile(long long long long long) -613 stdcall LockFileEx(long long long long long ptr) -614 stdcall LockResource(long) -615 stdcall MapUserPhysicalPages(ptr long ptr) -616 stdcall MapUserPhysicalPagesScatter(ptr long ptr) -617 stdcall MapViewOfFile(long long long long long) -618 stdcall MapViewOfFileEx(long long long long long ptr) -619 stdcall Module32First(long ptr) -620 stdcall Module32FirstW(long ptr) -621 stdcall Module32Next(long ptr) -622 stdcall Module32NextW(long ptr) -623 stdcall MoveFileA(str str) -624 stdcall MoveFileExA(str str long) -625 stdcall MoveFileExW(wstr wstr long) -626 stdcall MoveFileW(wstr wstr) -627 stdcall MoveFileWithProgressA(str str ptr ptr long) -628 stdcall MoveFileWithProgressW(wstr wstr ptr ptr long) -629 stdcall MulDiv(long long long) -630 stdcall MultiByteToWideChar(long long str long ptr long) -631 stdcall NeedCurrentDirectoryForExePathA(str) -632 stdcall NeedCurrentDirectoryForExePathW(wstr) -633 stdcall NlsConvertIntegerToString(long long long wstr long) ; missing in Win 7 -634 stdcall NlsGetCacheUpdateCount() -635 stdcall NlsResetProcessLocale() -636 stdcall OpenConsoleW(wstr long long long) -637 stdcall OpenDataFile(long long) ; missing in Win 7 -638 stdcall OpenEventA(long long str) -639 stdcall OpenEventW(long long wstr) -640 stdcall OpenFile(str ptr long) -641 stdcall OpenFileMappingA(long long str) -642 stdcall OpenFileMappingW(long long wstr) -643 stdcall OpenJobObjectA(long long str) -644 stdcall OpenJobObjectW(long long wstr) -645 stdcall OpenMutexA(long long str) -646 stdcall OpenMutexW(long long wstr) -647 stdcall OpenProcess(long long long) -648 stdcall OpenProfileUserMapping() -649 stdcall OpenSemaphoreA(long long str) -650 stdcall OpenSemaphoreW(long long wstr) -651 stdcall OpenThread(long long long) -652 stdcall OpenWaitableTimerA(long long str) -653 stdcall OpenWaitableTimerW(long long wstr) -654 stdcall OutputDebugStringA(str) -655 stdcall OutputDebugStringW(wstr) -656 stdcall PeekConsoleInputA(ptr ptr long ptr) -657 stdcall PeekConsoleInputW(ptr ptr long ptr) -658 stdcall PeekNamedPipe(long ptr long ptr ptr ptr) -659 stdcall PostQueuedCompletionStatus(long long ptr ptr) -660 stdcall PrepareTape(ptr long long) -661 stdcall PrivCopyFileExW(wstr wstr ptr ptr long long) -662 stdcall PrivMoveFileIdentityW(long long long) -663 stdcall Process32First (ptr ptr) -664 stdcall Process32FirstW (ptr ptr) -665 stdcall Process32Next (ptr ptr) -666 stdcall Process32NextW (ptr ptr) -667 stdcall ProcessIdToSessionId(long ptr) -668 stdcall PulseEvent(long) -669 stdcall PurgeComm(long long) -670 stdcall QueryActCtxW(long ptr ptr long ptr long ptr) -671 stdcall QueryDepthSList(ptr) ntdll.RtlQueryDepthSList -672 stdcall QueryDosDeviceA(str ptr long) -673 stdcall QueryDosDeviceW(wstr ptr long) -674 stdcall QueryInformationJobObject(long long ptr long ptr) -675 stdcall QueryMemoryResourceNotification(ptr ptr) -676 stdcall QueryPerformanceCounter(ptr) -677 stdcall QueryPerformanceFrequency(ptr) -678 stdcall QueueUserAPC(ptr long long) -679 stdcall QueueUserWorkItem(ptr ptr long) -680 stdcall -norelay RaiseException(long long long ptr) -681 stdcall ReOpenFile(ptr long long long) -682 stdcall ReadConsoleA(long ptr long ptr ptr) -683 stdcall ReadConsoleInputA(long ptr long ptr) -684 stdcall ReadConsoleInputExA(long ptr long ptr long) -685 stdcall ReadConsoleInputExW(long ptr long ptr long) -686 stdcall ReadConsoleInputW(long ptr long ptr) -687 stdcall ReadConsoleOutputA(long ptr long long ptr) -688 stdcall ReadConsoleOutputAttribute(long ptr long long ptr) -689 stdcall ReadConsoleOutputCharacterA(long ptr long long ptr) -690 stdcall ReadConsoleOutputCharacterW(long ptr long long ptr) -691 stdcall ReadConsoleOutputW(long ptr long long ptr) -692 stdcall ReadConsoleW(long ptr long ptr ptr) -693 stdcall ReadDirectoryChangesW(long ptr long long long ptr ptr ptr) -694 stdcall ReadFile(long ptr long ptr ptr) -695 stdcall ReadFileEx(long ptr long ptr ptr) -696 stdcall ReadFileScatter(long ptr long ptr ptr) -697 stdcall ReadProcessMemory(long ptr ptr long ptr) -698 stdcall RegisterConsoleIME(ptr ptr) -699 stdcall RegisterConsoleOS2(long) -700 stdcall RegisterConsoleVDM(long long long long long long long long long long long) -701 stdcall RegisterWaitForInputIdle(ptr) -702 stdcall RegisterWaitForSingleObject(ptr long ptr ptr long long) -703 stdcall RegisterWaitForSingleObjectEx(long ptr ptr long long) -704 stdcall RegisterWowBaseHandlers(long) -705 stdcall RegisterWowExec(long) -706 stdcall ReleaseActCtx(ptr) -707 stdcall ReleaseMutex(long) -708 stdcall ReleaseSemaphore(long long ptr) -709 stdcall RemoveDirectoryA(str) -710 stdcall RemoveDirectoryW(wstr) -711 stdcall RemoveLocalAlternateComputerNameA(str long) -712 stdcall RemoveLocalAlternateComputerNameW(wstr long) -713 stdcall RemoveVectoredContinueHandler(ptr) ntdll.RtlRemoveVectoredContinueHandler -714 stdcall RemoveVectoredExceptionHandler(ptr) ntdll.RtlRemoveVectoredExceptionHandler -715 stdcall ReplaceFile(wstr wstr wstr long ptr ptr) ReplaceFileW -716 stdcall ReplaceFileA(str str str long ptr ptr) -717 stdcall ReplaceFileW(wstr wstr wstr long ptr ptr) -718 stdcall RequestDeviceWakeup(long) -719 stdcall RequestWakeupLatency(long) -720 stdcall ResetEvent(long) -721 stdcall ResetWriteWatch(ptr long) -722 stdcall RestoreLastError(long) ntdll.RtlRestoreLastWin32Error -723 stdcall ResumeThread(long) +@ stdcall DeactivateActCtx(long ptr) +@ stdcall DebugActiveProcess(long) +@ stdcall DebugActiveProcessStop(long) +@ stdcall DebugBreak() ntdll.DbgBreakPoint +@ stdcall DebugBreakProcess(long) +@ stdcall DebugSetProcessKillOnExit(long) +@ stdcall DecodePointer(ptr) ntdll.RtlDecodePointer +@ stdcall DecodeSystemPointer(ptr) ntdll.RtlDecodeSystemPointer +@ stdcall DefineDosDeviceA(long str str) +@ stdcall DefineDosDeviceW(long wstr wstr) +@ stdcall DelayLoadFailureHook(str str) +@ stdcall DeleteAtom(long) +@ stdcall DeleteCriticalSection(ptr) ntdll.RtlDeleteCriticalSection +@ stdcall DeleteFiber(ptr) +@ stdcall DeleteFileA(str) +@ stdcall DeleteFileW(wstr) +@ stdcall DeleteTimerQueue(long) +@ stdcall DeleteTimerQueueEx (long long) +@ stdcall DeleteTimerQueueTimer(long long long) +@ stdcall DeleteVolumeMountPointA(str) ;check +@ stdcall DeleteVolumeMountPointW(wstr) ;check +@ stdcall DeviceIoControl(long long ptr long ptr long ptr ptr) +@ stdcall DisableThreadLibraryCalls(long) +@ stdcall DisconnectNamedPipe(long) +@ stdcall DnsHostnameToComputerNameA (str ptr ptr) +@ stdcall DnsHostnameToComputerNameW (wstr ptr ptr) +@ stdcall DosDateTimeToFileTime(long long ptr) +@ stdcall DosPathToSessionPathA(long str str) +@ stdcall DosPathToSessionPathW(long wstr wstr) +@ stdcall DuplicateConsoleHandle(long long long long) +@ stdcall DuplicateHandle(long long long ptr long long long) +@ stdcall EncodePointer(ptr) ntdll.RtlEncodePointer +@ stdcall EncodeSystemPointer(ptr) ntdll.RtlEncodeSystemPointer +@ stdcall EndUpdateResourceA(long long) +@ stdcall EndUpdateResourceW(long long) +@ stdcall EnterCriticalSection(ptr) ntdll.RtlEnterCriticalSection +@ stdcall EnumCalendarInfoA(ptr long long long) +@ stdcall EnumCalendarInfoExA(ptr long long long) +@ stdcall EnumCalendarInfoExW(ptr long long long) +@ stdcall EnumCalendarInfoW(ptr long long long) +@ stdcall EnumDateFormatsA(ptr long long) +@ stdcall EnumDateFormatsExA(ptr long long) +@ stdcall EnumDateFormatsExW(ptr long long) +@ stdcall EnumDateFormatsW(ptr long long) +@ stdcall EnumLanguageGroupLocalesA(ptr long long ptr) +@ stdcall EnumLanguageGroupLocalesW(ptr long long ptr) +@ stdcall EnumResourceLanguagesA(long str str ptr long) +@ stdcall EnumResourceLanguagesW(long wstr wstr ptr long) +@ stdcall EnumResourceNamesA(long str ptr long) +@ stdcall EnumResourceNamesW(long wstr ptr long) +@ stdcall EnumResourceTypesA(long ptr long) +@ stdcall EnumResourceTypesW(long ptr long) +@ stdcall EnumSystemCodePagesA(ptr long) +@ stdcall EnumSystemCodePagesW(ptr long) +@ stdcall EnumSystemFirmwareTables(long ptr long) +@ stdcall EnumSystemGeoID(long long ptr) +@ stdcall EnumSystemLanguageGroupsA(ptr long ptr) +@ stdcall EnumSystemLanguageGroupsW(ptr long ptr) +@ stdcall EnumSystemLocalesA(ptr long) +@ stdcall EnumSystemLocalesW(ptr long) +@ stdcall EnumTimeFormatsA(ptr long long) +@ stdcall EnumTimeFormatsW(ptr long long) +@ stdcall EnumUILanguagesA(ptr long long) +@ stdcall EnumUILanguagesW(ptr long long) +@ stdcall EnumerateLocalComputerNamesA(ptr long str ptr) +@ stdcall EnumerateLocalComputerNamesW(ptr long wstr ptr) +@ stdcall EraseTape(ptr long long) +@ stdcall EscapeCommFunction(long long) +@ stdcall ExitProcess(long) ; FIXME: ntdll.RtlExitUserProcess +@ stdcall ExitThread(long) ; FIXME: ntdll.RtlExitUserThread +@ stdcall ExitVDM(long long) +@ stdcall ExpandEnvironmentStringsA(str ptr long) +@ stdcall ExpandEnvironmentStringsW(wstr ptr long) +@ stdcall ExpungeConsoleCommandHistoryA(long) +@ stdcall ExpungeConsoleCommandHistoryW(long) +@ stdcall FatalAppExitA(long str) +@ stdcall FatalAppExitW(long wstr) +@ stdcall FatalExit(long) +@ stdcall FileTimeToDosDateTime(ptr ptr ptr) +@ stdcall FileTimeToLocalFileTime(ptr ptr) +@ stdcall FileTimeToSystemTime(ptr ptr) +@ stdcall FillConsoleOutputAttribute(long long long long ptr) +@ stdcall FillConsoleOutputCharacterA(long long long long ptr) +@ stdcall FillConsoleOutputCharacterW(long long long long ptr) +@ stdcall FindActCtxSectionGuid(long ptr long ptr ptr) +@ stdcall FindActCtxSectionStringA(long ptr long str ptr) +@ stdcall FindActCtxSectionStringW(long ptr long wstr ptr) +@ stdcall FindAtomA(str) +@ stdcall FindAtomW(wstr) +@ stdcall FindClose(long) +@ stdcall FindCloseChangeNotification(long) +@ stdcall FindFirstChangeNotificationA(str long long) +@ stdcall FindFirstChangeNotificationW(wstr long long) +@ stdcall FindFirstFileA(str ptr) +@ stdcall FindFirstFileExA(str long ptr long ptr long) +@ stdcall FindFirstFileExW(wstr long ptr long ptr long) +@ stdcall FindFirstFileW(wstr ptr) +@ stdcall FindFirstStreamW(wstr ptr ptr long) +@ stdcall FindFirstVolumeA(ptr long) +@ stdcall FindFirstVolumeMountPointA(str ptr long) +@ stdcall FindFirstVolumeMountPointW(wstr ptr long) +@ stdcall FindFirstVolumeW(ptr long) +@ stdcall FindNextChangeNotification(long) +@ stdcall FindNextFileA(long ptr) +@ stdcall FindNextFileW(long ptr) +@ stdcall FindNextStreamW(ptr ptr) +@ stdcall FindNextVolumeA(long ptr long) +@ stdcall FindNextVolumeMountPointA(long str long) +@ stdcall FindNextVolumeMountPointW(long wstr long) +@ stdcall FindNextVolumeW(long ptr long) +@ stdcall FindResourceA(long str str) +@ stdcall FindResourceExA(long str str long) +@ stdcall FindResourceExW(long wstr wstr long) +@ stdcall FindResourceW(long wstr wstr) +@ stdcall FindVolumeClose(ptr) +@ stdcall FindVolumeMountPointClose(ptr) +@ stdcall FlsAlloc(ptr) +@ stdcall FlsFree(long) +@ stdcall FlsGetValue(long) +@ stdcall FlsSetValue(long ptr) +@ stdcall FlushConsoleInputBuffer(long) +@ stdcall FlushFileBuffers(long) +@ stdcall FlushInstructionCache(long long long) +@ stdcall FlushViewOfFile(ptr long) +@ stdcall FoldStringA(long str long ptr long) +@ stdcall FoldStringW(long wstr long ptr long) +@ stdcall FormatMessageA(long ptr long long ptr long ptr) +@ stdcall FormatMessageW(long ptr long long ptr long ptr) +@ stdcall FreeConsole() +@ stdcall FreeEnvironmentStringsA(ptr) +@ stdcall FreeEnvironmentStringsW(ptr) +@ stdcall FreeLibrary(long) +@ stdcall FreeLibraryAndExitThread(long long) +@ stdcall FreeResource(long) +@ stdcall FreeUserPhysicalPages(long long long) +@ stdcall GenerateConsoleCtrlEvent(long long) +@ stdcall GetACP() +@ stdcall GetAtomNameA(long ptr long) +@ stdcall GetAtomNameW(long ptr long) +@ stdcall GetBinaryType(str ptr) GetBinaryTypeA +@ stdcall GetBinaryTypeA(str ptr) +@ stdcall GetBinaryTypeW(wstr ptr) +@ stdcall GetCPFileNameFromRegistry(long wstr long) ;check missing in Win 7 +@ stdcall GetCPInfo(long ptr) +@ stdcall GetCPInfoExA(long long ptr) +@ stdcall GetCPInfoExW(long long ptr) +@ stdcall GetCalendarInfoA(long long long ptr long ptr) +@ stdcall GetCalendarInfoW(long long long ptr long ptr) +@ stdcall GetComPlusPackageInstallStatus() +@ stdcall GetCommConfig(long ptr long) +@ stdcall GetCommMask(long ptr) +@ stdcall GetCommModemStatus(long ptr) +@ stdcall GetCommProperties(long ptr) +@ stdcall GetCommState(long ptr) +@ stdcall GetCommTimeouts(long ptr) +@ stdcall GetCommandLineA() +@ stdcall GetCommandLineW() +@ stdcall GetCompressedFileSizeA(long ptr) +@ stdcall GetCompressedFileSizeW(long ptr) +@ stdcall GetComputerNameA(ptr ptr) +@ stdcall GetComputerNameExA(long ptr ptr) +@ stdcall GetComputerNameExW(long ptr ptr) +@ stdcall GetComputerNameW(ptr ptr) +@ stdcall GetConsoleAliasA(str str long str) +@ stdcall GetConsoleAliasExesA(str long) +@ stdcall GetConsoleAliasExesLengthA() +@ stdcall GetConsoleAliasExesLengthW() +@ stdcall GetConsoleAliasExesW(wstr long) +@ stdcall GetConsoleAliasW(wstr ptr long wstr) +@ stdcall GetConsoleAliasesA(str long str) +@ stdcall GetConsoleAliasesLengthA(str) +@ stdcall GetConsoleAliasesLengthW(wstr) +@ stdcall GetConsoleAliasesW(wstr long wstr) +@ stdcall GetConsoleCP() +@ stdcall GetConsoleCharType(long long ptr) +@ stdcall GetConsoleCommandHistoryA(long long long) +@ stdcall GetConsoleCommandHistoryLengthA(long) +@ stdcall GetConsoleCommandHistoryLengthW(long) +@ stdcall GetConsoleCommandHistoryW(long long long) +@ stdcall GetConsoleCursorInfo(long ptr) +@ stdcall GetConsoleCursorMode(long ptr ptr) +@ stdcall GetConsoleDisplayMode(ptr) +@ stdcall GetConsoleFontInfo(long long long ptr) +@ stdcall GetConsoleFontSize(long long) +@ stdcall GetConsoleHardwareState(long long ptr) +@ stdcall GetConsoleInputExeNameA(long ptr) +@ stdcall GetConsoleInputExeNameW(long ptr) +@ stdcall GetConsoleInputWaitHandle() +@ stdcall GetConsoleKeyboardLayoutNameA(ptr) +@ stdcall GetConsoleKeyboardLayoutNameW(ptr) +@ stdcall GetConsoleMode(long ptr) +@ stdcall GetConsoleNlsMode(long ptr) +@ stdcall GetConsoleOutputCP() +@ stdcall GetConsoleProcessList(ptr long) ; missing in XP SP3 +@ stdcall GetConsoleScreenBufferInfo(long ptr) +@ stdcall GetConsoleSelectionInfo(ptr) +@ stdcall GetConsoleTitleA(ptr long) +@ stdcall GetConsoleTitleW(ptr long) +@ stdcall GetConsoleWindow() +@ stdcall GetCurrencyFormatA(long long str ptr str long) +@ stdcall GetCurrencyFormatW(long long str ptr str long) +@ stdcall GetCurrentActCtx(ptr) +@ stdcall GetCurrentConsoleFont(long long ptr) +@ stdcall GetCurrentDirectoryA(long ptr) +@ stdcall GetCurrentDirectoryW(long ptr) +@ stdcall -norelay GetCurrentProcess() +@ stdcall -norelay GetCurrentProcessId() +@ stdcall GetCurrentProcessorNumber() ntdll.RtlGetCurrentProcessorNumber +@ stdcall -norelay GetCurrentThread() +@ stdcall -norelay GetCurrentThreadId() +@ stdcall GetDateFormatA(long long ptr str ptr long) +@ stdcall GetDateFormatW(long long ptr wstr ptr long) +@ stdcall GetDefaultCommConfigA(str ptr long) +@ stdcall GetDefaultCommConfigW(wstr ptr long) +@ stdcall GetDefaultSortkeySize(ptr) ; missing in Win 7 +@ stdcall GetDevicePowerState(long ptr) +@ stdcall GetDiskFreeSpaceA(str ptr ptr ptr ptr) +@ stdcall GetDiskFreeSpaceExA (str ptr ptr ptr) +@ stdcall GetDiskFreeSpaceExW (wstr ptr ptr ptr) +@ stdcall GetDiskFreeSpaceW(wstr ptr ptr ptr ptr) +@ stdcall GetDllDirectoryA(long ptr) +@ stdcall GetDllDirectoryW(long ptr) +@ stdcall GetDriveTypeA(str) +@ stdcall GetDriveTypeW(wstr) +@ stdcall GetEnvironmentStrings() +@ stdcall GetEnvironmentStringsA() GetEnvironmentStrings +@ stdcall GetEnvironmentStringsW() +@ stdcall GetEnvironmentVariableA(str ptr long) +@ stdcall GetEnvironmentVariableW(wstr ptr long) +@ stdcall GetExitCodeProcess(long ptr) +@ stdcall GetExitCodeThread(long ptr) +@ stdcall GetExpandedNameA(str ptr) +@ stdcall GetExpandedNameW(wstr ptr) +@ stdcall GetFileAttributesA(str) +@ stdcall GetFileAttributesExA(str long ptr) +@ stdcall GetFileAttributesExW(wstr long ptr) +@ stdcall GetFileAttributesW(wstr) +@ stdcall GetFileInformationByHandle(long ptr) +@ stdcall GetFileSize(long ptr) +@ stdcall GetFileSizeEx(long ptr) +@ stdcall GetFileTime(long ptr ptr ptr) +@ stdcall GetFileType(long) +@ stdcall GetFirmwareEnvironmentVariableA(str str ptr long) +@ stdcall GetFirmwareEnvironmentVariableW(wstr wstr ptr long) +@ stdcall GetFullPathNameA(str long ptr ptr) +@ stdcall GetFullPathNameW(wstr long ptr ptr) +@ stdcall GetGeoInfoA(long long ptr long long) +@ stdcall GetGeoInfoW(long long ptr long long) +@ stdcall -i386 GetHandleContext(long) ; missing on x64 +@ stdcall GetHandleInformation(long ptr) +@ stdcall GetLargePageMinimum() +@ stdcall GetLargestConsoleWindowSize(long) +@ stdcall GetLastError() ntdll.RtlGetLastWin32Error +@ stdcall GetLinguistLangSize(ptr) ; missing in Win 7 +@ stdcall GetLocalTime(ptr) +@ stdcall GetLocaleInfoA(long long ptr long) +@ stdcall GetLocaleInfoW(long long ptr long) +@ stdcall GetLogicalDriveStringsA(long ptr) +@ stdcall GetLogicalDriveStringsW(long ptr) +@ stdcall GetLogicalDrives() +@ stdcall GetLogicalProcessorInformation(ptr ptr) +@ stdcall GetLongPathNameA (str long long) +@ stdcall GetLongPathNameW (wstr long long) +@ stdcall GetMailslotInfo(long ptr ptr ptr ptr) +@ stdcall GetModuleFileNameA(long ptr long) +@ stdcall GetModuleFileNameW(long ptr long) +@ stdcall GetModuleHandleA(str) +@ stdcall GetModuleHandleExA(long ptr ptr) +@ stdcall GetModuleHandleExW(long ptr ptr) +@ stdcall GetModuleHandleW(wstr) +@ stdcall GetNLSVersion(long long ptr) +@ stdcall GetNamedPipeHandleStateA(long ptr ptr ptr ptr str long) +@ stdcall GetNamedPipeHandleStateW(long ptr ptr ptr ptr wstr long) +@ stdcall GetNamedPipeInfo(long ptr ptr ptr ptr) +@ stdcall GetNativeSystemInfo(ptr) +@ stdcall GetNextVDMCommand(long) +@ stdcall GetNlsSectionName(long long long str str long) ; missing in Win 7 +@ stdcall GetNumaAvailableMemoryNode(long ptr) +@ stdcall GetNumaHighestNodeNumber(ptr) +@ stdcall GetNumaNodeProcessorMask(long ptr) +@ stdcall GetNumaProcessorNode(long ptr) +@ stdcall GetNumberFormatA(long long str ptr ptr long) +@ stdcall GetNumberFormatW(long long wstr ptr ptr long) +@ stdcall GetNumberOfConsoleFonts() +@ stdcall GetNumberOfConsoleInputEvents(long ptr) +@ stdcall GetNumberOfConsoleMouseButtons(ptr) +@ stdcall GetOEMCP() +@ stdcall GetOverlappedResult(long ptr ptr long) +@ stdcall GetPriorityClass(long) +@ stdcall GetPrivateProfileIntA(str str long str) +@ stdcall GetPrivateProfileIntW(wstr wstr long wstr) +@ stdcall GetPrivateProfileSectionA(str ptr long str) +@ stdcall GetPrivateProfileSectionNamesA(ptr long str) +@ stdcall GetPrivateProfileSectionNamesW(ptr long wstr) +@ stdcall GetPrivateProfileSectionW(wstr ptr long wstr) +@ stdcall GetPrivateProfileStringA(str str str ptr long str) +@ stdcall GetPrivateProfileStringW(wstr wstr wstr ptr long wstr) +@ stdcall GetPrivateProfileStructA (str str ptr long str) +@ stdcall GetPrivateProfileStructW(wstr wstr ptr long wstr) +@ stdcall GetProcAddress(long str) +@ stdcall GetProcessAffinityMask(long ptr ptr) +@ stdcall GetProcessHandleCount(long ptr) +@ stdcall -norelay GetProcessHeap() +@ stdcall GetProcessHeaps(long ptr) +@ stdcall GetProcessId(long) +@ stdcall GetProcessIdOfThread(ptr) +@ stdcall GetProcessIoCounters(long ptr) +@ stdcall GetProcessPriorityBoost(long ptr) +@ stdcall GetProcessShutdownParameters(ptr ptr) +@ stdcall GetProcessTimes(long ptr ptr ptr ptr) +@ stdcall GetProcessVersion(long) +@ stdcall GetProcessWorkingSetSize(long ptr ptr) +@ stdcall GetProcessWorkingSetSizeEx(long ptr ptr long) +@ stdcall GetProfileIntA(str str long) +@ stdcall GetProfileIntW(wstr wstr long) +@ stdcall GetProfileSectionA(str ptr long) +@ stdcall GetProfileSectionW(wstr ptr long) +@ stdcall GetProfileStringA(str str str ptr long) +@ stdcall GetProfileStringW(wstr wstr wstr ptr long) +@ stdcall GetQueuedCompletionStatus(long ptr ptr ptr long) +@ stdcall GetShortPathNameA(str ptr long) +@ stdcall GetShortPathNameW(wstr ptr long) +@ stdcall GetStartupInfoA(ptr) +@ stdcall GetStartupInfoW(ptr) +@ stdcall GetStdHandle(long) +@ stdcall GetStringTypeA(long long str long ptr) +@ stdcall GetStringTypeExA(long long str long ptr) +@ stdcall GetStringTypeExW(long long wstr long ptr) +@ stdcall GetStringTypeW(long wstr long ptr) +@ stdcall GetSystemDefaultLCID() +@ stdcall GetSystemDefaultLangID() +@ stdcall GetSystemDefaultUILanguage() +@ stdcall GetSystemDirectoryA(ptr long) +@ stdcall GetSystemDirectoryW(ptr long) +@ stdcall GetSystemFileCacheSize(ptr ptr ptr) +@ stdcall GetSystemFirmwareTable(long long ptr long) +@ stdcall GetSystemInfo(ptr) +@ stdcall GetSystemPowerStatus(ptr) +@ stdcall GetSystemRegistryQuota(ptr ptr) +@ stdcall GetSystemTime(ptr) +@ stdcall GetSystemTimeAdjustment(ptr ptr ptr) +@ stdcall GetSystemTimeAsFileTime(ptr) +@ stdcall GetSystemTimes(ptr ptr ptr) +@ stdcall GetSystemWindowsDirectoryA(ptr long) +@ stdcall GetSystemWindowsDirectoryW(ptr long) +@ stdcall GetSystemWow64DirectoryA(ptr long) +@ stdcall GetSystemWow64DirectoryW(ptr long) +@ stdcall GetTapeParameters(ptr long ptr ptr) +@ stdcall GetTapePosition(ptr long ptr ptr ptr) +@ stdcall GetTapeStatus(ptr) +@ stdcall GetTempFileNameA(str str long ptr) +@ stdcall GetTempFileNameW(wstr wstr long ptr) +@ stdcall GetTempPathA(long ptr) +@ stdcall GetTempPathW(long ptr) +@ stdcall GetThreadContext(long ptr) +@ stdcall GetThreadIOPendingFlag(long ptr) +@ stdcall GetThreadId(ptr) +@ stdcall GetThreadLocale() +@ stdcall GetThreadPriority(long) +@ stdcall GetThreadPriorityBoost(long ptr) +@ stdcall GetThreadSelectorEntry(long long ptr) +@ stdcall GetThreadTimes(long ptr ptr ptr ptr) +@ stdcall GetTickCount() +@ stdcall GetTimeFormatA(long long ptr str ptr long) +@ stdcall GetTimeFormatW(long long ptr wstr ptr long) +@ stdcall GetTimeZoneInformation(ptr) +@ stdcall GetUserDefaultLCID() +@ stdcall GetUserDefaultLangID() +@ stdcall GetUserDefaultUILanguage() +@ stdcall GetUserGeoID(long) +@ stdcall GetVDMCurrentDirectories(long long) +@ stdcall GetVersion() +@ stdcall GetVersionExA(ptr) +@ stdcall GetVersionExW(ptr) +@ stdcall GetVolumeInformationA(str ptr long ptr ptr ptr ptr long) +@ stdcall GetVolumeInformationW(wstr ptr long ptr ptr ptr ptr long) +@ stdcall GetVolumeNameForVolumeMountPointA(str ptr long) +@ stdcall GetVolumeNameForVolumeMountPointW(wstr ptr long) +@ stdcall GetVolumePathNameA(str ptr long) +@ stdcall GetVolumePathNameW(wstr ptr long) +@ stdcall GetVolumePathNamesForVolumeNameA(str str long ptr) +@ stdcall GetVolumePathNamesForVolumeNameW(wstr wstr long ptr) +@ stdcall GetWindowsDirectoryA(ptr long) +@ stdcall GetWindowsDirectoryW(ptr long) +@ stdcall GetWriteWatch(long ptr long ptr ptr ptr) +@ stdcall GlobalAddAtomA(str) +@ stdcall GlobalAddAtomW(wstr) +@ stdcall GlobalAlloc(long long) +@ stdcall GlobalCompact(long) +@ stdcall GlobalDeleteAtom(long) +@ stdcall GlobalFindAtomA(str) +@ stdcall GlobalFindAtomW(wstr) +@ stdcall GlobalFix(long) +@ stdcall GlobalFlags(long) +@ stdcall GlobalFree(long) +@ stdcall GlobalGetAtomNameA(long ptr long) +@ stdcall GlobalGetAtomNameW(long ptr long) +@ stdcall GlobalHandle(ptr) +@ stdcall GlobalLock(long) +@ stdcall GlobalMemoryStatus(ptr) +@ stdcall GlobalMemoryStatusEx(ptr) +@ stdcall GlobalReAlloc(long long long) +@ stdcall GlobalSize(long) +@ stdcall GlobalUnWire(long) +@ stdcall GlobalUnfix(long) +@ stdcall GlobalUnlock(long) +@ stdcall GlobalWire(long) +@ stdcall Heap32First(ptr long long) +@ stdcall Heap32ListFirst(long ptr) +@ stdcall Heap32ListNext(long ptr) +@ stdcall Heap32Next(ptr) +@ stdcall HeapAlloc(long long long) ntdll.RtlAllocateHeap +@ stdcall HeapCompact(long long) +@ stdcall HeapCreate(long long long) +@ stdcall HeapCreateTagsW(long long wstr wstr) ; missing in Win 7 +@ stdcall HeapDestroy(long) +@ stdcall HeapExtend(long long ptr long) ; missing in Win 7 +@ stdcall HeapFree(long long long) ntdll.RtlFreeHeap +@ stdcall HeapLock(long) +@ stdcall HeapQueryInformation(long long ptr long ptr) +@ stdcall HeapQueryTagW(long long long long ptr) ; missing in Win 7 +@ stdcall HeapReAlloc(long long ptr long) ntdll.RtlReAllocateHeap +@ stdcall HeapSetInformation(ptr long ptr long) +@ stdcall HeapSize(long long ptr) ntdll.RtlSizeHeap +@ stdcall HeapSummary(long long ptr) +@ stdcall HeapUnlock(long) +@ stdcall HeapUsage(long long long long ptr) ; missing in Win 7 +@ stdcall HeapValidate(long long ptr) +@ stdcall HeapWalk(long ptr) +@ stdcall InitAtomTable(long) +@ stdcall InitializeCriticalSection(ptr) +@ stdcall InitializeCriticalSectionAndSpinCount(ptr long) +@ stdcall InitializeSListHead(ptr) ntdll.RtlInitializeSListHead +@ stdcall -arch=i386 -ret64 InterlockedCompareExchange64(ptr double double) ntdll.RtlInterlockedCompareExchange64 +@ stdcall -arch=i386 InterlockedCompareExchange (ptr long long) +@ stdcall -arch=i386 InterlockedDecrement(ptr) +@ stdcall -arch=i386 InterlockedExchange(ptr long) +@ stdcall -arch=i386 InterlockedExchangeAdd(ptr long) +@ stdcall InterlockedFlushSList(ptr) ntdll.RtlInterlockedFlushSList +@ stdcall -arch=i386 InterlockedIncrement(ptr) +@ stdcall InterlockedPopEntrySList(ptr) ntdll.RtlInterlockedPopEntrySList +@ stdcall InterlockedPushEntrySList(ptr ptr) ntdll.RtlInterlockedPushEntrySList +@ stdcall InvalidateConsoleDIBits(long long) +@ stdcall IsBadCodePtr(ptr) +@ stdcall IsBadHugeReadPtr(ptr long) +@ stdcall IsBadHugeWritePtr(ptr long) +@ stdcall IsBadReadPtr(ptr long) +@ stdcall IsBadStringPtrA(ptr long) +@ stdcall IsBadStringPtrW(ptr long) +@ stdcall IsBadWritePtr(ptr long) +@ stdcall IsDBCSLeadByte(long) +@ stdcall IsDBCSLeadByteEx(long long) +@ stdcall IsDebuggerPresent() +@ stdcall IsNLSDefinedString(long long ptr long long) +@ stdcall IsProcessInJob(long long ptr) +@ stdcall IsProcessorFeaturePresent(long) +@ stdcall IsSystemResumeAutomatic() +@ stdcall IsTimeZoneRedirectionEnabled() +@ stdcall IsValidCodePage(long) +@ stdcall IsValidLanguageGroup(long long) +@ stdcall IsValidLocale(long long) +@ stdcall IsValidUILanguage(long) ; missing in Win 7 +@ stdcall IsWow64Process(ptr ptr) +@ stdcall LCMapStringA(long long str long ptr long) +@ stdcall LCMapStringW(long long wstr long ptr long) +@ stdcall LZClose(long) +@ stdcall LZCloseFile(long) +@ stdcall LZCopy(long long) +@ stdcall LZCreateFileW(ptr long long long ptr) +@ stdcall LZDone() +@ stdcall LZInit(long) +@ stdcall LZOpenFileA(str ptr long) +@ stdcall LZOpenFileW(wstr ptr long) +@ stdcall LZRead(long str long) +@ stdcall LZSeek(long long long) +@ stdcall LZStart() +@ stdcall LeaveCriticalSection(ptr) ntdll.RtlLeaveCriticalSection +@ stdcall LoadLibraryA(str) +@ stdcall LoadLibraryExA( str long long) +@ stdcall LoadLibraryExW(wstr long long) +@ stdcall LoadLibraryW(wstr) +@ stdcall LoadModule(str ptr) +@ stdcall LoadResource(long long) +@ stdcall LocalAlloc(long long) +@ stdcall LocalCompact(long) +@ stdcall LocalFileTimeToFileTime(ptr ptr) +@ stdcall LocalFlags(long) +@ stdcall LocalFree(long) +@ stdcall LocalHandle(ptr) +@ stdcall LocalLock(long) +@ stdcall LocalReAlloc(long long long) +@ stdcall LocalShrink(long long) +@ stdcall LocalSize(long) +@ stdcall LocalUnlock(long) +@ stdcall LockFile(long long long long long) +@ stdcall LockFileEx(long long long long long ptr) +@ stdcall LockResource(long) +@ stdcall MapUserPhysicalPages(ptr long ptr) +@ stdcall MapUserPhysicalPagesScatter(ptr long ptr) +@ stdcall MapViewOfFile(long long long long long) +@ stdcall MapViewOfFileEx(long long long long long ptr) +@ stdcall Module32First(long ptr) +@ stdcall Module32FirstW(long ptr) +@ stdcall Module32Next(long ptr) +@ stdcall Module32NextW(long ptr) +@ stdcall MoveFileA(str str) +@ stdcall MoveFileExA(str str long) +@ stdcall MoveFileExW(wstr wstr long) +@ stdcall MoveFileW(wstr wstr) +@ stdcall MoveFileWithProgressA(str str ptr ptr long) +@ stdcall MoveFileWithProgressW(wstr wstr ptr ptr long) +@ stdcall MulDiv(long long long) +@ stdcall MultiByteToWideChar(long long str long ptr long) +@ stdcall NeedCurrentDirectoryForExePathA(str) +@ stdcall NeedCurrentDirectoryForExePathW(wstr) +@ stdcall NlsConvertIntegerToString(long long long wstr long) ; missing in Win 7 +@ stdcall NlsGetCacheUpdateCount() +@ stdcall NlsResetProcessLocale() +@ stdcall OpenConsoleW(wstr long long long) +@ stdcall OpenDataFile(long long) ; missing in Win 7 +@ stdcall OpenEventA(long long str) +@ stdcall OpenEventW(long long wstr) +@ stdcall OpenFile(str ptr long) +@ stdcall OpenFileMappingA(long long str) +@ stdcall OpenFileMappingW(long long wstr) +@ stdcall OpenJobObjectA(long long str) +@ stdcall OpenJobObjectW(long long wstr) +@ stdcall OpenMutexA(long long str) +@ stdcall OpenMutexW(long long wstr) +@ stdcall OpenProcess(long long long) +@ stdcall OpenProfileUserMapping() +@ stdcall OpenSemaphoreA(long long str) +@ stdcall OpenSemaphoreW(long long wstr) +@ stdcall OpenThread(long long long) +@ stdcall OpenWaitableTimerA(long long str) +@ stdcall OpenWaitableTimerW(long long wstr) +@ stdcall OutputDebugStringA(str) +@ stdcall OutputDebugStringW(wstr) +@ stdcall PeekConsoleInputA(ptr ptr long ptr) +@ stdcall PeekConsoleInputW(ptr ptr long ptr) +@ stdcall PeekNamedPipe(long ptr long ptr ptr ptr) +@ stdcall PostQueuedCompletionStatus(long long ptr ptr) +@ stdcall PrepareTape(ptr long long) +@ stdcall PrivCopyFileExW(wstr wstr ptr ptr long long) +@ stdcall PrivMoveFileIdentityW(long long long) +@ stdcall Process32First (ptr ptr) +@ stdcall Process32FirstW (ptr ptr) +@ stdcall Process32Next (ptr ptr) +@ stdcall Process32NextW (ptr ptr) +@ stdcall ProcessIdToSessionId(long ptr) +@ stdcall PulseEvent(long) +@ stdcall PurgeComm(long long) +@ stdcall QueryActCtxW(long ptr ptr long ptr long ptr) +@ stdcall QueryDepthSList(ptr) ntdll.RtlQueryDepthSList +@ stdcall QueryDosDeviceA(str ptr long) +@ stdcall QueryDosDeviceW(wstr ptr long) +@ stdcall QueryInformationJobObject(long long ptr long ptr) +@ stdcall QueryMemoryResourceNotification(ptr ptr) +@ stdcall QueryPerformanceCounter(ptr) +@ stdcall QueryPerformanceFrequency(ptr) +@ stdcall QueueUserAPC(ptr long long) +@ stdcall QueueUserWorkItem(ptr ptr long) +@ stdcall -norelay RaiseException(long long long ptr) +@ stdcall ReOpenFile(ptr long long long) +@ stdcall ReadConsoleA(long ptr long ptr ptr) +@ stdcall ReadConsoleInputA(long ptr long ptr) +@ stdcall ReadConsoleInputExA(long ptr long ptr long) +@ stdcall ReadConsoleInputExW(long ptr long ptr long) +@ stdcall ReadConsoleInputW(long ptr long ptr) +@ stdcall ReadConsoleOutputA(long ptr long long ptr) +@ stdcall ReadConsoleOutputAttribute(long ptr long long ptr) +@ stdcall ReadConsoleOutputCharacterA(long ptr long long ptr) +@ stdcall ReadConsoleOutputCharacterW(long ptr long long ptr) +@ stdcall ReadConsoleOutputW(long ptr long long ptr) +@ stdcall ReadConsoleW(long ptr long ptr ptr) +@ stdcall ReadDirectoryChangesW(long ptr long long long ptr ptr ptr) +@ stdcall ReadFile(long ptr long ptr ptr) +@ stdcall ReadFileEx(long ptr long ptr ptr) +@ stdcall ReadFileScatter(long ptr long ptr ptr) +@ stdcall ReadProcessMemory(long ptr ptr long ptr) +@ stdcall RegisterConsoleIME(ptr ptr) +@ stdcall RegisterConsoleOS2(long) +@ stdcall RegisterConsoleVDM(long long long long long long long long long long long) +@ stdcall RegisterWaitForInputIdle(ptr) +@ stdcall RegisterWaitForSingleObject(ptr long ptr ptr long long) +@ stdcall RegisterWaitForSingleObjectEx(long ptr ptr long long) +@ stdcall RegisterWowBaseHandlers(long) +@ stdcall RegisterWowExec(long) +@ stdcall ReleaseActCtx(ptr) +@ stdcall ReleaseMutex(long) +@ stdcall ReleaseSemaphore(long long ptr) +@ stdcall RemoveDirectoryA(str) +@ stdcall RemoveDirectoryW(wstr) +@ stdcall RemoveLocalAlternateComputerNameA(str long) +@ stdcall RemoveLocalAlternateComputerNameW(wstr long) +@ stdcall RemoveVectoredContinueHandler(ptr) ntdll.RtlRemoveVectoredContinueHandler +@ stdcall RemoveVectoredExceptionHandler(ptr) ntdll.RtlRemoveVectoredExceptionHandler +@ stdcall ReplaceFile(wstr wstr wstr long ptr ptr) ReplaceFileW +@ stdcall ReplaceFileA(str str str long ptr ptr) +@ stdcall ReplaceFileW(wstr wstr wstr long ptr ptr) +@ stdcall RequestDeviceWakeup(long) +@ stdcall RequestWakeupLatency(long) +@ stdcall ResetEvent(long) +@ stdcall ResetWriteWatch(ptr long) +@ stdcall RestoreLastError(long) ntdll.RtlRestoreLastWin32Error +@ stdcall ResumeThread(long) @ stdcall -arch=x86_64 RtlAddFunctionTable(ptr long long) ntdll.RtlAddFunctionTable -724 stdcall -register RtlCaptureContext(ptr) ntdll.RtlCaptureContext -725 stdcall RtlCaptureStackBackTrace(long long ptr ptr) ntdll.RtlCaptureStackBackTrace +@ stdcall -register RtlCaptureContext(ptr) ntdll.RtlCaptureContext +@ stdcall RtlCaptureStackBackTrace(long long ptr ptr) ntdll.RtlCaptureStackBackTrace @ stdcall -arch=x86_64 RtlCompareMemory(ptr ptr ptr) ntdll.RtlCompareMemory @ stdcall -arch=x86_64 RtlCopyMemory(ptr ptr ptr) ntdll.memcpy @ stdcall -arch=x86_64 RtlDeleteFunctionTable(ptr) ntdll.RtlDeleteFunctionTable -726 stdcall RtlFillMemory(ptr long long) ntdll.RtlFillMemory +@ stdcall RtlFillMemory(ptr long long) ntdll.RtlFillMemory @ stdcall -arch=x86_64 RtlInstallFunctionTableCallback(double double long ptr ptr ptr) ntdll.RtlInstallFunctionTableCallback @ stdcall -arch=x86_64 RtlLookupFunctionEntry(ptr ptr ptr) ntdll.RtlLookupFunctionEntry -727 stdcall RtlMoveMemory(ptr ptr long) ntdll.RtlMoveMemory +@ stdcall RtlMoveMemory(ptr ptr long) ntdll.RtlMoveMemory @ stdcall -arch=x86_64 RtlPcToFileHeader(ptr ptr) ntdll.RtlPcToFileHeader @ stdcall -arch=x86_64 RtlRaiseException(ptr) ntdll.RtlRaiseException @ stdcall -arch=x86_64 RtlRestoreContext(ptr ptr) ntdll.RtlRestoreContext -728 stdcall RtlUnwind(ptr ptr ptr ptr) ntdll.RtlUnwind +@ stdcall RtlUnwind(ptr ptr ptr ptr) ntdll.RtlUnwind @ stdcall -arch=x86_64 RtlUnwindEx(ptr ptr ptr ptr ptr ptr) ntdll.RtlUnwindEx @ stdcall -arch=x86_64 RtlVirtualUnwind(ptr ptr ptr long) ntdll.RtlVirtualUnwind -729 stdcall RtlZeroMemory(ptr long) ntdll.RtlZeroMemory -730 stdcall ScrollConsoleScreenBufferA(long ptr ptr ptr ptr) -731 stdcall ScrollConsoleScreenBufferW(long ptr ptr ptr ptr) -732 stdcall SearchPathA(str str str long ptr ptr) -733 stdcall SearchPathW(wstr wstr wstr long ptr ptr) -734 stdcall SetCPGlobal(long) ; missing in Win 7 -735 stdcall SetCalendarInfoA(long long long str) -736 stdcall SetCalendarInfoW(long long long wstr) -737 stdcall SetClientTimeZoneInformation(ptr) -738 stdcall SetComPlusPackageInstallStatus(ptr) -739 stdcall SetCommBreak(long) -740 stdcall SetCommConfig(long ptr long) -741 stdcall SetCommMask(long ptr) -742 stdcall SetCommState(long ptr) -743 stdcall SetCommTimeouts(long ptr) -744 stdcall SetComputerNameA(str) -745 stdcall SetComputerNameExA(long str) -746 stdcall SetComputerNameExW(long wstr) -747 stdcall SetComputerNameW(wstr) -748 stdcall SetConsoleActiveScreenBuffer(long) -749 stdcall SetConsoleCP(long) -750 stdcall SetConsoleCommandHistoryMode(long) ; missing in win 7 -751 stdcall SetConsoleCtrlHandler(ptr long) -752 stdcall SetConsoleCursor(long long) -753 stdcall SetConsoleCursorInfo(long ptr) -754 stdcall SetConsoleCursorMode(long long long) -755 stdcall SetConsoleCursorPosition(long long) -756 stdcall SetConsoleDisplayMode(long long ptr) -757 stdcall SetConsoleFont(long long) -758 stdcall SetConsoleHardwareState(long long long) -759 stdcall SetConsoleIcon(ptr) -760 stdcall SetConsoleInputExeNameA(ptr) -761 stdcall SetConsoleInputExeNameW(ptr) -762 stdcall SetConsoleKeyShortcuts(long long long long) -763 stdcall SetConsoleLocalEUDC(long long long long) -764 stdcall SetConsoleMaximumWindowSize(long long) -765 stdcall SetConsoleMenuClose(long) -766 stdcall SetConsoleMode(long long) -767 stdcall SetConsoleNlsMode(long long) -768 stdcall SetConsoleNumberOfCommandsA(long long) -769 stdcall SetConsoleNumberOfCommandsW(long long) -770 stdcall SetConsoleOS2OemFormat(long) -771 stdcall SetConsoleOutputCP(long) -772 stdcall SetConsolePalette(long long long) -773 stdcall SetConsoleScreenBufferSize(long long) -774 stdcall SetConsoleTextAttribute(long long) -775 stdcall SetConsoleTitleA(str) -776 stdcall SetConsoleTitleW(wstr) -777 stdcall SetConsoleWindowInfo(long long ptr) -778 stdcall SetCriticalSectionSpinCount(ptr long) ntdll.RtlSetCriticalSectionSpinCount -779 stdcall SetCurrentDirectoryA(str) -780 stdcall SetCurrentDirectoryW(wstr) -781 stdcall SetDefaultCommConfigA(str ptr long) -782 stdcall SetDefaultCommConfigW(wstr ptr long) -783 stdcall SetDllDirectoryA(str) -784 stdcall SetDllDirectoryW(wstr) -785 stdcall SetEndOfFile(long) -786 stdcall SetEnvironmentStringsA(ptr) -787 stdcall SetEnvironmentStringsW(ptr) -788 stdcall SetEnvironmentVariableA(str str) -789 stdcall SetEnvironmentVariableW(wstr wstr) -790 stdcall SetErrorMode(long) -791 stdcall SetEvent(long) -792 stdcall SetFileApisToANSI() -793 stdcall SetFileApisToOEM() -794 stdcall SetFileAttributesA(str long) -795 stdcall SetFileAttributesW(wstr long) -796 stdcall SetFileCompletionNotificationModes(ptr long) -797 stdcall SetFilePointer(long long ptr long) -798 stdcall SetFilePointerEx(long double ptr long) -799 stdcall SetFileShortNameA(long str) -800 stdcall SetFileShortNameW(long wstr) -801 stdcall SetFileTime(long ptr ptr ptr) -802 stdcall SetFileValidData(long double) -803 stdcall SetFirmwareEnvironmentVariableA(str str ptr long) -804 stdcall SetFirmwareEnvironmentVariableW(wstr wstr ptr long) -805 stdcall -i386 SetHandleContext(long long) ; missing in Win 7 x64 -806 stdcall SetHandleCount(long) -807 stdcall SetHandleInformation(long long long) -808 stdcall SetInformationJobObject(long long ptr long) -809 stdcall SetLastConsoleEventActive() ; missing in XP SP3 -810 stdcall SetLastError(long) ntdll.RtlSetLastWin32Error -811 stdcall SetLocalPrimaryComputerNameA(long long) ; missing in XP SP3 -812 stdcall SetLocalPrimaryComputerNameW(long long) ; missing in XP SP3 -813 stdcall SetLocalTime(ptr) -814 stdcall SetLocaleInfoA(long long str) -815 stdcall SetLocaleInfoW(long long wstr) -816 stdcall SetMailslotInfo(long long) -817 stdcall SetMessageWaitingIndicator(ptr long) -818 stdcall SetNamedPipeHandleState(long ptr ptr ptr) -819 stdcall SetPriorityClass(long long) -820 stdcall SetProcessAffinityMask(long long) -821 stdcall SetProcessPriorityBoost(long long) -822 stdcall SetProcessShutdownParameters(long long) -823 stdcall SetProcessWorkingSetSize(long long long) -824 stdcall SetProcessWorkingSetSizeEx(long long long long) -825 stdcall SetStdHandle(long long) -826 stdcall SetSystemFileCacheSize(long long long) -827 stdcall SetSystemPowerState(long long) -828 stdcall SetSystemTime(ptr) -829 stdcall SetSystemTimeAdjustment(long long) -830 stdcall SetTapeParameters(ptr long ptr) -831 stdcall SetTapePosition(ptr long long long long long) -832 stdcall SetTermsrvAppInstallMode(long) -833 stdcall SetThreadAffinityMask(long long) -834 stdcall SetThreadContext(long ptr) -835 stdcall SetThreadExecutionState(long) -836 stdcall SetThreadIdealProcessor(long long) -837 stdcall SetThreadLocale(long) -838 stdcall SetThreadPriority(long long) -839 stdcall SetThreadPriorityBoost(long long) -840 stdcall SetThreadStackGuarantee(ptr) -841 stdcall SetThreadUILanguage(long) -842 stdcall SetTimeZoneInformation(ptr) -843 stdcall SetTimerQueueTimer(long ptr ptr long long long) -844 stdcall SetUnhandledExceptionFilter(ptr) -845 stdcall SetUserGeoID(long) -846 stdcall SetVDMCurrentDirectories(long long) -847 stdcall SetVolumeLabelA(str str) -848 stdcall SetVolumeLabelW(wstr wstr) -849 stdcall SetVolumeMountPointA(str str) -850 stdcall SetVolumeMountPointW(wstr wstr) -851 stdcall SetWaitableTimer(long ptr long ptr ptr long) -852 stdcall SetupComm(long long long) -853 stdcall ShowConsoleCursor(long long) -854 stdcall SignalObjectAndWait(long long long long) -855 stdcall SizeofResource(long long) -856 stdcall Sleep(long) -857 stdcall SleepEx(long long) -858 stdcall SuspendThread(long) -859 stdcall SwitchToFiber(ptr) -860 stdcall SwitchToThread() -861 stdcall SystemTimeToFileTime(ptr ptr) -862 stdcall SystemTimeToTzSpecificLocalTime (ptr ptr ptr) -863 stdcall TerminateJobObject(long long) -864 stdcall TerminateProcess(long long) -865 stdcall TerminateThread(long long) -866 stdcall TermsrvAppInstallMode() -867 stdcall Thread32First(long ptr) -868 stdcall Thread32Next(long ptr) -869 stdcall TlsAlloc() -870 stdcall TlsFree(long) -871 stdcall -norelay TlsGetValue(long) -872 stdcall -norelay TlsSetValue(long ptr) -873 stdcall Toolhelp32ReadProcessMemory(long ptr ptr long ptr) -874 stdcall TransactNamedPipe(long ptr long ptr long ptr ptr) -875 stdcall TransmitCommChar(long long) -876 stdcall TryEnterCriticalSection(ptr) ntdll.RtlTryEnterCriticalSection -877 stdcall TzSpecificLocalTimeToSystemTime(ptr ptr ptr) -878 stdcall UTRegister(long str str str ptr ptr ptr) -879 stdcall UTUnRegister(long) -880 stdcall UnhandledExceptionFilter(ptr) -881 stdcall UnlockFile(long long long long long) -882 stdcall UnlockFileEx(long long long long ptr) -883 stdcall UnmapViewOfFile(ptr) -884 stdcall UnregisterConsoleIME() -885 stdcall UnregisterWait(long) -886 stdcall UnregisterWaitEx(long long) -887 stdcall UpdateResourceA(long str str long ptr long) -888 stdcall UpdateResourceW(long wstr wstr long ptr long) -889 stdcall VDMConsoleOperation(long long) -890 stdcall VDMOperationStarted(long) -891 stdcall ValidateLCType(long long ptr ptr) -892 stdcall ValidateLocale(long) -893 stdcall VerLanguageNameA(long str long) -894 stdcall VerLanguageNameW(long wstr long) -895 stdcall -ret64 VerSetConditionMask(long long long long) ntdll.VerSetConditionMask -896 stdcall VerifyConsoleIoHandle(long) -897 stdcall VerifyVersionInfoA(long long double) -898 stdcall VerifyVersionInfoW(long long double) -899 stdcall VirtualAlloc(ptr long long long) -900 stdcall VirtualAllocEx(long ptr long long long) -901 stdcall VirtualFree(ptr long long) -902 stdcall VirtualFreeEx(long ptr long long) -903 stdcall VirtualLock(ptr long) -904 stdcall VirtualProtect(ptr long long ptr) -905 stdcall VirtualProtectEx(long ptr long long ptr) -906 stdcall VirtualQuery(ptr ptr long) -907 stdcall VirtualQueryEx(long ptr ptr long) -908 stdcall VirtualUnlock(ptr long) -909 stdcall WTSGetActiveConsoleSessionId() -910 stdcall WaitCommEvent(long ptr ptr) -911 stdcall WaitForDebugEvent(ptr long) -912 stdcall WaitForMultipleObjects(long ptr long long) -913 stdcall WaitForMultipleObjectsEx(long ptr long long long) -914 stdcall WaitForSingleObject(long long) -915 stdcall WaitForSingleObjectEx(long long long) -916 stdcall WaitNamedPipeA (str long) -917 stdcall WaitNamedPipeW (wstr long) -918 stdcall WideCharToMultiByte(long long wstr long ptr long ptr ptr) -919 stdcall WinExec(str long) -920 stdcall Wow64DisableWow64FsRedirection(ptr) -921 stdcall Wow64EnableWow64FsRedirection(long) -922 stdcall Wow64RevertWow64FsRedirection(ptr) -923 stdcall WriteConsoleA(long ptr long ptr ptr) -924 stdcall WriteConsoleInputA(long ptr long ptr) -925 stdcall WriteConsoleInputVDMA(long long long long) -926 stdcall WriteConsoleInputVDMW(long long long long) -927 stdcall WriteConsoleInputW(long ptr long ptr) -928 stdcall WriteConsoleOutputA(long ptr long long ptr) -929 stdcall WriteConsoleOutputAttribute(long ptr long long ptr) -930 stdcall WriteConsoleOutputCharacterA(long ptr long long ptr) -931 stdcall WriteConsoleOutputCharacterW(long ptr long long ptr) -932 stdcall WriteConsoleOutputW(long ptr long long ptr) -933 stdcall WriteConsoleW(long ptr long ptr ptr) -934 stdcall WriteFile(long ptr long ptr ptr) -935 stdcall WriteFileEx(long ptr long ptr ptr) -936 stdcall WriteFileGather(long ptr long ptr ptr) -937 stdcall WritePrivateProfileSectionA(str str str) -938 stdcall WritePrivateProfileSectionW(wstr wstr wstr) -939 stdcall WritePrivateProfileStringA(str str str str) -940 stdcall WritePrivateProfileStringW(wstr wstr wstr wstr) -941 stdcall WritePrivateProfileStructA (str str ptr long str) -942 stdcall WritePrivateProfileStructW(wstr wstr ptr long wstr) -943 stdcall WriteProcessMemory(long ptr ptr long ptr) -944 stdcall WriteProfileSectionA(str str) -945 stdcall WriteProfileSectionW(str str) -946 stdcall WriteProfileStringA(str str str) -947 stdcall WriteProfileStringW(wstr wstr wstr) -948 stdcall WriteTapemark(ptr long long long) -949 stdcall ZombifyActCtx(ptr) +@ stdcall RtlZeroMemory(ptr long) ntdll.RtlZeroMemory +@ stdcall ScrollConsoleScreenBufferA(long ptr ptr ptr ptr) +@ stdcall ScrollConsoleScreenBufferW(long ptr ptr ptr ptr) +@ stdcall SearchPathA(str str str long ptr ptr) +@ stdcall SearchPathW(wstr wstr wstr long ptr ptr) +@ stdcall SetCPGlobal(long) ; missing in Win 7 +@ stdcall SetCalendarInfoA(long long long str) +@ stdcall SetCalendarInfoW(long long long wstr) +@ stdcall SetClientTimeZoneInformation(ptr) +@ stdcall SetComPlusPackageInstallStatus(ptr) +@ stdcall SetCommBreak(long) +@ stdcall SetCommConfig(long ptr long) +@ stdcall SetCommMask(long ptr) +@ stdcall SetCommState(long ptr) +@ stdcall SetCommTimeouts(long ptr) +@ stdcall SetComputerNameA(str) +@ stdcall SetComputerNameExA(long str) +@ stdcall SetComputerNameExW(long wstr) +@ stdcall SetComputerNameW(wstr) +@ stdcall SetConsoleActiveScreenBuffer(long) +@ stdcall SetConsoleCP(long) +@ stdcall SetConsoleCommandHistoryMode(long) ; missing in win 7 +@ stdcall SetConsoleCtrlHandler(ptr long) +@ stdcall SetConsoleCursor(long long) +@ stdcall SetConsoleCursorInfo(long ptr) +@ stdcall SetConsoleCursorMode(long long long) +@ stdcall SetConsoleCursorPosition(long long) +@ stdcall SetConsoleDisplayMode(long long ptr) +@ stdcall SetConsoleFont(long long) +@ stdcall SetConsoleHardwareState(long long long) +@ stdcall SetConsoleIcon(ptr) +@ stdcall SetConsoleInputExeNameA(ptr) +@ stdcall SetConsoleInputExeNameW(ptr) +@ stdcall SetConsoleKeyShortcuts(long long long long) +@ stdcall SetConsoleLocalEUDC(long long long long) +@ stdcall SetConsoleMaximumWindowSize(long long) +@ stdcall SetConsoleMenuClose(long) +@ stdcall SetConsoleMode(long long) +@ stdcall SetConsoleNlsMode(long long) +@ stdcall SetConsoleNumberOfCommandsA(long long) +@ stdcall SetConsoleNumberOfCommandsW(long long) +@ stdcall SetConsoleOS2OemFormat(long) +@ stdcall SetConsoleOutputCP(long) +@ stdcall SetConsolePalette(long long long) +@ stdcall SetConsoleScreenBufferSize(long long) +@ stdcall SetConsoleTextAttribute(long long) +@ stdcall SetConsoleTitleA(str) +@ stdcall SetConsoleTitleW(wstr) +@ stdcall SetConsoleWindowInfo(long long ptr) +@ stdcall SetCriticalSectionSpinCount(ptr long) ntdll.RtlSetCriticalSectionSpinCount +@ stdcall SetCurrentDirectoryA(str) +@ stdcall SetCurrentDirectoryW(wstr) +@ stdcall SetDefaultCommConfigA(str ptr long) +@ stdcall SetDefaultCommConfigW(wstr ptr long) +@ stdcall SetDllDirectoryA(str) +@ stdcall SetDllDirectoryW(wstr) +@ stdcall SetEndOfFile(long) +@ stdcall SetEnvironmentStringsA(ptr) +@ stdcall SetEnvironmentStringsW(ptr) +@ stdcall SetEnvironmentVariableA(str str) +@ stdcall SetEnvironmentVariableW(wstr wstr) +@ stdcall SetErrorMode(long) +@ stdcall SetEvent(long) +@ stdcall SetFileApisToANSI() +@ stdcall SetFileApisToOEM() +@ stdcall SetFileAttributesA(str long) +@ stdcall SetFileAttributesW(wstr long) +@ stdcall SetFileCompletionNotificationModes(ptr long) +@ stdcall SetFilePointer(long long ptr long) +@ stdcall SetFilePointerEx(long double ptr long) +@ stdcall SetFileShortNameA(long str) +@ stdcall SetFileShortNameW(long wstr) +@ stdcall SetFileTime(long ptr ptr ptr) +@ stdcall SetFileValidData(long double) +@ stdcall SetFirmwareEnvironmentVariableA(str str ptr long) +@ stdcall SetFirmwareEnvironmentVariableW(wstr wstr ptr long) +@ stdcall -i386 SetHandleContext(long long) ; missing in Win 7 x64 +@ stdcall SetHandleCount(long) +@ stdcall SetHandleInformation(long long long) +@ stdcall SetInformationJobObject(long long ptr long) +@ stdcall SetLastConsoleEventActive() ; missing in XP SP3 +@ stdcall SetLastError(long) ntdll.RtlSetLastWin32Error +@ stdcall SetLocalPrimaryComputerNameA(long long) ; missing in XP SP3 +@ stdcall SetLocalPrimaryComputerNameW(long long) ; missing in XP SP3 +@ stdcall SetLocalTime(ptr) +@ stdcall SetLocaleInfoA(long long str) +@ stdcall SetLocaleInfoW(long long wstr) +@ stdcall SetMailslotInfo(long long) +@ stdcall SetMessageWaitingIndicator(ptr long) +@ stdcall SetNamedPipeHandleState(long ptr ptr ptr) +@ stdcall SetPriorityClass(long long) +@ stdcall SetProcessAffinityMask(long long) +@ stdcall SetProcessPriorityBoost(long long) +@ stdcall SetProcessShutdownParameters(long long) +@ stdcall SetProcessWorkingSetSize(long long long) +@ stdcall SetProcessWorkingSetSizeEx(long long long long) +@ stdcall SetStdHandle(long long) +@ stdcall SetSystemFileCacheSize(long long long) +@ stdcall SetSystemPowerState(long long) +@ stdcall SetSystemTime(ptr) +@ stdcall SetSystemTimeAdjustment(long long) +@ stdcall SetTapeParameters(ptr long ptr) +@ stdcall SetTapePosition(ptr long long long long long) +@ stdcall SetTermsrvAppInstallMode(long) +@ stdcall SetThreadAffinityMask(long long) +@ stdcall SetThreadContext(long ptr) +@ stdcall SetThreadExecutionState(long) +@ stdcall SetThreadIdealProcessor(long long) +@ stdcall SetThreadLocale(long) +@ stdcall SetThreadPriority(long long) +@ stdcall SetThreadPriorityBoost(long long) +@ stdcall SetThreadStackGuarantee(ptr) +@ stdcall SetThreadUILanguage(long) +@ stdcall SetTimeZoneInformation(ptr) +@ stdcall SetTimerQueueTimer(long ptr ptr long long long) +@ stdcall SetUnhandledExceptionFilter(ptr) +@ stdcall SetUserGeoID(long) +@ stdcall SetVDMCurrentDirectories(long long) +@ stdcall SetVolumeLabelA(str str) +@ stdcall SetVolumeLabelW(wstr wstr) +@ stdcall SetVolumeMountPointA(str str) +@ stdcall SetVolumeMountPointW(wstr wstr) +@ stdcall SetWaitableTimer(long ptr long ptr ptr long) +@ stdcall SetupComm(long long long) +@ stdcall ShowConsoleCursor(long long) +@ stdcall SignalObjectAndWait(long long long long) +@ stdcall SizeofResource(long long) +@ stdcall Sleep(long) +@ stdcall SleepEx(long long) +@ stdcall SuspendThread(long) +@ stdcall SwitchToFiber(ptr) +@ stdcall SwitchToThread() +@ stdcall SystemTimeToFileTime(ptr ptr) +@ stdcall SystemTimeToTzSpecificLocalTime (ptr ptr ptr) +@ stdcall TerminateJobObject(long long) +@ stdcall TerminateProcess(long long) +@ stdcall TerminateThread(long long) +@ stdcall TermsrvAppInstallMode() +@ stdcall Thread32First(long ptr) +@ stdcall Thread32Next(long ptr) +@ stdcall TlsAlloc() +@ stdcall TlsFree(long) +@ stdcall -norelay TlsGetValue(long) +@ stdcall -norelay TlsSetValue(long ptr) +@ stdcall Toolhelp32ReadProcessMemory(long ptr ptr long ptr) +@ stdcall TransactNamedPipe(long ptr long ptr long ptr ptr) +@ stdcall TransmitCommChar(long long) +@ stdcall TryEnterCriticalSection(ptr) ntdll.RtlTryEnterCriticalSection +@ stdcall TzSpecificLocalTimeToSystemTime(ptr ptr ptr) +@ stdcall UTRegister(long str str str ptr ptr ptr) +@ stdcall UTUnRegister(long) +@ stdcall UnhandledExceptionFilter(ptr) +@ stdcall UnlockFile(long long long long long) +@ stdcall UnlockFileEx(long long long long ptr) +@ stdcall UnmapViewOfFile(ptr) +@ stdcall UnregisterConsoleIME() +@ stdcall UnregisterWait(long) +@ stdcall UnregisterWaitEx(long long) +@ stdcall UpdateResourceA(long str str long ptr long) +@ stdcall UpdateResourceW(long wstr wstr long ptr long) +@ stdcall VDMConsoleOperation(long long) +@ stdcall VDMOperationStarted(long) +@ stdcall ValidateLCType(long long ptr ptr) +@ stdcall ValidateLocale(long) +@ stdcall VerLanguageNameA(long str long) +@ stdcall VerLanguageNameW(long wstr long) +@ stdcall -ret64 VerSetConditionMask(long long long long) ntdll.VerSetConditionMask +@ stdcall VerifyConsoleIoHandle(long) +@ stdcall VerifyVersionInfoA(long long double) +@ stdcall VerifyVersionInfoW(long long double) +@ stdcall VirtualAlloc(ptr long long long) +@ stdcall VirtualAllocEx(long ptr long long long) +@ stdcall VirtualFree(ptr long long) +@ stdcall VirtualFreeEx(long ptr long long) +@ stdcall VirtualLock(ptr long) +@ stdcall VirtualProtect(ptr long long ptr) +@ stdcall VirtualProtectEx(long ptr long long ptr) +@ stdcall VirtualQuery(ptr ptr long) +@ stdcall VirtualQueryEx(long ptr ptr long) +@ stdcall VirtualUnlock(ptr long) +@ stdcall WTSGetActiveConsoleSessionId() +@ stdcall WaitCommEvent(long ptr ptr) +@ stdcall WaitForDebugEvent(ptr long) +@ stdcall WaitForMultipleObjects(long ptr long long) +@ stdcall WaitForMultipleObjectsEx(long ptr long long long) +@ stdcall WaitForSingleObject(long long) +@ stdcall WaitForSingleObjectEx(long long long) +@ stdcall WaitNamedPipeA (str long) +@ stdcall WaitNamedPipeW (wstr long) +@ stdcall WideCharToMultiByte(long long wstr long ptr long ptr ptr) +@ stdcall WinExec(str long) +@ stdcall Wow64DisableWow64FsRedirection(ptr) +@ stdcall Wow64EnableWow64FsRedirection(long) +@ stdcall Wow64RevertWow64FsRedirection(ptr) +@ stdcall WriteConsoleA(long ptr long ptr ptr) +@ stdcall WriteConsoleInputA(long ptr long ptr) +@ stdcall WriteConsoleInputVDMA(long long long long) +@ stdcall WriteConsoleInputVDMW(long long long long) +@ stdcall WriteConsoleInputW(long ptr long ptr) +@ stdcall WriteConsoleOutputA(long ptr long long ptr) +@ stdcall WriteConsoleOutputAttribute(long ptr long long ptr) +@ stdcall WriteConsoleOutputCharacterA(long ptr long long ptr) +@ stdcall WriteConsoleOutputCharacterW(long ptr long long ptr) +@ stdcall WriteConsoleOutputW(long ptr long long ptr) +@ stdcall WriteConsoleW(long ptr long ptr ptr) +@ stdcall WriteFile(long ptr long ptr ptr) +@ stdcall WriteFileEx(long ptr long ptr ptr) +@ stdcall WriteFileGather(long ptr long ptr ptr) +@ stdcall WritePrivateProfileSectionA(str str str) +@ stdcall WritePrivateProfileSectionW(wstr wstr wstr) +@ stdcall WritePrivateProfileStringA(str str str str) +@ stdcall WritePrivateProfileStringW(wstr wstr wstr wstr) +@ stdcall WritePrivateProfileStructA (str str ptr long str) +@ stdcall WritePrivateProfileStructW(wstr wstr ptr long wstr) +@ stdcall WriteProcessMemory(long ptr ptr long ptr) +@ stdcall WriteProfileSectionA(str str) +@ stdcall WriteProfileSectionW(str str) +@ stdcall WriteProfileStringA(str str str) +@ stdcall WriteProfileStringW(wstr wstr wstr) +@ stdcall WriteTapemark(ptr long long long) +@ stdcall ZombifyActCtx(ptr) @ stdcall -arch=x86_64 __C_specific_handler() ntdll.__C_specific_handler @ stdcall -arch=x86_64 __chkstk() ntdll.__chkstk ;@ stdcall -arch=x86_64 __misaligned_access() ntdll.__misaligned_access -950 stdcall _hread(long ptr long) -951 stdcall _hwrite(long ptr long) -952 stdcall _lclose(long) -953 stdcall _lcreat(str long) -954 stdcall _llseek(long long long) +@ stdcall _hread(long ptr long) +@ stdcall _hwrite(long ptr long) +@ stdcall _lclose(long) +@ stdcall _lcreat(str long) +@ stdcall _llseek(long long long) @ stdcall -arch=x86_64 _local_unwind() ntdll._local_unwind -955 stdcall _lopen(str long) -956 stdcall _lread(long ptr long) _hread -957 stdcall _lwrite(long ptr long) _hwrite -958 stdcall lstrcat(str str) lstrcatA -959 stdcall lstrcatA(str str) -960 stdcall lstrcatW(wstr wstr) -961 stdcall lstrcmp(str str) lstrcmpA -962 stdcall lstrcmpA(str str) -963 stdcall lstrcmpW(wstr wstr) -964 stdcall lstrcmpi(str str) lstrcmpiA -965 stdcall lstrcmpiA(str str) -966 stdcall lstrcmpiW(wstr wstr) -967 stdcall lstrcpy(ptr str) lstrcpyA -968 stdcall lstrcpyA(ptr str) -969 stdcall lstrcpyW(ptr wstr) -970 stdcall lstrcpyn(ptr str long) lstrcpynA -971 stdcall lstrcpynA(ptr str long) -972 stdcall lstrcpynW(ptr wstr long) -973 stdcall lstrlen(str) lstrlenA -974 stdcall lstrlenA(str) -975 stdcall lstrlenW(wstr) +@ stdcall _lopen(str long) +@ stdcall _lread(long ptr long) _hread +@ stdcall _lwrite(long ptr long) _hwrite +@ stdcall lstrcat(str str) lstrcatA +@ stdcall lstrcatA(str str) +@ stdcall lstrcatW(wstr wstr) +@ stdcall lstrcmp(str str) lstrcmpA +@ stdcall lstrcmpA(str str) +@ stdcall lstrcmpW(wstr wstr) +@ stdcall lstrcmpi(str str) lstrcmpiA +@ stdcall lstrcmpiA(str str) +@ stdcall lstrcmpiW(wstr wstr) +@ stdcall lstrcpy(ptr str) lstrcpyA +@ stdcall lstrcpyA(ptr str) +@ stdcall lstrcpyW(ptr wstr) +@ stdcall lstrcpyn(ptr str long) lstrcpynA +@ stdcall lstrcpynA(ptr str long) +@ stdcall lstrcpynW(ptr wstr long) +@ stdcall lstrlen(str) lstrlenA +@ stdcall lstrlenA(str) +@ stdcall lstrlenW(wstr) ;@ stdcall -arch=x86_64 uaw_lstrcmpW(wstr wstr) ;@ stdcall -arch=x86_64 uaw_lstrcmpiW(wstr wstr) ;@ stdcall -arch=x86_64 uaw_lstrlenW(wstr)
6 years, 8 months
1
0
0
0
01/03: [SPEC2DEF] Implement support for different OS versions
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=01df9a410c25cfce61fb7…
commit 01df9a410c25cfce61fb733c5cb7b79c1507b449 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Feb 18 21:22:52 2018 +0100 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Apr 21 18:31:27 2018 +0200 [SPEC2DEF] Implement support for different OS versions --- sdk/tools/spec2def/spec2def.c | 79 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 63 insertions(+), 16 deletions(-) diff --git a/sdk/tools/spec2def/spec2def.c b/sdk/tools/spec2def/spec2def.c index ef9bfcd86f..f5a91aa326 100644 --- a/sdk/tools/spec2def/spec2def.c +++ b/sdk/tools/spec2def/spec2def.c @@ -49,6 +49,7 @@ char *pszSourceFileName = NULL; char *pszDllName = NULL; char *gpszUnderscore = ""; int gbDebug; +unsigned guOsVersion = 0x502; #define DbgPrint(...) (!gbDebug || fprintf(stderr, __VA_ARGS__)) enum @@ -129,6 +130,7 @@ CompareToken(const char *token, const char *comparand) token++; comparand++; } + if (IsSeparator(comparand[-1])) return 1; if (!IsSeparator(*token)) return 0; return 1; } @@ -709,7 +711,7 @@ ParseFile(char* pcStart, FILE *fileDest, PFNOUTLINE OutputLine) char *pc, *pcLine; int nLine; EXPORT exp; - int included; + int included, version_included; char namebuffer[16]; unsigned int i; @@ -726,12 +728,6 @@ ParseFile(char* pcStart, FILE *fileDest, PFNOUTLINE OutputLine) exp.uFlags = 0; exp.nNumber++; - //if (!strncmp(pcLine, "22 stdcall @(long) MPR_Alloc",28)) - // gbDebug = 1; - - //fprintf(stderr, "info: line %d, token:'%d, %.20s'\n", - // nLine, TokenLength(pcLine), pcLine); - /* Skip white spaces */ while (*pc == ' ' || *pc == '\t') pc++; @@ -739,9 +735,6 @@ ParseFile(char* pcStart, FILE *fileDest, PFNOUTLINE OutputLine) if (*pc == ';' || *pc <= '#') continue; if (*pc == 0) return 0; - //fprintf(stderr, "info: line %d, token:'%.*s'\n", - // nLine, TokenLength(pc), pc); - /* Now we should get either an ordinal or @ */ if (*pc == '@') exp.nOrdinal = -1; @@ -795,8 +788,6 @@ ParseFile(char* pcStart, FILE *fileDest, PFNOUTLINE OutputLine) return -11; } - //fprintf(stderr, "info: nCallingConvention: %d\n", exp.nCallingConvention); - /* Go to next token (options or name) */ if (!(pc = NextToken(pc))) { @@ -806,16 +797,17 @@ ParseFile(char* pcStart, FILE *fileDest, PFNOUTLINE OutputLine) /* Handle options */ included = 1; + version_included = 1; while (*pc == '-') { - if (CompareToken(pc, "-arch")) + if (CompareToken(pc, "-arch=")) { /* Default to not included */ included = 0; pc += 5; /* Look if we are included */ - while (*pc == '=' || *pc == ',') + do { pc++; if (CompareToken(pc, pszArchString) || @@ -826,12 +818,63 @@ ParseFile(char* pcStart, FILE *fileDest, PFNOUTLINE OutputLine) /* Skip to next arch or end */ while (*pc > ',') pc++; - } + } while (*pc == ','); } else if (CompareToken(pc, "-i386")) { if (giArch != ARCH_X86) included = 0; } + else if (CompareToken(pc, "-version=")) + { + /* Default to not included */ + version_included = 0; + pc += 8; + + /* Look if we are included */ + do + { + unsigned version, endversion; + + /* Optionally skip leading '0x' */ + pc++; + if ((pc[0] == '0') && (pc[1] == 'x')) pc += 2; + + /* Now get the version number */ + endversion = version = strtoul(pc, &pc, 16); + + /* Check if it's a range */ + if (pc[0] == '+') + { + endversion = 0xFFF; + pc++; + } + else if (pc[0] == '-') + { + /* Optionally skip leading '0x' */ + pc++; + if ((pc[0] == '0') && (pc[1] == 'x')) pc += 2; + endversion = strtoul(pc, &pc, 16); + } + + /* Check for degenerate range */ + if (version > endversion) + { + fprintf(stderr, "%s line %d: error: invalid version rangen\n", pszSourceFileName, nLine); + return -1; + } + + /* Now compare the range with our version */ + if ((guOsVersion >= version) && + (guOsVersion <= endversion)) + { + version_included = 1; + } + + /* Skip to next arch or end */ + while (*pc > ',') pc++; + + } while (*pc == ','); + } else if (CompareToken(pc, "-private")) { exp.uFlags |= FL_PRIVATE; @@ -877,7 +920,7 @@ ParseFile(char* pcStart, FILE *fileDest, PFNOUTLINE OutputLine) //fprintf(stderr, "info: Name:'%.10s'\n", pc); /* If arch didn't match ours, skip this entry */ - if (!included) continue; + if (!included || !version_included) continue; /* Get name */ exp.strName.buf = pc; @@ -1118,6 +1161,10 @@ int main(int argc, char *argv[]) { pszDllName = argv[i] + 3; } + else if (strcasecmp(argv[i], "--version=0x") == 0) + { + guOsVersion = strtoul(argv[i] + sizeof("--version=0x"), NULL, 16); + } else if (strcasecmp(argv[i], "--implib") == 0) { gbImportLib = 1;
6 years, 8 months
1
0
0
0
01/01: [SYSETUP] Add property page provider stubs and register them
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a717eb373aff60c811ecc…
commit a717eb373aff60c811ecc30c2c96ba882cb88e71 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sat Apr 21 14:14:49 2018 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sat Apr 21 14:15:23 2018 +0200 [SYSETUP] Add property page provider stubs and register them --- dll/win32/syssetup/CMakeLists.txt | 1 + dll/win32/syssetup/proppage.c | 112 ++++++++++++++++++++++++++++++++++++++ dll/win32/syssetup/syssetup.spec | 12 ++-- media/inf/legcydrv.inf | 7 ++- media/inf/msmouse.inf | 1 + 5 files changed, 124 insertions(+), 9 deletions(-) diff --git a/dll/win32/syssetup/CMakeLists.txt b/dll/win32/syssetup/CMakeLists.txt index 2698536a26..13286aa643 100644 --- a/dll/win32/syssetup/CMakeLists.txt +++ b/dll/win32/syssetup/CMakeLists.txt @@ -6,6 +6,7 @@ list(APPEND SOURCE dllmain.c install.c logfile.c + proppage.c security.c wizard.c precomp.h diff --git a/dll/win32/syssetup/proppage.c b/dll/win32/syssetup/proppage.c new file mode 100644 index 0000000000..fa2ee4a9b7 --- /dev/null +++ b/dll/win32/syssetup/proppage.c @@ -0,0 +1,112 @@ +/* + * PROJECT: ReactOS system libraries + * LICENSE: GPL - See COPYING in the top level directory + * FILE: dll/win32/syssetup/proppage.c + * PURPOSE: Property page providers + * PROGRAMMERS: Copyright 2018 Eric Kohl <eric.kohl(a)reactos.org> + */ + +#include "precomp.h" + +#define NDEBUG +#include <debug.h> + + +/* + * @implemented + */ +BOOL +WINAPI +CdromPropPageProvider( + _In_ PSP_PROPSHEETPAGE_REQUEST lpPropSheetPageRequest, + _In_ LPFNADDPROPSHEETPAGE lpfnAddPropSheetPageProc, + _In_ LPARAM lParam) +{ + DPRINT("CdromPropPageProvider(%p %p %lx)\n", + lpPropSheetPageRequest, lpfnAddPropSheetPageProc, lParam); + return FALSE; +} + + +/* + * @implemented + */ +BOOL +WINAPI +DiskPropPageProvider( + _In_ PSP_PROPSHEETPAGE_REQUEST lpPropSheetPageRequest, + _In_ LPFNADDPROPSHEETPAGE lpfnAddPropSheetPageProc, + _In_ LPARAM lParam) +{ + DPRINT("DiskPropPageProvider(%p %p %lx)\n", + lpPropSheetPageRequest, lpfnAddPropSheetPageProc, lParam); + return FALSE; +} + + +/* + * @implemented + */ +BOOL +WINAPI +EisaUpHalPropPageProvider( + _In_ PSP_PROPSHEETPAGE_REQUEST lpPropSheetPageRequest, + _In_ LPFNADDPROPSHEETPAGE lpfnAddPropSheetPageProc, + _In_ LPARAM lParam) +{ + DPRINT("EisaUpHalPropPageProvider(%p %p %lx)\n", + lpPropSheetPageRequest, lpfnAddPropSheetPageProc, lParam); + return FALSE; +} + + +/* + * @unimplemented + */ +BOOL +WINAPI +LegacyDriverPropPageProvider( + _In_ PSP_PROPSHEETPAGE_REQUEST lpPropSheetPageRequest, + _In_ LPFNADDPROPSHEETPAGE lpfnAddPropSheetPageProc, + _In_ LPARAM lParam) +{ + DPRINT1("LegacyDriverPropPageProvider(%p %p %lx)\n", + lpPropSheetPageRequest, lpfnAddPropSheetPageProc, lParam); + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +BOOL +WINAPI +PS2MousePropPageProvider( + _In_ PSP_PROPSHEETPAGE_REQUEST lpPropSheetPageRequest, + _In_ LPFNADDPROPSHEETPAGE lpfnAddPropSheetPageProc, + _In_ LPARAM lParam) +{ + DPRINT1("PS2MousePropPageProvider(%p %p %lx)\n", + lpPropSheetPageRequest, lpfnAddPropSheetPageProc, lParam); + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @implemented + */ +BOOL +WINAPI +TapePropPageProvider( + _In_ PSP_PROPSHEETPAGE_REQUEST lpPropSheetPageRequest, + _In_ LPFNADDPROPSHEETPAGE lpfnAddPropSheetPageProc, + _In_ LPARAM lParam) +{ + DPRINT("TapePropPageProvider(%p %p %lx)\n", + lpPropSheetPageRequest, lpfnAddPropSheetPageProc, lParam); + return FALSE; +} + +/* EOF */ diff --git a/dll/win32/syssetup/syssetup.spec b/dll/win32/syssetup/syssetup.spec index 6f5391db33..361a41d367 100644 --- a/dll/win32/syssetup/syssetup.spec +++ b/dll/win32/syssetup/syssetup.spec @@ -7,7 +7,7 @@ @ stub AsrpGetLocalDiskInfo @ stub AsrpGetLocalVolumeInfo @ stub AsprRestoreNonCriticalDisksW -@ stub CdromPropPageProvider +@ stdcall CdromPropPageProvider(ptr ptr long) @ stdcall ComputerClassInstaller(long ptr ptr) @ stub CreateLocalAdminAccount @ stub CreateLocalAdminAccountEx @@ -15,22 +15,22 @@ @ stdcall CriticalDeviceCoInstaller(long ptr ptr ptr) @ stub DevInstallW @ stdcall DeviceBayClassInstaller(long ptr ptr) -@ stub DiskPropPageProvider +@ stdcall DiskPropPageProvider(ptr ptr long) @ stub DoInstallComponentInfs @ stdcall EisaUpHalCoInstaller(long ptr ptr ptr) -@ stub EisaUpHalPropPageProvider +@ stdcall EisaUpHalPropPageProvider(ptr ptr long) @ stub GenerateName @ stdcall HdcClassInstaller(long ptr ptr) @ stdcall InitializeSetupActionLog(long) @ stdcall InstallWindowsNt(long ptr) @ stub InvokeExternalApplicationEx @ stdcall KeyboardClassInstaller(long ptr ptr) -@ stub LegacyDriverPropPageProvider +@ stdcall LegacyDriverPropPageProvider(ptr ptr long) @ stub MigrateExceptionPackages @ stdcall MouseClassInstaller(long ptr ptr) @ stdcall NtApmClassInstaller(long ptr ptr) @ stub OpkCheckVersion -@ stub PS2MousePropPageProvider +@ stdcall PS2MousePropPageProvider(ptr ptr long) @ stub PnPInitializationThread @ stub PrepareForAudit @ stub RepairStartMenuItems @@ -76,7 +76,7 @@ @ stdcall StorageCoInstaller(long ptr ptr ptr) @ stub SystemUpdateUserProfileDirectory @ stdcall TapeClassInstaller(long ptr ptr) -@ stub TapePropPageProvider +@ stdcall TapePropPageProvider(ptr ptr long) @ stdcall TerminateSetupActionLog() @ stub UpdatePnpDeviceDrivers @ stub UpgradePrinters diff --git a/media/inf/legcydrv.inf b/media/inf/legcydrv.inf index 37e88cb4df..f7f6c32ba1 100644 --- a/media/inf/legcydrv.inf +++ b/media/inf/legcydrv.inf @@ -11,9 +11,10 @@ DriverVer = 3/20/2012,1.01.0.0 AddReg = LegacyDriverClass.NT.AddReg [LegacyDriverClass.NT.AddReg] -HKR, , , 0, %LegacyDriverClassName% -HKR, , Icon, 0, "-19" -HKR, , NoDisplayClass, 0, 1 +HKR, , , 0, %LegacyDriverClassName% +HKR, , Icon, 0, "-19" +HKR, , NoDisplayClass, 0, 1 +HKR, , EnumPropPages32, 0, "syssetup.dll,LegacyDriverPropPageProvider" ;-------------------------------- STRINGS ------------------------------- diff --git a/media/inf/msmouse.inf b/media/inf/msmouse.inf index 06e86084c0..52c3bee999 100644 --- a/media/inf/msmouse.inf +++ b/media/inf/msmouse.inf @@ -106,6 +106,7 @@ LoadOrderGroup = Keyboard Port HKLM,"SYSTEM\CurrentControlSet\Services\i8042prt\Parameters","SampleRate",0x00010001,0x0000003c HKLM,"SYSTEM\CurrentControlSet\Services\i8042prt\Parameters","BreakOnSysRq",0x00010001,0x00000001 HKLM,"SYSTEM\CurrentControlSet\Services\i8042prt\Parameters","MouseResolution",0x00010001,0x00000003 +HKR, , EnumPropPages32, 0, "syssetup.dll,PS2MousePropPageProvider" HKR, , LocationInformationOverride, 0, %LocationOverride% ;---------------------------- HID MOUSE DRIVER --------------------------
6 years, 8 months
1
0
0
0
02/02: [COMCTL32_APITEST] Add some button tests
by Giannis Adamopoulos
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=082cdfb9e8ee0fb617165…
commit 082cdfb9e8ee0fb617165e960de916ef39bdbe2d Author: Giannis Adamopoulos <gadamopoulos(a)reactos.org> AuthorDate: Sun Apr 8 21:28:53 2018 +0300 Commit: David Quintana <gigaherz(a)gmail.com> CommitDate: Fri Apr 20 16:27:17 2018 +0200 [COMCTL32_APITEST] Add some button tests --- modules/rostests/apitests/comctl32/button.c | 100 ++++++++++++++++++++++++++-- 1 file changed, 96 insertions(+), 4 deletions(-) diff --git a/modules/rostests/apitests/comctl32/button.c b/modules/rostests/apitests/comctl32/button.c index f6b7669e6b..807fda5e13 100644 --- a/modules/rostests/apitests/comctl32/button.c +++ b/modules/rostests/apitests/comctl32/button.c @@ -640,6 +640,58 @@ MSG_ENTRY mouseleave_nonthemed_sequence[]={ {1, WM_NOTIFY, SENT, NM_CUSTOMDRAW, CDDS_PREPAINT}, {0,0}}; +MSG_ENTRY themechanged_sequence[]={ + {2, WM_THEMECHANGED, SENT}, + {1, WM_NOTIFY, SENT, 0, NM_THEMECHANGED }, + {2, WM_PAINT, POST}, + {2, WM_ERASEBKGND}, + {1, WM_CTLCOLORBTN}, + {1, WM_NOTIFY, SENT, NM_CUSTOMDRAW, CDDS_PREERASE}, + {1, WM_NOTIFY, SENT, NM_CUSTOMDRAW, CDDS_PREPAINT}, + {0,0}}; + +MSG_ENTRY enable_nonthemed_sequence[]={ + {2, WM_ENABLE, SENT}, + {1, WM_CTLCOLORBTN}, + {1, WM_CTLCOLORBTN}, + {1, WM_NOTIFY, SENT, NM_CUSTOMDRAW, CDDS_PREERASE}, + {1, WM_NOTIFY, SENT, NM_CUSTOMDRAW, CDDS_PREPAINT}, + {0,0}}; + +MSG_ENTRY btndown_nonthemed_sequence[]={ + {2, WM_LBUTTONDOWN, SENT}, + {1, WM_KILLFOCUS, SENT}, + {2, WM_SETFOCUS, SENT}, + {2, BM_SETSTATE, SENT}, + {2, WM_PAINT, POST}, + {1, WM_CTLCOLORBTN}, + {1, WM_NOTIFY, SENT, NM_CUSTOMDRAW, CDDS_PREERASE}, + {1, WM_NOTIFY, SENT, NM_CUSTOMDRAW, CDDS_PREPAINT}, + {0,0}}; + +MSG_ENTRY btndown_repeat_nonthemed_sequence[]={ + {2, WM_LBUTTONDOWN, SENT}, + {2, BM_SETSTATE, SENT}, + {0,0}}; + +MSG_ENTRY btnclick_nonthemed_sequence[]={ + {2, BM_CLICK, SENT}, + {2, WM_LBUTTONDOWN, SENT}, + {2, BM_SETSTATE, SENT}, + {2, WM_LBUTTONUP, SENT}, + {2, BM_SETSTATE , SENT}, + {2, WM_CAPTURECHANGED, SENT}, + {1, WM_COMMAND, SENT}, + {2, WM_PAINT, POST}, + {1, WM_CTLCOLORBTN}, + {1, WM_NOTIFY, SENT, NM_CUSTOMDRAW, CDDS_PREERASE}, + {1, WM_NOTIFY, SENT, NM_CUSTOMDRAW, CDDS_PREPAINT}, + {0,0}}; + +MSG_ENTRY btnup_stray_sequence[]={ + {2, WM_LBUTTONUP, SENT}, + {0,0}}; + void Test_MessagesNonThemed() { DWORD state; @@ -701,7 +753,7 @@ void Test_MessagesNonThemed() COMPARE_CACHE(pseudoleave_sequence); state = SendMessageW(hWnd2, BM_GETSTATE,0,0); - ok(state == 0, "Expected state 0, got %lu", state); + ok(state == 0, "Expected state 0, got %lu\n", state); EMPTY_CACHE(); MOVE_CURSOR(150,150); @@ -709,7 +761,7 @@ void Test_MessagesNonThemed() COMPARE_CACHE(mouseenter_nonthemed_sequence); state = SendMessageW(hWnd2, BM_GETSTATE,0,0); - ok(state == BST_HOT, "Expected state BST_HOT, got %lu", state); + ok(state == BST_HOT, "Expected state BST_HOT, got %lu\n", state); EMPTY_CACHE(); MOVE_CURSOR(151,151); @@ -717,7 +769,7 @@ void Test_MessagesNonThemed() COMPARE_CACHE(mousemove_sequence); state = SendMessageW(hWnd2, BM_GETSTATE,0,0); - ok(state == BST_HOT, "Expected state BST_HOT, got %lu", state); + ok(state == BST_HOT, "Expected state BST_HOT, got %lu\n", state); EMPTY_CACHE(); MOVE_CURSOR(0,0); @@ -727,7 +779,47 @@ void Test_MessagesNonThemed() COMPARE_CACHE(mouseleave_nonthemed_sequence); state = SendMessageW(hWnd2, BM_GETSTATE,0,0); - ok(state == 0, "Expected state 0, got %lu", state); + ok(state == 0, "Expected state 0, got %lu\n", state); + EMPTY_CACHE(); + + SendMessageW(hWnd2, WM_THEMECHANGED, 1, 0); + FlushMessages(); + COMPARE_CACHE(themechanged_sequence); + + SendMessageW(hWnd2, WM_ENABLE, TRUE, 0); + FlushMessages(); + COMPARE_CACHE(enable_nonthemed_sequence); + + SendMessageW(hWnd2, WM_LBUTTONDOWN, 0, 0); + FlushMessages(); + COMPARE_CACHE(btndown_nonthemed_sequence); + + state = SendMessageW(hWnd2, BM_GETSTATE,0,0); + ok(state == 0, "Expected state 0, got %lu\n", state); + EMPTY_CACHE(); + + SendMessageW(hWnd2, WM_LBUTTONDOWN, 0, 0); + FlushMessages(); + COMPARE_CACHE(btndown_repeat_nonthemed_sequence); + + state = SendMessageW(hWnd2, BM_GETSTATE,0,0); + ok(state == 0, "Expected state 0, got %lu\n", state); + EMPTY_CACHE(); + + SendMessageW(hWnd2, BM_CLICK, 0, 0); + FlushMessages(); + COMPARE_CACHE(btnclick_nonthemed_sequence); + + state = SendMessageW(hWnd2, BM_GETSTATE,0,0); + ok(state == 0, "Expected state 0, got %lu\n", state); + EMPTY_CACHE(); + + SendMessageW(hWnd2, WM_LBUTTONUP, 0, 0); + FlushMessages(); + COMPARE_CACHE(btnup_stray_sequence); + + state = SendMessageW(hWnd2, BM_GETSTATE,0,0); + ok(state == 0, "Expected state 0, got %lu\n", state); EMPTY_CACHE(); DestroyWindow(hWnd1);
6 years, 8 months
1
0
0
0
01/02: [COMCTL32] Sync with Wine Staging 3.3. CORE-14434
by Giannis Adamopoulos
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b3fb8555bf9abcc04eeac…
commit b3fb8555bf9abcc04eeac31c7153d33e2f027fc0 Author: Giannis Adamopoulos <gadamopoulos(a)reactos.org> AuthorDate: Wed Apr 4 16:39:21 2018 +0300 Commit: David Quintana <gigaherz(a)gmail.com> CommitDate: Fri Apr 20 16:27:17 2018 +0200 [COMCTL32] Sync with Wine Staging 3.3. CORE-14434 --- dll/win32/comctl32/CMakeLists.txt | 15 +- dll/win32/comctl32/animate.c | 86 +- dll/win32/comctl32/button.c | 1743 ++++--- dll/win32/comctl32/combo.c | 2160 +++++++++ dll/win32/comctl32/comboex.c | 58 +- dll/win32/comctl32/comctl32.h | 173 +- dll/win32/comctl32/comctl32undoc.c | 25 +- dll/win32/comctl32/commctrl.c | 62 +- dll/win32/comctl32/datetime.c | 36 +- dll/win32/comctl32/dpa.c | 12 + dll/win32/comctl32/draglist.c | 9 + dll/win32/comctl32/dsa.c | 8 + dll/win32/comctl32/edit.c | 5041 ++++++++++++++++++++ dll/win32/comctl32/flatsb.c | 8 + dll/win32/comctl32/header.c | 60 +- dll/win32/comctl32/hotkey.c | 14 +- dll/win32/comctl32/imagelist.c | 81 +- dll/win32/comctl32/ipaddress.c | 32 +- dll/win32/comctl32/listbox.c | 3083 ++++++++++++ dll/win32/comctl32/listview.c | 63 +- dll/win32/comctl32/monthcal.c | 83 +- dll/win32/comctl32/nativefont.c | 8 + dll/win32/comctl32/pager.c | 14 +- dll/win32/comctl32/precomp.h | 28 + dll/win32/comctl32/progress.c | 35 +- dll/win32/comctl32/propsheet.c | 26 +- dll/win32/comctl32/rebar.c | 17 +- dll/win32/comctl32/rsrc.rc | 5 +- dll/win32/comctl32/smoothscroll.c | 9 +- dll/win32/comctl32/static.c | 793 +++ dll/win32/comctl32/status.c | 22 +- dll/win32/comctl32/string.c | 16 + dll/win32/comctl32/syslink.c | 28 +- dll/win32/comctl32/tab.c | 14 + dll/win32/comctl32/taskdialog.c | 20 +- dll/win32/comctl32/theme_button.c | 4 + dll/win32/comctl32/theme_dialog.c | 14 +- dll/win32/comctl32/theme_scrollbar.c | 15 +- dll/win32/comctl32/theming.c | 42 +- dll/win32/comctl32/toolbar.c | 31 +- dll/win32/comctl32/tooltips.c | 46 +- dll/win32/comctl32/trackbar.c | 30 +- dll/win32/comctl32/treeview.c | 83 +- dll/win32/comctl32/updown.c | 80 +- ...144ccf1df_5.82.2600.2982_none_deadbeef.manifest | 1 + ...4144ccf1df_6.0.2600.2982_none_deadbeef.manifest | 1 + 46 files changed, 12986 insertions(+), 1248 deletions(-) diff --git a/dll/win32/comctl32/CMakeLists.txt b/dll/win32/comctl32/CMakeLists.txt index 9285001478..4a1151bd98 100644 --- a/dll/win32/comctl32/CMakeLists.txt +++ b/dll/win32/comctl32/CMakeLists.txt @@ -13,6 +13,7 @@ spec2def(comctl32.dll comctl32.spec ADD_IMPORTLIB) list(APPEND SOURCE animate.c button.c + combo.c comboex.c comctl32undoc.c commctrl.c @@ -20,11 +21,13 @@ list(APPEND SOURCE dpa.c draglist.c dsa.c + edit.c flatsb.c header.c hotkey.c imagelist.c ipaddress.c + listbox.c listview.c monthcal.c nativefont.c @@ -33,16 +36,12 @@ list(APPEND SOURCE propsheet.c rebar.c smoothscroll.c + static.c status.c string.c syslink.c tab.c taskdialog.c - theme_button.c - theme_combo.c - theme_dialog.c - theme_edit.c - theme_listbox.c theme_scrollbar.c theming.c toolbar.c @@ -50,7 +49,7 @@ list(APPEND SOURCE trackbar.c treeview.c updown.c - comctl32.h) + precomp.h) add_library(comctl32 SHARED ${SOURCE} @@ -61,8 +60,8 @@ add_library(comctl32 SHARED set_module_type(comctl32 win32dll UNICODE) target_link_libraries(comctl32 uuid wine ${PSEH_LIB}) add_delay_importlibs(comctl32 winmm uxtheme) -add_importlibs(comctl32 user32 gdi32 advapi32 msvcrt kernel32 ntdll) -add_pch(comctl32 comctl32.h SOURCE) +add_importlibs(comctl32 user32 gdi32 advapi32 usp10 imm32 msvcrt kernel32 ntdll) +add_pch(comctl32 precomp.h SOURCE) add_cd_file(TARGET comctl32 DESTINATION reactos/system32 FOR all) add_cd_file(TARGET comctl32 DESTINATION reactos/winsxs/x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef FOR all) add_cd_file(TARGET comctl32 DESTINATION reactos/winsxs/x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef FOR all) diff --git a/dll/win32/comctl32/animate.c b/dll/win32/comctl32/animate.c index 594a227568..f8ba159779 100644 --- a/dll/win32/comctl32/animate.c +++ b/dll/win32/comctl32/animate.c @@ -20,22 +20,23 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * - * NOTES - * - * This code was audited for completeness against the documented features - * of Comctl32.dll version 6.0 on Mar. 15, 2005, by Dimitrie O. Paun. - * - * Unless otherwise noted, we believe this code to be complete, as per - * the specification mentioned above. - * If you discover missing features, or bugs, please note them below. - * * TODO: * - check for the 'rec ' list in some AVI files */ +#include <stdarg.h> +#include <string.h> +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "winnls.h" +#include "commctrl.h" +#include "vfw.h" +#include "mmsystem.h" #include "comctl32.h" - -#include <vfw.h> +#include "wine/debug.h" +#include "wine/heap.h" WINE_DEFAULT_DEBUG_CHANNEL(animate); @@ -179,36 +180,39 @@ static BOOL ANIMATE_DoStop(ANIMATE_INFO *infoPtr) static void ANIMATE_Free(ANIMATE_INFO *infoPtr) { - if (infoPtr->hMMio) { - ANIMATE_DoStop(infoPtr); - mmioClose(infoPtr->hMMio, 0); - if (infoPtr->hRes) { - FreeResource(infoPtr->hRes); - infoPtr->hRes = 0; - } - Free (infoPtr->lpIndex); + if (infoPtr->hMMio) + { + ANIMATE_DoStop(infoPtr); + mmioClose(infoPtr->hMMio, 0); + if (infoPtr->hRes) + { + FreeResource(infoPtr->hRes); + infoPtr->hRes = 0; + } + heap_free (infoPtr->lpIndex); infoPtr->lpIndex = NULL; - if (infoPtr->hic) { - fnIC.fnICClose(infoPtr->hic); - infoPtr->hic = 0; - } - Free (infoPtr->inbih); + if (infoPtr->hic) + { + fnIC.fnICClose(infoPtr->hic); + infoPtr->hic = 0; + } + heap_free (infoPtr->inbih); infoPtr->inbih = NULL; - Free (infoPtr->outbih); + heap_free (infoPtr->outbih); infoPtr->outbih = NULL; - Free (infoPtr->indata); + heap_free (infoPtr->indata); infoPtr->indata = NULL; - Free (infoPtr->outdata); + heap_free (infoPtr->outdata); infoPtr->outdata = NULL; - if( infoPtr->hbmPrevFrame ) + if (infoPtr->hbmPrevFrame) { - DeleteObject(infoPtr->hbmPrevFrame); + DeleteObject(infoPtr->hbmPrevFrame); infoPtr->hbmPrevFrame = 0; } - memset(&infoPtr->mah, 0, sizeof(infoPtr->mah)); - memset(&infoPtr->ash, 0, sizeof(infoPtr->ash)); - infoPtr->nFromFrame = infoPtr->nToFrame = infoPtr->nLoop = infoPtr->currFrame = 0; + memset(&infoPtr->mah, 0, sizeof(infoPtr->mah)); + memset(&infoPtr->ash, 0, sizeof(infoPtr->ash)); + infoPtr->nFromFrame = infoPtr->nToFrame = infoPtr->nLoop = infoPtr->currFrame = 0; } infoPtr->transparentColor = ANIMATE_COLOR_NONE; } @@ -562,7 +566,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr) return FALSE; } - infoPtr->inbih = Alloc(mmckInfo.cksize); + infoPtr->inbih = heap_alloc_zero(mmckInfo.cksize); if (!infoPtr->inbih) { WARN("Can't alloc input BIH\n"); return FALSE; @@ -609,7 +613,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr) /* FIXME: should handle the 'rec ' LIST when present */ - infoPtr->lpIndex = Alloc(infoPtr->mah.dwTotalFrames * sizeof(DWORD)); + infoPtr->lpIndex = heap_alloc_zero(infoPtr->mah.dwTotalFrames * sizeof(DWORD)); if (!infoPtr->lpIndex) return FALSE; @@ -631,7 +635,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr) infoPtr->ash.dwSuggestedBufferSize = insize; } - infoPtr->indata = Alloc(infoPtr->ash.dwSuggestedBufferSize); + infoPtr->indata = heap_alloc_zero(infoPtr->ash.dwSuggestedBufferSize); if (!infoPtr->indata) return FALSE; @@ -662,7 +666,7 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr) outSize = fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT, (DWORD_PTR)infoPtr->inbih, 0L); - infoPtr->outbih = Alloc(outSize); + infoPtr->outbih = heap_alloc_zero(outSize); if (!infoPtr->outbih) return FALSE; @@ -673,7 +677,7 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr) return FALSE; } - infoPtr->outdata = Alloc(infoPtr->outbih->biSizeImage); + infoPtr->outdata = heap_alloc_zero(infoPtr->outbih->biSizeImage); if (!infoPtr->outdata) return FALSE; @@ -767,12 +771,12 @@ static BOOL ANIMATE_OpenA(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPSTR lpsz return ANIMATE_OpenW(infoPtr, hInstance, (LPWSTR)lpszName); len = MultiByteToWideChar(CP_ACP, 0, lpszName, -1, NULL, 0); - lpwszName = Alloc(len * sizeof(WCHAR)); + lpwszName = heap_alloc(len * sizeof(WCHAR)); if (!lpwszName) return FALSE; MultiByteToWideChar(CP_ACP, 0, lpszName, -1, lpwszName, len); result = ANIMATE_OpenW(infoPtr, hInstance, lpwszName); - Free (lpwszName); + heap_free (lpwszName); return result; } @@ -805,7 +809,7 @@ static BOOL ANIMATE_Create(HWND hWnd, const CREATESTRUCTW *lpcs) } /* allocate memory for info structure */ - infoPtr = Alloc(sizeof(ANIMATE_INFO)); + infoPtr = heap_alloc_zero(sizeof(*infoPtr)); if (!infoPtr) return FALSE; /* store crossref hWnd <-> info structure */ @@ -835,7 +839,7 @@ static LRESULT ANIMATE_Destroy(ANIMATE_INFO *infoPtr) infoPtr->cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&infoPtr->cs); - Free(infoPtr); + heap_free(infoPtr); return 0; } diff --git a/dll/win32/comctl32/button.c b/dll/win32/comctl32/button.c index bdc91840d5..c313aa81e8 100644 --- a/dll/win32/comctl32/button.c +++ b/dll/win32/comctl32/button.c @@ -1,8 +1,8 @@ -/* File: button.c -- Button type widgets - * +/* * Copyright (C) 1993 Johannes Ruscheinski * Copyright (C) 1993 David Metcalfe * Copyright (C) 1994 Alexandre Julliard + * Copyright (C) 2008 by Reece H. Dunn * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,15 +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 * - * NOTES - * - * This code was audited for completeness against the documented features - * of Comctl32.dll version 6.0 on Oct. 3, 2004, by Dimitrie O. Paun. - * - * Unless otherwise noted, we believe this code to be complete, as per - * the specification mentioned above. - * If you discover missing features, or bugs, please note them below. - * * TODO * Styles * - BS_NOTIFY: is it complete? @@ -42,7 +33,7 @@ * - BCM_GETTEXTMARGIN * - BCM_SETIMAGELIST * - BCM_SETTEXTMARGIN - * + * * Notifications * - BCN_HOTITEMCHANGE * - BN_DISABLE @@ -62,18 +53,26 @@ * - Button_SetImageList * - Button_SetTextMargin */ + +#include <stdarg.h> +#include <string.h> +#include <stdlib.h> + +#define OEMRESOURCE + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "uxtheme.h" +#include "vssym32.h" +#include "wine/debug.h" +#include "wine/heap.h" + #include "comctl32.h" -#include <wine/debug.h> WINE_DEFAULT_DEBUG_CHANNEL(button); -/* GetWindowLong offsets for window extra information */ -#define STATE_GWL_OFFSET 0 -#define HFONT_GWL_OFFSET (sizeof(LONG)) -#define HIMAGE_GWL_OFFSET (HFONT_GWL_OFFSET+sizeof(HFONT)) -#define UISTATE_GWL_OFFSET (HIMAGE_GWL_OFFSET+sizeof(HFONT)) -#define NB_EXTRA_BYTES (UISTATE_GWL_OFFSET+sizeof(LONG)) - /* undocumented flags */ #define BUTTON_NSTATES 0x0F #define BUTTON_BTNPRESSED 0x40 @@ -91,12 +90,31 @@ WINE_DEFAULT_DEBUG_CHANNEL(button); (LPARAM)(hWnd)); \ } while(0) -static UINT BUTTON_CalcLabelRect( HWND hwnd, HDC hdc, RECT *rc ); -static void PB_Paint( HWND hwnd, HDC hDC, UINT action ); -static void CB_Paint( HWND hwnd, HDC hDC, UINT action ); -static void GB_Paint( HWND hwnd, HDC hDC, UINT action ); -static void UB_Paint( HWND hwnd, HDC hDC, UINT action ); -static void OB_Paint( HWND hwnd, HDC hDC, UINT action ); +typedef struct _BUTTON_INFO +{ + HWND hwnd; + LONG state; + HFONT font; + union + { + HICON icon; + HBITMAP bitmap; + HANDLE image; + } u; + +#ifdef __REACTOS__ + DWORD ui_state; + RECT rcTextMargin; + BUTTON_IMAGELIST imlData; +#endif +} BUTTON_INFO; + +static UINT BUTTON_CalcLabelRect( const BUTTON_INFO *infoPtr, HDC hdc, RECT *rc ); +static void PB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ); +static void CB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ); +static void GB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ); +static void UB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ); +static void OB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ); static void BUTTON_CheckAutoRadioButton( HWND hwnd ); #define MAX_BTN_TYPE 16 @@ -114,10 +132,24 @@ static const WORD maxCheckState[MAX_BTN_TYPE] = BST_UNCHECKED, /* BS_USERBUTTON */ BST_CHECKED, /* BS_AUTORADIOBUTTON */ BST_UNCHECKED, /* BS_PUSHBOX */ - BST_UNCHECKED /* BS_OWNERDRAW */ + BST_UNCHECKED, /* BS_OWNERDRAW */ + BST_UNCHECKED, /* BS_SPLITBUTTON */ + BST_UNCHECKED, /* BS_DEFSPLITBUTTON */ + BST_UNCHECKED, /* BS_COMMANDLINK */ + BST_UNCHECKED /* BS_DEFCOMMANDLINK */ }; -typedef void (*pfPaint)( HWND hwnd, HDC hdc, UINT action ); +/* These are indices into a states array to determine the theme state for a given theme part. */ +typedef enum +{ + STATE_NORMAL, + STATE_DISABLED, + STATE_HOT, + STATE_PRESSED, + STATE_DEFAULTED +} ButtonState; + +typedef void (*pfPaint)( const BUTTON_INFO *infoPtr, HDC hdc, UINT action ); static const pfPaint btnPaintFunc[MAX_BTN_TYPE] = { @@ -132,88 +164,76 @@ static const pfPaint btnPaintFunc[MAX_BTN_TYPE] = UB_Paint, /* BS_USERBUTTON */ CB_Paint, /* BS_AUTORADIOBUTTON */ NULL, /* BS_PUSHBOX */ - OB_Paint /* BS_OWNERDRAW */ + OB_Paint, /* BS_OWNERDRAW */ + PB_Paint, /* BS_SPLITBUTTON */ + PB_Paint, /* BS_DEFSPLITBUTTON */ + PB_Paint, /* BS_COMMANDLINK */ + PB_Paint /* BS_DEFCOMMANDLINK */ }; -/* The original code from user32 was kept in order to make it easier to bring changes from user32 */ -#ifdef _USER32_ -/********************************************************************* - * button class descriptor - */ -static const WCHAR buttonW[] = {'B','u','t','t','o','n',0}; -const struct builtin_class_descr BUTTON_builtin_class = -{ - buttonW, /* name */ - CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC, /* style */ -#ifdef __REACTOS__ - ButtonWndProcA, /* procA */ - ButtonWndProcW, /* procW */ -#else - WINPROC_BUTTON, /* proc */ -#endif - NB_EXTRA_BYTES, /* extra */ - IDC_ARROW, /* cursor */ - 0 /* brush */ -}; - - -static inline LONG get_button_state( HWND hwnd ) -{ - return GetWindowLongPtrW( hwnd, STATE_GWL_OFFSET ); -} -static inline void set_button_state( HWND hwnd, LONG state ) -{ - SetWindowLongPtrW( hwnd, STATE_GWL_OFFSET, state ); -} +#ifdef __REACTOS__ /* r73885 */ +typedef void (*pfThemedPaint)( HTHEME theme, const BUTTON_INFO *infoPtr, HDC hdc, ButtonState drawState, UINT dtflags, BOOL focused, LPARAM prfFlag); -#ifdef __REACTOS__ +static void PB_ThemedPaint( HTHEME theme, const BUTTON_INFO *infoPtr, HDC hdc, ButtonState drawState, UINT dtflags, BOOL focused, LPARAM prfFlag); +static void CB_ThemedPaint( HTHEME theme, const BUTTON_INFO *infoPtr, HDC hdc, ButtonState drawState, UINT dtflags, BOOL focused, LPARAM prfFlag); +static void GB_ThemedPaint( HTHEME theme, const BUTTON_INFO *infoPtr, HDC hdc, ButtonState drawState, UINT dtflags, BOOL focused, LPARAM prfFlag); -static __inline void set_ui_state( HWND hwnd, LONG flags ) -{ - SetWindowLongPtrW( hwnd, UISTATE_GWL_OFFSET, flags ); -} - -static __inline LONG get_ui_state( HWND hwnd ) -{ - return GetWindowLongPtrW( hwnd, UISTATE_GWL_OFFSET ); -} +#else +typedef void (*pfThemedPaint)( HTHEME theme, const BUTTON_INFO *infoPtr, HDC hdc, ButtonState drawState, UINT dtflags, BOOL focused); -#endif /* __REACTOS__ */ +static void PB_ThemedPaint( HTHEME theme, const BUTTON_INFO *infoPtr, HDC hdc, ButtonState drawState, UINT dtflags, BOOL focused); +static void CB_ThemedPaint( HTHEME theme, const BUTTON_INFO *infoPtr, HDC hdc, ButtonState drawState, UINT dtflags, BOOL focused); +static void GB_ThemedPaint( HTHEME theme, const BUTTON_INFO *infoPtr, HDC hdc, ButtonState drawState, UINT dtflags, BOOL focused); -static inline HFONT get_button_font( HWND hwnd ) -{ - return (HFONT)GetWindowLongPtrW( hwnd, HFONT_GWL_OFFSET ); -} +#endif -static inline void set_button_font( HWND hwnd, HFONT font ) +static const pfThemedPaint btnThemedPaintFunc[MAX_BTN_TYPE] = { - SetWindowLongPtrW( hwnd, HFONT_GWL_OFFSET, (LONG_PTR)font ); -} + PB_ThemedPaint, /* BS_PUSHBUTTON */ + PB_ThemedPaint, /* BS_DEFPUSHBUTTON */ + CB_ThemedPaint, /* BS_CHECKBOX */ + CB_ThemedPaint, /* BS_AUTOCHECKBOX */ + CB_ThemedPaint, /* BS_RADIOBUTTON */ + CB_ThemedPaint, /* BS_3STATE */ + CB_ThemedPaint, /* BS_AUTO3STATE */ + GB_ThemedPaint, /* BS_GROUPBOX */ + NULL, /* BS_USERBUTTON */ + CB_ThemedPaint, /* BS_AUTORADIOBUTTON */ + NULL, /* BS_PUSHBOX */ + NULL, /* BS_OWNERDRAW */ + NULL, /* BS_SPLITBUTTON */ + NULL, /* BS_DEFSPLITBUTTON */ + NULL, /* BS_COMMANDLINK */ + NULL, /* BS_DEFCOMMANDLINK */ +}; static inline UINT get_button_type( LONG window_style ) { return (window_style & BS_TYPEMASK); } +#ifndef __REACTOS__ /* paint a button of any type */ -static inline void paint_button( HWND hwnd, LONG style, UINT action ) +static inline void paint_button( BUTTON_INFO *infoPtr, LONG style, UINT action ) { - if (btnPaintFunc[style] && IsWindowVisible(hwnd)) + if (btnPaintFunc[style] && IsWindowVisible(infoPtr->hwnd)) { - HDC hdc = GetDC( hwnd ); - btnPaintFunc[style]( hwnd, hdc, action ); - ReleaseDC( hwnd, hdc ); + HDC hdc = GetDC( infoPtr->hwnd ); + btnPaintFunc[style]( infoPtr, hdc, action ); + ReleaseDC( infoPtr->hwnd, hdc ); } } +#endif -#else - -#define NtUserAlterWindowStyle SetWindowLongPtrW - -static inline void _SetButtonData(HWND hwnd, PBUTTON_DATA data) +/* retrieve the button text; returned buffer must be freed by caller */ +static inline WCHAR *get_button_text( const BUTTON_INFO *infoPtr ) { - SetWindowLongPtrW( hwnd, 0, (LONG)data ); + INT len = GetWindowTextLengthW( infoPtr->hwnd ); + WCHAR *buffer = heap_alloc( (len + 1) * sizeof(WCHAR) ); + if (buffer) + GetWindowTextW( infoPtr->hwnd, buffer, len + 1 ); + return buffer; } HRGN set_control_clipping( HDC hdc, const RECT *rect ) @@ -236,81 +256,153 @@ HRGN set_control_clipping( HDC hdc, const RECT *rect ) return hrgn; } -BOOL BUTTON_PaintWithTheme(HTHEME theme, HWND hwnd, HDC hParamDC, LPARAM prfFlag); -WCHAR *get_button_text( HWND hwnd ); - -static inline LONG_PTR get_button_image(HWND hwnd) +/********************************************************************** + * Convert button styles to flags used by DrawText. + */ +static UINT BUTTON_BStoDT( DWORD style, DWORD ex_style ) { - return _GetButtonData(hwnd)->image; -} + UINT dtStyle = DT_NOCLIP; /* We use SelectClipRgn to limit output */ -static inline LONG_PTR set_button_image(HWND hwnd, LONG_PTR image) -{ - PBUTTON_DATA data = _GetButtonData(hwnd); - LONG_PTR ret = data->image; - data->image = image; - return ret; -} + /* "Convert" pushlike buttons to pushbuttons */ + if (style & BS_PUSHLIKE) + style &= ~BS_TYPEMASK; -static inline LONG get_button_state( HWND hwnd ) -{ - return _GetButtonData(hwnd)->state; -} + if (!(style & BS_MULTILINE)) + dtStyle |= DT_SINGLELINE; + else + dtStyle |= DT_WORDBREAK; -static inline void set_button_state( HWND hwnd, LONG state ) -{ - _GetButtonData(hwnd)->state = state; -} + switch (style & BS_CENTER) + { + case BS_LEFT: /* DT_LEFT is 0 */ break; + case BS_RIGHT: dtStyle |= DT_RIGHT; break; + case BS_CENTER: dtStyle |= DT_CENTER; break; + default: + /* Pushbutton's text is centered by default */ + if (get_button_type(style) <= BS_DEFPUSHBUTTON) dtStyle |= DT_CENTER; + /* all other flavours have left aligned text */ + } -static __inline void set_ui_state( HWND hwnd, LONG flags ) -{ - _GetButtonData(hwnd)->ui_state = flags; -} + if (ex_style & WS_EX_RIGHT) dtStyle = DT_RIGHT | (dtStyle & ~(DT_LEFT | DT_CENTER)); -static __inline LONG get_ui_state( HWND hwnd ) -{ - return _GetButtonData(hwnd)->ui_state; -} + /* DrawText ignores vertical alignment for multiline text, + * but we use these flags to align label manually. + */ + if (get_button_type(style) != BS_GROUPBOX) + { + switch (style & BS_VCENTER) + { + case BS_TOP: /* DT_TOP is 0 */ break; + case BS_BOTTOM: dtStyle |= DT_BOTTOM; break; + case BS_VCENTER: /* fall through */ + default: dtStyle |= DT_VCENTER; break; + } + } + else + /* GroupBox's text is always single line and is top aligned. */ + dtStyle |= DT_SINGLELINE; -static inline HFONT get_button_font( HWND hwnd ) -{ - return (HFONT)_GetButtonData(hwnd)->font; + return dtStyle; } -static inline void set_button_font( HWND hwnd, HFONT font ) -{ - _GetButtonData(hwnd)->font = font; -} -static inline UINT get_button_type( LONG window_style ) +#ifdef __REACTOS__ +BOOL BUTTON_PaintWithTheme(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hParamDC, LPARAM prfFlag) { - return (window_style & BS_TYPEMASK); + DWORD dwStyle; + DWORD dwStyleEx; + DWORD type; + UINT dtFlags; + ButtonState drawState; + pfThemedPaint paint; + + /* Don't draw with themes on a button with BS_ICON or BS_BITMAP */ + if (infoPtr->u.image != 0) + return FALSE; + + dwStyle = GetWindowLongW(infoPtr->hwnd, GWL_STYLE); + type = get_button_type(dwStyle); + + if (type != BS_PUSHBUTTON && type != BS_DEFPUSHBUTTON && (dwStyle & BS_PUSHLIKE)) + type = BS_PUSHBUTTON; + + paint = btnThemedPaintFunc[type]; + if (!paint) + return FALSE; + + dwStyleEx = GetWindowLongW(infoPtr->hwnd, GWL_EXSTYLE); + dtFlags = BUTTON_BStoDT(dwStyle, dwStyleEx); + + if(dwStyle & WS_DISABLED) + drawState = STATE_DISABLED; + else if(infoPtr->state & BST_PUSHED) + drawState = STATE_PRESSED; + else if ((dwStyle & BS_PUSHLIKE) && (infoPtr->state & (BST_CHECKED|BST_INDETERMINATE))) + drawState = STATE_PRESSED; + else if(infoPtr->state & BST_HOT) + drawState = STATE_HOT; + else if((infoPtr->state & BST_FOCUS) || (dwStyle & BS_DEFPUSHBUTTON)) + drawState = STATE_DEFAULTED; + else + drawState = STATE_NORMAL; + + if (paint == PB_ThemedPaint || paint == CB_ThemedPaint) + { + HDC hdc; + HBITMAP hbmp; + RECT rc; + + GetClientRect(infoPtr->hwnd, &rc); + hdc = CreateCompatibleDC(hParamDC); + hbmp = CreateCompatibleBitmap(hParamDC, rc.right, rc.bottom); + if (hdc && hbmp) + { + SelectObject(hdc, hbmp); + + paint(theme, infoPtr, hdc, drawState, dtFlags, infoPtr->state & BST_FOCUS, prfFlag); + + BitBlt(hParamDC, 0, 0, rc.right, rc.bottom, hdc, 0, 0, SRCCOPY); + DeleteObject(hbmp); + DeleteDC(hdc); + return TRUE; + } + else + { + ERR("Failed to create DC and bitmap for double buffering\n"); + if (hbmp) + DeleteObject(hbmp); + if (hdc) + DeleteDC(hdc); + } + } + + paint(theme, infoPtr, hParamDC, drawState, dtFlags, infoPtr->state & BST_FOCUS, prfFlag); + return TRUE; } /* paint a button of any type */ -static inline void paint_button( HWND hwnd, LONG style, UINT action ) +static inline void paint_button( BUTTON_INFO *infoPtr, LONG style, UINT action ) { - HTHEME theme = GetWindowTheme(hwnd); + HTHEME theme = GetWindowTheme(infoPtr->hwnd); RECT rc; - HDC hdc = GetDC( hwnd ); + HDC hdc = GetDC( infoPtr->hwnd ); /* GetDC appears to give a dc with a clip rect that includes the whoe parent, not sure if it is correct or not. */ - GetClientRect(hwnd, &rc); + GetClientRect(infoPtr->hwnd, &rc); IntersectClipRect (hdc, rc.left, rc. top, rc.right, rc.bottom); - if (theme && BUTTON_PaintWithTheme(theme, hwnd, hdc, 0)) + if (theme && BUTTON_PaintWithTheme(theme, infoPtr, hdc, 0)) { - ReleaseDC( hwnd, hdc ); + ReleaseDC( infoPtr->hwnd, hdc ); return; } - if (btnPaintFunc[style] && IsWindowVisible(hwnd)) + if (btnPaintFunc[style] && IsWindowVisible(infoPtr->hwnd)) { - btnPaintFunc[style]( hwnd, hdc, action ); + btnPaintFunc[style]( infoPtr, hdc, action ); } - ReleaseDC( hwnd, hdc ); + ReleaseDC( infoPtr->hwnd, hdc ); } -BOOL BUTTON_GetIdealSize(HTHEME theme, HWND hwnd, SIZE* psize) +BOOL BUTTON_GetIdealSize(BUTTON_INFO *infoPtr, HTHEME theme, SIZE* psize) { - PBUTTON_DATA pdata; HDC hdc; WCHAR *text; HFONT hFont = 0, hPrevFont = 0; @@ -318,10 +410,9 @@ BOOL BUTTON_GetIdealSize(HTHEME theme, HWND hwnd, SIZE* psize) BOOL ret = FALSE; LOGFONTW logfont = {0}; - pdata = _GetButtonData(hwnd); - text = get_button_text( hwnd ); - hdc = GetDC(hwnd); - if (!pdata || !text || !hdc || !text[0]) + text = get_button_text(infoPtr); + hdc = GetDC(infoPtr->hwnd); + if (!text || !hdc || !text[0]) goto cleanup; /* FIXME : Should use GetThemeTextExtent but unfortunately uses DrawTextW which is broken */ @@ -337,8 +428,8 @@ BOOL BUTTON_GetIdealSize(HTHEME theme, HWND hwnd, SIZE* psize) } else { - if (pdata->font) - hPrevFont = SelectObject( hdc, pdata->font ); + if (infoPtr->font) + hPrevFont = SelectObject( hdc, infoPtr->font ); } GetTextExtentPoint32W(hdc, text, wcslen(text), &TextSize); @@ -352,13 +443,13 @@ BOOL BUTTON_GetIdealSize(HTHEME theme, HWND hwnd, SIZE* psize) if (hPrevFont) SelectObject( hdc, hPrevFont ); - TextSize.cy += pdata->rcTextMargin.top + pdata->rcTextMargin.bottom; - TextSize.cx += pdata->rcTextMargin.left + pdata->rcTextMargin.right; + TextSize.cy += infoPtr->rcTextMargin.top + infoPtr->rcTextMargin.bottom; + TextSize.cx += infoPtr->rcTextMargin.left + infoPtr->rcTextMargin.right; - if (pdata->imlData.himl && ImageList_GetIconSize(pdata->imlData.himl, &ImageSize.cx, &ImageSize.cy)) + if (infoPtr->imlData.himl && ImageList_GetIconSize(infoPtr->imlData.himl, &ImageSize.cx, &ImageSize.cy)) { - ImageSize.cx += pdata->imlData.margin.left + pdata->imlData.margin.right; - ImageSize.cy += pdata->imlData.margin.top + pdata->imlData.margin.bottom; + ImageSize.cx += infoPtr->imlData.margin.left + infoPtr->imlData.margin.right; + ImageSize.cy += infoPtr->imlData.margin.top + infoPtr->imlData.margin.bottom; } else { @@ -390,12 +481,12 @@ cleanup: if (text) HeapFree( GetProcessHeap(), 0, text ); if (hdc) - ReleaseDC(hwnd, hdc); + ReleaseDC(infoPtr->hwnd, hdc); return ret; } -BOOL BUTTON_DrawIml(HDC hDC, BUTTON_IMAGELIST *pimlData, RECT *prc, BOOL bOnlyCalc, int index) +BOOL BUTTON_DrawIml(HDC hDC, const BUTTON_IMAGELIST *pimlData, RECT *prc, BOOL bOnlyCalc, int index) { SIZE ImageSize; int left, top, count; @@ -451,13 +542,12 @@ BOOL BUTTON_DrawIml(HDC hDC, BUTTON_IMAGELIST *pimlData, RECT *prc, BOOL bOnlyCa return TRUE; } -DWORD BUTTON_SendCustomDraw(HWND hwnd, HDC hDC, DWORD dwDrawStage, RECT* prc) +DWORD BUTTON_SendCustomDraw(const BUTTON_INFO *infoPtr, HDC hDC, DWORD dwDrawStage, RECT* prc) { NMCUSTOMDRAW nmcs; - LONG state = get_button_state( hwnd ); - nmcs.hdr.hwndFrom = hwnd; - nmcs.hdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID); + nmcs.hdr.hwndFrom = infoPtr->hwnd; + nmcs.hdr.idFrom = GetWindowLongPtrW (infoPtr->hwnd, GWLP_ID); nmcs.hdr.code = NM_CUSTOMDRAW ; nmcs.dwDrawStage = dwDrawStage; nmcs.hdc = hDC; @@ -465,48 +555,28 @@ DWORD BUTTON_SendCustomDraw(HWND hwnd, HDC hDC, DWORD dwDrawStage, RECT* prc) nmcs.dwItemSpec = 0; nmcs.uItemState = 0; nmcs.lItemlParam = 0; - if(!IsWindowEnabled(hwnd)) + if(!IsWindowEnabled(infoPtr->hwnd)) nmcs.uItemState |= CDIS_DISABLED; - if (state & (BST_CHECKED | BST_INDETERMINATE)) + if (infoPtr->state & (BST_CHECKED | BST_INDETERMINATE)) nmcs.uItemState |= CDIS_CHECKED; - if (state & BST_FOCUS) + if (infoPtr->state & BST_FOCUS) nmcs.uItemState |= CDIS_FOCUS; - if (state & BST_PUSHED) + if (infoPtr->state & BST_PUSHED) nmcs.uItemState |= CDIS_SELECTED; - if (!(get_ui_state(hwnd) & UISF_HIDEACCEL)) + if (!(infoPtr->ui_state & UISF_HIDEACCEL)) nmcs.uItemState |= CDIS_SHOWKEYBOARDCUES; - return SendMessageW(GetParent(hwnd), WM_NOTIFY, nmcs.hdr.idFrom, (LPARAM)&nmcs); + return SendMessageW(GetParent(infoPtr->hwnd), WM_NOTIFY, nmcs.hdr.idFrom, (LPARAM)&nmcs); } -#endif - - -/* retrieve the button text; returned buffer must be freed by caller */ -inline WCHAR *get_button_text( HWND hwnd ) -{ - INT len = 512; - WCHAR *buffer = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ); - if (buffer) InternalGetWindowText( hwnd, buffer, len + 1 ); - return buffer; -} - -#ifdef __REACTOS__ /* Retrieve the UI state for the control */ -static BOOL button_update_uistate(HWND hwnd, BOOL unicode) +static BOOL button_update_uistate(BUTTON_INFO *infoPtr) { - LONG flags, prevflags; - - if (unicode) - flags = DefWindowProcW(hwnd, WM_QUERYUISTATE, 0, 0); - else - flags = DefWindowProcA(hwnd, WM_QUERYUISTATE, 0, 0); - - prevflags = get_ui_state(hwnd); + LONG flags = DefWindowProcW(infoPtr->hwnd, WM_QUERYUISTATE, 0, 0); - if (prevflags != flags) + if (infoPtr->ui_state != flags) { - set_ui_state(hwnd, flags); + infoPtr->ui_state = flags; return TRUE; } @@ -514,222 +584,65 @@ static BOOL button_update_uistate(HWND hwnd, BOOL unicode) } #endif -/*********************************************************************** - * ButtonWndProc_common - */ -LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, - WPARAM wParam, LPARAM lParam, BOOL unicode ) +static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { + BUTTON_INFO *infoPtr = (BUTTON_INFO *)GetWindowLongPtrW(hWnd, 0); RECT rect; POINT pt; - LONG style = GetWindowLongPtrW( hWnd, GWL_STYLE ); + LONG style = GetWindowLongW( hWnd, GWL_STYLE ); UINT btn_type = get_button_type( style ); - LONG state; + LONG state, new_state; HANDLE oldHbitmap; -#if defined(__REACTOS__) && defined(_USER32_) - PWND pWnd; + HTHEME theme; - pWnd = ValidateHwnd(hWnd); - if (pWnd) - { - if (!pWnd->fnid) - { - NtUserSetWindowFNID(hWnd, FNID_BUTTON); - } - else - { - if (pWnd->fnid != FNID_BUTTON) - { - ERR("Wrong window class for Button! fnId 0x%x\n",pWnd->fnid); - return 0; - } - } - } - else - return 0; -#else if (!IsWindow( hWnd )) return 0; -#endif + + if (!infoPtr && (uMsg != WM_NCCREATE)) + return DefWindowProcW(hWnd, uMsg, wParam, lParam); pt.x = (short)LOWORD(lParam); pt.y = (short)HIWORD(lParam); -#ifndef _USER32_ - switch (uMsg) - { - case WM_NCCREATE: - { - PBUTTON_DATA data = HeapAlloc( GetProcessHeap(), 0, sizeof(BUTTON_DATA) ); - if (!data) - { - ERR("Failed to alloc internal button data\n"); - return -1; - } - - memset(data, 0, sizeof(BUTTON_DATA)); - SetRect(&data->rcTextMargin, 1,1,1,1); - - _SetButtonData(hWnd, data); - break; - } - case WM_NCDESTROY: - { - PBUTTON_DATA data = _GetButtonData(hWnd); - if (!data) - { - ERR("No data"); - return 0; - } - HeapFree( GetProcessHeap(), 0, data ); - _SetButtonData(hWnd, NULL); - } - case WM_CREATE: - OpenThemeData(hWnd, WC_BUTTONW); - break; - case WM_DESTROY: - CloseThemeData (GetWindowTheme(hWnd)); - break; - case WM_THEMECHANGED: - CloseThemeData (GetWindowTheme(hWnd)); - OpenThemeData(hWnd, WC_BUTTONW); - InvalidateRect(hWnd, NULL, TRUE); - break; - case WM_MOUSELEAVE: - { - state = get_button_state( hWnd ); - if (state & BST_HOT) - { - NMBCHOTITEM nmhotitem; - - state &= ~BST_HOT; - set_button_state(hWnd, state); - - nmhotitem.hdr.hwndFrom = hWnd; - nmhotitem.hdr.idFrom = GetWindowLongPtrW (hWnd, GWLP_ID); - nmhotitem.hdr.code = BCN_HOTITEMCHANGE; - nmhotitem.dwFlags = HICF_LEAVING; - SendMessageW(GetParent(hWnd), WM_NOTIFY, nmhotitem.hdr.idFrom, (LPARAM)&nmhotitem); - - InvalidateRect(hWnd, NULL, TRUE); - } - break; - } - case WM_MOUSEMOVE: - { - TRACKMOUSEEVENT mouse_event; - state = get_button_state( hWnd ); - if ((state & BST_HOT) == 0) - { - NMBCHOTITEM nmhotitem; - - state |= BST_HOT; - set_button_state(hWnd, state); - - nmhotitem.hdr.hwndFrom = hWnd; - nmhotitem.hdr.idFrom = GetWindowLongPtrW (hWnd, GWLP_ID); - nmhotitem.hdr.code = BCN_HOTITEMCHANGE; - nmhotitem.dwFlags = HICF_ENTERING; - SendMessageW(GetParent(hWnd), WM_NOTIFY, nmhotitem.hdr.idFrom, (LPARAM)&nmhotitem); - - InvalidateRect(hWnd, NULL, TRUE); - } - - mouse_event.cbSize = sizeof(TRACKMOUSEEVENT); - mouse_event.dwFlags = TME_QUERY; - if(!TrackMouseEvent(&mouse_event) || !(mouse_event.dwFlags&TME_LEAVE)) - { - mouse_event.dwFlags = TME_LEAVE; - mouse_event.hwndTrack = hWnd; - mouse_event.dwHoverTime = 1; - TrackMouseEvent(&mouse_event); - } - break; - } - case BCM_GETTEXTMARGIN: - { - RECT* prc = (RECT*)lParam; - PBUTTON_DATA data = _GetButtonData(hWnd); - if (!prc || !data) - return FALSE; - *prc = data->rcTextMargin; - return TRUE; - } - case BCM_SETTEXTMARGIN: - { - RECT* prc = (RECT*)lParam; - PBUTTON_DATA data = _GetButtonData(hWnd); - if (!prc || !data) - return FALSE; - data->rcTextMargin = *prc; - return TRUE; - } - case BCM_SETIMAGELIST: - { - BUTTON_IMAGELIST * pimldata = (BUTTON_IMAGELIST *)lParam; - PBUTTON_DATA data = _GetButtonData(hWnd); - if (!data || !pimldata || !pimldata->himl) - return FALSE; - data->imlData = *pimldata; - return TRUE; - } - case BCM_GETIMAGELIST: - { - BUTTON_IMAGELIST * pimldata = (BUTTON_IMAGELIST *)lParam; - PBUTTON_DATA data = _GetButtonData(hWnd); - if (!data|| !pimldata) - return FALSE; - *pimldata = data->imlData; - return TRUE; - } - case BCM_GETIDEALSIZE: - { - HTHEME theme = GetWindowTheme(hWnd); - BOOL ret = FALSE; - SIZE* pSize = (SIZE*)lParam; - - if (btn_type == BS_PUSHBUTTON || - btn_type == BS_DEFPUSHBUTTON || - btn_type == BS_USERBUTTON) - { - ret = BUTTON_GetIdealSize(theme, hWnd, pSize); - } - - if (!ret) - { - GetClientRect(hWnd, &rect); - pSize->cx = rect.right; - pSize->cy = rect.bottom; - } - - return TRUE; - } - } - - if (!_GetButtonData(hWnd)) - { - ERR("no data!\n"); - return unicode ? DefWindowProcW(hWnd, uMsg, wParam, lParam) : - DefWindowProcA(hWnd, uMsg, wParam, lParam); - } - -#endif - switch (uMsg) { case WM_GETDLGCODE: switch(btn_type) { + case BS_COMMANDLINK: case BS_USERBUTTON: case BS_PUSHBUTTON: return DLGC_BUTTON | DLGC_UNDEFPUSHBUTTON; + case BS_DEFCOMMANDLINK: case BS_DEFPUSHBUTTON: return DLGC_BUTTON | DLGC_DEFPUSHBUTTON; case BS_RADIOBUTTON: case BS_AUTORADIOBUTTON: return DLGC_BUTTON | DLGC_RADIOBUTTON; case BS_GROUPBOX: return DLGC_STATIC; + case BS_SPLITBUTTON: return DLGC_BUTTON | DLGC_UNDEFPUSHBUTTON | DLGC_WANTARROWS; + case BS_DEFSPLITBUTTON: return DLGC_BUTTON | DLGC_DEFPUSHBUTTON | DLGC_WANTARROWS; default: return DLGC_BUTTON; } case WM_ENABLE: - paint_button( hWnd, btn_type, ODA_DRAWENTIRE ); +#ifndef __REACTOS__ + theme = GetWindowTheme( hWnd ); + if (theme) + RedrawWindow( hWnd, NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW ); + else +#endif + paint_button( infoPtr, btn_type, ODA_DRAWENTIRE ); + break; + + case WM_NCCREATE: + infoPtr = heap_alloc_zero( sizeof(*infoPtr) ); + SetWindowLongPtrW( hWnd, 0, (LONG_PTR)infoPtr ); + infoPtr->hwnd = hWnd; +#ifdef __REACTOS__ + SetRect(&infoPtr->rcTextMargin, 1,1,1,1); +#endif + return DefWindowProcW(hWnd, uMsg, wParam, lParam); + + case WM_NCDESTROY: + SetWindowLongPtrW( hWnd, 0, 0 ); + heap_free(infoPtr); break; case WM_CREATE: @@ -740,24 +653,26 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, if (btn_type == BS_USERBUTTON ) { style = (style & ~BS_TYPEMASK) | BS_PUSHBUTTON; -#ifdef __REACTOS__ - NtUserAlterWindowStyle(hWnd, GWL_STYLE, style ); -#else - WIN_SetStyle( hWnd, style, BS_TYPEMASK & ~style ); -#endif + SetWindowLongW( hWnd, GWL_STYLE, style ); } - set_button_state( hWnd, BST_UNCHECKED ); -#ifdef __REACTOS__ - button_update_uistate( hWnd, unicode ); -#endif + infoPtr->state = BST_UNCHECKED; + OpenThemeData( hWnd, WC_BUTTONW ); return 0; -#if defined(__REACTOS__) && defined(_USER32_) - case WM_NCDESTROY: - NtUserSetWindowFNID(hWnd, FNID_DESTROY); case WM_DESTROY: + theme = GetWindowTheme( hWnd ); + CloseThemeData( theme ); break; + + case WM_THEMECHANGED: + theme = GetWindowTheme( hWnd ); + CloseThemeData( theme ); + OpenThemeData( hWnd, WC_BUTTONW ); +#ifdef __REACTOS__ + InvalidateRect(hWnd, NULL, TRUE); #endif + break; + case WM_ERASEBKGND: if (btn_type == BS_OWNERDRAW) { @@ -766,14 +681,10 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, HBRUSH hBrush; HWND parent = GetParent(hWnd); if (!parent) parent = hWnd; -#if defined(__REACTOS__) && defined(_USER32_) - hBrush = GetControlColor( parent, hWnd, hdc, WM_CTLCOLORBTN); -#else hBrush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORBTN, (WPARAM)hdc, (LPARAM)hWnd); if (!hBrush) /* did the app forget to call defwindowproc ? */ hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORBTN, (WPARAM)hdc, (LPARAM)hWnd); -#endif GetClientRect(hWnd, &rc); FillRect(hdc, &rc, hBrush); } @@ -783,21 +694,44 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, case WM_PAINT: { PAINTSTRUCT ps; - HDC hdc = wParam ? (HDC)wParam : BeginPaint( hWnd, &ps ); -#ifndef _USER32_ - HTHEME theme = GetWindowTheme(hWnd); - if (theme && BUTTON_PaintWithTheme(theme, hWnd, hdc, uMsg == WM_PRINTCLIENT ? lParam : 0)) + HDC hdc; + + theme = GetWindowTheme( hWnd ); + hdc = wParam ? (HDC)wParam : BeginPaint( hWnd, &ps ); + +#ifdef __REACTOS__ + if (theme && BUTTON_PaintWithTheme(theme, infoPtr, hdc, uMsg == WM_PRINTCLIENT ? lParam : 0)) { if ( !wParam ) EndPaint( hWnd, &ps ); return 0; } +#else + if (theme && btnThemedPaintFunc[btn_type]) + { + ButtonState drawState; + UINT dtflags; + + if (IsWindowEnabled( hWnd )) + { + if (infoPtr->state & BST_PUSHED) drawState = STATE_PRESSED; + else if (infoPtr->state & BST_HOT) drawState = STATE_HOT; + else if (infoPtr->state & BST_FOCUS) drawState = STATE_DEFAULTED; + else drawState = STATE_NORMAL; + } + else + drawState = STATE_DISABLED; + + dtflags = BUTTON_BStoDT(style, GetWindowLongW(hWnd, GWL_EXSTYLE)); + btnThemedPaintFunc[btn_type](theme, infoPtr, hdc, drawState, dtflags, infoPtr->state & BST_FOCUS); + } #endif - if (btnPaintFunc[btn_type]) + else if (btnPaintFunc[btn_type]) { int nOldMode = SetBkMode( hdc, OPAQUE ); - (btnPaintFunc[btn_type])( hWnd, hdc, ODA_DRAWENTIRE ); + btnPaintFunc[btn_type]( infoPtr, hdc, ODA_DRAWENTIRE ); SetBkMode(hdc, nOldMode); /* reset painting mode */ } + if ( !wParam ) EndPaint( hWnd, &ps ); break; } @@ -806,7 +740,7 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, if (wParam == VK_SPACE) { SendMessageW( hWnd, BM_SETSTATE, TRUE, 0 ); - set_button_state( hWnd, get_button_state( hWnd ) | BUTTON_BTNPRESSED ); + infoPtr->state |= BUTTON_BTNPRESSED; SetCapture( hWnd ); } break; @@ -824,7 +758,7 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, case WM_LBUTTONDOWN: SetCapture( hWnd ); SetFocus( hWnd ); - set_button_state( hWnd, get_button_state( hWnd ) | BUTTON_BTNPRESSED ); + infoPtr->state |= BUTTON_BTNPRESSED; SendMessageW( hWnd, BM_SETSTATE, TRUE, 0 ); break; @@ -833,13 +767,9 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, break; /* fall through */ case WM_LBUTTONUP: -#ifdef _REACTOS_ - BOOL TellParent = FALSE; //// ReactOS see note below. -#endif - state = get_button_state( hWnd ); + state = infoPtr->state; if (!(state & BUTTON_BTNPRESSED)) break; - state &= BUTTON_NSTATES; - set_button_state( hWnd, state ); + infoPtr->state &= BUTTON_NSTATES; if (!(state & BST_PUSHED)) { ReleaseCapture(); @@ -849,68 +779,196 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, GetClientRect( hWnd, &rect ); if (uMsg == WM_KEYUP || PtInRect( &rect, pt )) { - state = get_button_state( hWnd ); switch(btn_type) { case BS_AUTOCHECKBOX: - SendMessageW( hWnd, BM_SETCHECK, !(state & BST_CHECKED), 0 ); + SendMessageW( hWnd, BM_SETCHECK, !(infoPtr->state & BST_CHECKED), 0 ); break; case BS_AUTORADIOBUTTON: SendMessageW( hWnd, BM_SETCHECK, TRUE, 0 ); break; case BS_AUTO3STATE: - SendMessageW( hWnd, BM_SETCHECK, - (state & BST_INDETERMINATE) ? 0 : ((state & 3) + 1), 0 ); + SendMessageW( hWnd, BM_SETCHECK, (infoPtr->state & BST_INDETERMINATE) ? 0 : + ((infoPtr->state & 3) + 1), 0 ); break; } -#ifdef _REACTOS_ - TellParent = TRUE; // <---- Fix CORE-10194, Notify parent after capture is released. -#else +#ifdef __REACTOS__ + // Fix CORE-10194, Notify parent after capture is released. ReleaseCapture(); BUTTON_NOTIFY_PARENT(hWnd, BN_CLICKED); +#else + BUTTON_NOTIFY_PARENT(hWnd, BN_CLICKED); + ReleaseCapture(); #endif } -#ifdef _REACTOS_ - ReleaseCapture(); - if (TellParent) BUTTON_NOTIFY_PARENT(hWnd, BN_CLICKED); -#else else { ReleaseCapture(); } -#endif + break; case WM_CAPTURECHANGED: TRACE("WM_CAPTURECHANGED %p\n", hWnd); if (hWnd == (HWND)lParam) break; - state = get_button_state( hWnd ); - if (state & BUTTON_BTNPRESSED) + if (infoPtr->state & BUTTON_BTNPRESSED) { - state &= BUTTON_NSTATES; - set_button_state( hWnd, state ); - if (state & BST_PUSHED) SendMessageW( hWnd, BM_SETSTATE, FALSE, 0 ); + infoPtr->state &= BUTTON_NSTATES; + if (infoPtr->state & BST_PUSHED) + SendMessageW( hWnd, BM_SETSTATE, FALSE, 0 ); } break; case WM_MOUSEMOVE: + { + TRACKMOUSEEVENT mouse_event; + mouse_event.cbSize = sizeof(TRACKMOUSEEVENT); + mouse_event.dwFlags = TME_QUERY; + +#ifdef __REACTOS__ + if ((infoPtr->state & BST_HOT) == 0) + { + NMBCHOTITEM nmhotitem; + + infoPtr->state |= BST_HOT; + + nmhotitem.hdr.hwndFrom = hWnd; + nmhotitem.hdr.idFrom = GetWindowLongPtrW (hWnd, GWLP_ID); + nmhotitem.hdr.code = BCN_HOTITEMCHANGE; + nmhotitem.dwFlags = HICF_ENTERING; + SendMessageW(GetParent(hWnd), WM_NOTIFY, nmhotitem.hdr.idFrom, (LPARAM)&nmhotitem); + + InvalidateRect(hWnd, NULL, TRUE); + } + + if(!TrackMouseEvent(&mouse_event) || !(mouse_event.dwFlags&TME_LEAVE)) + { + mouse_event.dwFlags = TME_LEAVE; + mouse_event.hwndTrack = hWnd; + mouse_event.dwHoverTime = 1; + TrackMouseEvent(&mouse_event); + } + break; +#else + + if (!TrackMouseEvent(&mouse_event) || !(mouse_event.dwFlags & (TME_HOVER | TME_LEAVE))) + { + mouse_event.dwFlags = TME_HOVER | TME_LEAVE; + mouse_event.hwndTrack = hWnd; + mouse_event.dwHoverTime = 1; + TrackMouseEvent(&mouse_event); + } + if ((wParam & MK_LBUTTON) && GetCapture() == hWnd) { GetClientRect( hWnd, &rect ); SendMessageW( hWnd, BM_SETSTATE, PtInRect(&rect, pt), 0 ); } break; +#endif + } + +#ifndef __REACTOS__ + case WM_MOUSEHOVER: + { + infoPtr->state |= BST_HOT; + InvalidateRect( hWnd, NULL, FALSE ); + break; + } +#endif + + case WM_MOUSELEAVE: + { +#ifdef __REACTOS__ + if (infoPtr->state & BST_HOT) + { + NMBCHOTITEM nmhotitem; + + infoPtr->state &= ~BST_HOT; + + nmhotitem.hdr.hwndFrom = hWnd; + nmhotitem.hdr.idFrom = GetWindowLongPtrW (hWnd, GWLP_ID); + nmhotitem.hdr.code = BCN_HOTITEMCHANGE; + nmhotitem.dwFlags = HICF_LEAVING; + SendMessageW(GetParent(hWnd), WM_NOTIFY, nmhotitem.hdr.idFrom, (LPARAM)&nmhotitem); + + InvalidateRect(hWnd, NULL, TRUE); + } + break; +#else + infoPtr->state &= ~BST_HOT; + InvalidateRect( hWnd, NULL, FALSE ); + break; +#endif + } + +#ifdef __REACTOS__ + case BCM_GETTEXTMARGIN: + { + RECT* prc = (RECT*)lParam; + if (!prc) + return FALSE; + *prc = infoPtr->rcTextMargin; + return TRUE; + } + case BCM_SETTEXTMARGIN: + { + RECT* prc = (RECT*)lParam; + if (!prc) + return FALSE; + infoPtr->rcTextMargin = *prc; + return TRUE; + } + case BCM_SETIMAGELIST: + { + BUTTON_IMAGELIST * pimldata = (BUTTON_IMAGELIST *)lParam; + if (!pimldata || !pimldata->himl) + return FALSE; + infoPtr->imlData = *pimldata; + return TRUE; + } + case BCM_GETIMAGELIST: + { + BUTTON_IMAGELIST * pimldata = (BUTTON_IMAGELIST *)lParam; + if (!pimldata) + return FALSE; + *pimldata = infoPtr->imlData; + return TRUE; + } + case BCM_GETIDEALSIZE: + { + HTHEME theme = GetWindowTheme(hWnd); + BOOL ret = FALSE; + SIZE* pSize = (SIZE*)lParam; + + if (btn_type == BS_PUSHBUTTON || + btn_type == BS_DEFPUSHBUTTON || + btn_type == BS_USERBUTTON) + { + ret = BUTTON_GetIdealSize(infoPtr, theme, pSize); + } + + if (!ret) + { + GetClientRect(hWnd, &rect); + pSize->cx = rect.right; + pSize->cy = rect.bottom; + } + + return TRUE; + } +#endif case WM_SETTEXT: { /* Clear an old text here as Windows does */ +#ifdef __REACTOS__ // // ReactOS Note : // wine Bug:
http://bugs.winehq.org/show_bug.cgi?id=25790
// Patch:
http://source.winehq.org/patches/data/70889
// By: Alexander LAW, Replicate Windows behavior of WM_SETTEXT handler regarding WM_CTLCOLOR* // -#ifdef __REACTOS__ if (style & WS_VISIBLE) #else if (IsWindowVisible(hWnd)) @@ -922,28 +980,23 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, HWND parent = GetParent(hWnd); UINT message = (btn_type == BS_PUSHBUTTON || btn_type == BS_DEFPUSHBUTTON || - btn_type == BS_PUSHLIKE || btn_type == BS_USERBUTTON || btn_type == BS_OWNERDRAW) ? WM_CTLCOLORBTN : WM_CTLCOLORSTATIC; if (!parent) parent = hWnd; -#if defined(__REACTOS__) && defined(_USER32_) - hbrush = GetControlColor(parent, hWnd, hdc, message); -#else hbrush = (HBRUSH)SendMessageW(parent, message, (WPARAM)hdc, (LPARAM)hWnd); if (!hbrush) /* did the app forget to call DefWindowProc ? */ hbrush = (HBRUSH)DefWindowProcW(parent, message, (WPARAM)hdc, (LPARAM)hWnd); -#endif GetClientRect(hWnd, &client); rc = client; /* FIXME: check other BS_* handlers */ if (btn_type == BS_GROUPBOX) InflateRect(&rc, -7, 1); /* GB_Paint does this */ - BUTTON_CalcLabelRect(hWnd, hdc, &rc); + BUTTON_CalcLabelRect(infoPtr, hdc, &rc); /* Clip by client rect bounds */ if (rc.right > client.right) rc.right = client.right; if (rc.bottom > client.bottom) rc.bottom = client.bottom; @@ -951,45 +1004,43 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, ReleaseDC(hWnd, hdc); } - if (unicode) DefWindowProcW( hWnd, WM_SETTEXT, wParam, lParam ); - else DefWindowProcA( hWnd, WM_SETTEXT, wParam, lParam ); + DefWindowProcW( hWnd, WM_SETTEXT, wParam, lParam ); if (btn_type == BS_GROUPBOX) /* Yes, only for BS_GROUPBOX */ InvalidateRect( hWnd, NULL, TRUE ); else - paint_button( hWnd, btn_type, ODA_DRAWENTIRE ); + paint_button( infoPtr, btn_type, ODA_DRAWENTIRE ); return 1; /* success. FIXME: check text length */ } case WM_SETFONT: - set_button_font( hWnd, (HFONT)wParam ); + infoPtr->font = (HFONT)wParam; if (lParam) InvalidateRect(hWnd, NULL, TRUE); break; case WM_GETFONT: - return (LRESULT)get_button_font( hWnd ); + return (LRESULT)infoPtr->font; case WM_SETFOCUS: TRACE("WM_SETFOCUS %p\n",hWnd); - set_button_state( hWnd, get_button_state(hWnd) | BST_FOCUS ); -#ifndef _USER32_ + infoPtr->state |= BST_FOCUS; +#ifdef __REACTOS__ if (btn_type != BS_OWNERDRAW) InvalidateRect(hWnd, NULL, FALSE); else #endif - paint_button( hWnd, btn_type, ODA_FOCUS ); + paint_button( infoPtr, btn_type, ODA_FOCUS ); if (style & BS_NOTIFY) BUTTON_NOTIFY_PARENT(hWnd, BN_SETFOCUS); break; case WM_KILLFOCUS: TRACE("WM_KILLFOCUS %p\n",hWnd); - state = get_button_state( hWnd ); - set_button_state( hWnd, state & ~BST_FOCUS ); -#ifdef _USER32_ - paint_button( hWnd, btn_type, ODA_FOCUS ); + infoPtr->state &= ~BST_FOCUS; +#ifndef __REACTOS__ + paint_button( infoPtr, btn_type, ODA_FOCUS ); #endif - if ((state & BUTTON_BTNPRESSED) && GetCapture() == hWnd) + if ((infoPtr->state & BUTTON_BTNPRESSED) && GetCapture() == hWnd) ReleaseCapture(); if (style & BS_NOTIFY) BUTTON_NOTIFY_PARENT(hWnd, BN_KILLFOCUS); @@ -1004,11 +1055,7 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, case BM_SETSTYLE: btn_type = wParam & BS_TYPEMASK; style = (style & ~BS_TYPEMASK) | btn_type; -#ifdef __REACTOS__ - NtUserAlterWindowStyle(hWnd, GWL_STYLE, style); -#else - WIN_SetStyle( hWnd, style, BS_TYPEMASK & ~style ); -#endif + SetWindowLongW( hWnd, GWL_STYLE, style ); /* Only redraw if lParam flag is set.*/ if (lParam) @@ -1018,18 +1065,15 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, case BM_CLICK: #ifdef __REACTOS__ - state = get_button_state(hWnd); - if (state & BUTTON_BMCLICK) - break; - set_button_state(hWnd, state | BUTTON_BMCLICK); // Tracked in STATE_GWL_OFFSET. + /* Fix for core CORE-6024 */ + if (infoPtr->state & BUTTON_BMCLICK) + break; + infoPtr->state |= BUTTON_BMCLICK; #endif SendMessageW( hWnd, WM_LBUTTONDOWN, 0, 0 ); SendMessageW( hWnd, WM_LBUTTONUP, 0, 0 ); #ifdef __REACTOS__ - state = get_button_state(hWnd); - if (!(state & BUTTON_BMCLICK)) break; - state &= ~BUTTON_BMCLICK; - set_button_state(hWnd, state); + infoPtr->state &= ~BUTTON_BMCLICK; #endif break; @@ -1046,77 +1090,61 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, default: return 0; } -#ifdef _USER32_ - oldHbitmap = (HBITMAP)SetWindowLongPtrW( hWnd, HIMAGE_GWL_OFFSET, lParam ); -#else - oldHbitmap = (HBITMAP)set_button_image(hWnd, lParam ); -#endif + oldHbitmap = infoPtr->u.image; + infoPtr->u.image = (HANDLE)lParam; InvalidateRect( hWnd, NULL, FALSE ); return (LRESULT)oldHbitmap; case BM_GETIMAGE: -#ifdef _USER32_ - return GetWindowLongPtrW( hWnd, HIMAGE_GWL_OFFSET ); -#else - return get_button_image(hWnd); -#endif + return (LRESULT)infoPtr->u.image; case BM_GETCHECK: - return get_button_state( hWnd ) & 3; + return infoPtr->state & 3; case BM_SETCHECK: if (wParam > maxCheckState[btn_type]) wParam = maxCheckState[btn_type]; - state = get_button_state( hWnd ); - if ((btn_type == BS_RADIOBUTTON) || (btn_type == BS_AUTORADIOBUTTON)) - { -#ifdef __REACTOS__ - if (wParam) style |= WS_TABSTOP; - else style &= ~WS_TABSTOP; - NtUserAlterWindowStyle(hWnd, GWL_STYLE, style); -#else - if (wParam) WIN_SetStyle( hWnd, WS_TABSTOP, 0 ); - else WIN_SetStyle( hWnd, 0, WS_TABSTOP ); -#endif + if ((btn_type == BS_RADIOBUTTON) || (btn_type == BS_AUTORADIOBUTTON)) + { + style = wParam ? style | WS_TABSTOP : style & ~WS_TABSTOP; + SetWindowLongW( hWnd, GWL_STYLE, style ); } - if ((state & 3) != wParam) + if ((infoPtr->state & 3) != wParam) { - set_button_state( hWnd, (state & ~3) | wParam ); -#ifdef _USER32 - paint_button( hWnd, btn_type, ODA_SELECT ); -#else - InvalidateRect(hWnd, NULL, FALSE); -#endif + infoPtr->state = (infoPtr->state & ~3) | wParam; + InvalidateRect( hWnd, NULL, FALSE ); } if ((btn_type == BS_AUTORADIOBUTTON) && (wParam == BST_CHECKED) && (style & WS_CHILD)) BUTTON_CheckAutoRadioButton( hWnd ); break; case BM_GETSTATE: - return get_button_state( hWnd ); + return infoPtr->state; case BM_SETSTATE: - state = get_button_state( hWnd ); - if (wParam) - set_button_state( hWnd, state | BST_PUSHED ); - else - set_button_state( hWnd, state & ~BST_PUSHED ); + state = infoPtr->state; + new_state = wParam ? BST_PUSHED : 0; -#ifdef _USER32_ - paint_button( hWnd, btn_type, ODA_SELECT ); -#else - InvalidateRect(hWnd, NULL, FALSE); -#endif + if ((state ^ new_state) & BST_PUSHED) + { + if (wParam) + state |= BST_PUSHED; + else + state &= ~BST_PUSHED; + + if (btn_type == BS_USERBUTTON) + BUTTON_NOTIFY_PARENT( hWnd, (state & BST_PUSHED) ? BN_HILITE : BN_UNHILITE ); + infoPtr->state = state; + + InvalidateRect( hWnd, NULL, FALSE ); + } break; #ifdef __REACTOS__ case WM_UPDATEUISTATE: - if (unicode) - DefWindowProcW(hWnd, uMsg, wParam, lParam); - else - DefWindowProcA(hWnd, uMsg, wParam, lParam); + DefWindowProcW(hWnd, uMsg, wParam, lParam); - if (button_update_uistate(hWnd, unicode)) - paint_button( hWnd, btn_type, ODA_DRAWENTIRE ); + if (button_update_uistate(infoPtr)) + paint_button( infoPtr, btn_type, ODA_DRAWENTIRE ); break; #endif @@ -1124,86 +1152,11 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, if(btn_type == BS_GROUPBOX) return HTTRANSPARENT; /* fall through */ default: - return unicode ? DefWindowProcW(hWnd, uMsg, wParam, lParam) : - DefWindowProcA(hWnd, uMsg, wParam, lParam); + return DefWindowProcW(hWnd, uMsg, wParam, lParam); } return 0; } -#ifdef __REACTOS__ - -/*********************************************************************** - * ButtonWndProcW - * The button window procedure. This is just a wrapper which locks - * the passed HWND and calls the real window procedure (with a WND* - * pointer pointing to the locked windowstructure). - */ -LRESULT WINAPI ButtonWndProcW(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - if (!IsWindow(hWnd)) return 0; - return ButtonWndProc_common(hWnd, uMsg, wParam, lParam, TRUE); -} - -/*********************************************************************** - * ButtonWndProcA - */ -LRESULT WINAPI ButtonWndProcA(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - if (!IsWindow(hWnd)) return 0; - return ButtonWndProc_common(hWnd, uMsg, wParam, lParam, FALSE); -} - -#endif /* __REACTOS__ */ - -/********************************************************************** - * Convert button styles to flags used by DrawText. - */ -static UINT BUTTON_BStoDT( DWORD style, DWORD ex_style ) -{ - UINT dtStyle = DT_NOCLIP; /* We use SelectClipRgn to limit output */ - - /* "Convert" pushlike buttons to pushbuttons */ - if (style & BS_PUSHLIKE) - style &= ~BS_TYPEMASK; - - if (!(style & BS_MULTILINE)) - dtStyle |= DT_SINGLELINE; - else - dtStyle |= DT_WORDBREAK; - - switch (style & BS_CENTER) - { - case BS_LEFT: /* DT_LEFT is 0 */ break; - case BS_RIGHT: dtStyle |= DT_RIGHT; break; - case BS_CENTER: dtStyle |= DT_CENTER; break; - default: - /* Pushbutton's text is centered by default */ - if (get_button_type(style) <= BS_DEFPUSHBUTTON) dtStyle |= DT_CENTER; - /* all other flavours have left aligned text */ - } - - if (ex_style & WS_EX_RIGHT) dtStyle = DT_RIGHT | (dtStyle & ~(DT_LEFT | DT_CENTER)); - - /* DrawText ignores vertical alignment for multiline text, - * but we use these flags to align label manually. - */ - if (get_button_type(style) != BS_GROUPBOX) - { - switch (style & BS_VCENTER) - { - case BS_TOP: /* DT_TOP is 0 */ break; - case BS_BOTTOM: dtStyle |= DT_BOTTOM; break; - case BS_VCENTER: /* fall through */ - default: dtStyle |= DT_VCENTER; break; - } - } - else - /* GroupBox's text is always single line and is top aligned. */ - dtStyle |= DT_SINGLELINE; - - return dtStyle; -} - /********************************************************************** * BUTTON_CalcLabelRect * @@ -1214,10 +1167,10 @@ static UINT BUTTON_BStoDT( DWORD style, DWORD ex_style ) * (pushed, etc.). If there is nothing to draw (no text/image) output * rectangle is empty, and return value is (UINT)-1. */ -static UINT BUTTON_CalcLabelRect(HWND hwnd, HDC hdc, RECT *rc) +static UINT BUTTON_CalcLabelRect(const BUTTON_INFO *infoPtr, HDC hdc, RECT *rc) { - LONG style = GetWindowLongPtrW( hwnd, GWL_STYLE ); - LONG ex_style = GetWindowLongPtrW( hwnd, GWL_EXSTYLE ); + LONG style = GetWindowLongW( infoPtr->hwnd, GWL_STYLE ); + LONG ex_style = GetWindowLongW( infoPtr->hwnd, GWL_EXSTYLE ); WCHAR *text; ICONINFO iconInfo; BITMAP bm; @@ -1225,11 +1178,7 @@ static UINT BUTTON_CalcLabelRect(HWND hwnd, HDC hdc, RECT *rc) RECT r = *rc; INT n; #ifdef __REACTOS__ - PBUTTON_DATA pdata = _GetButtonData(hwnd); -#endif - -#ifndef _USER32_ - BOOL bHasIml = BUTTON_DrawIml(hdc, &pdata->imlData, &r, TRUE, 0); + BOOL bHasIml = BUTTON_DrawIml(hdc, &infoPtr->imlData, &r, TRUE, 0); #endif /* Calculate label rectangle according to label type */ @@ -1239,30 +1188,26 @@ static UINT BUTTON_CalcLabelRect(HWND hwnd, HDC hdc, RECT *rc) { HFONT hFont, hPrevFont = 0; - if (!(text = get_button_text( hwnd ))) goto empty_rect; + if (!(text = get_button_text( infoPtr ))) goto empty_rect; if (!text[0]) { - HeapFree( GetProcessHeap(), 0, text ); + heap_free( text ); goto empty_rect; } - if ((hFont = get_button_font( hwnd ))) hPrevFont = SelectObject( hdc, hFont ); + if ((hFont = infoPtr->font)) hPrevFont = SelectObject( hdc, hFont ); DrawTextW(hdc, text, -1, &r, dtStyle | DT_CALCRECT); if (hPrevFont) SelectObject( hdc, hPrevFont ); - HeapFree( GetProcessHeap(), 0, text ); + heap_free( text ); #ifdef __REACTOS__ - if (get_ui_state(hwnd) & UISF_HIDEACCEL) + if (infoPtr->ui_state & UISF_HIDEACCEL) dtStyle |= DT_HIDEPREFIX; #endif break; } case BS_ICON: -#ifdef _USER32_ - if (!GetIconInfo((HICON)GetWindowLongPtrW( hwnd, HIMAGE_GWL_OFFSET ), &iconInfo)) -#else - if (!GetIconInfo((HICON)get_button_image(hwnd), &iconInfo)) -#endif + if (!GetIconInfo(infoPtr->u.icon, &iconInfo)) goto empty_rect; GetObjectW (iconInfo.hbmColor, sizeof(BITMAP), &bm); @@ -1275,11 +1220,7 @@ static UINT BUTTON_CalcLabelRect(HWND hwnd, HDC hdc, RECT *rc) break; case BS_BITMAP: -#ifdef _USER32_ - if (!GetObjectW( (HANDLE)GetWindowLongPtrW( hwnd, HIMAGE_GWL_OFFSET ), sizeof(BITMAP), &bm)) -#else - if (!GetObjectW( (HANDLE)get_button_image(hwnd), sizeof(BITMAP), &bm)) -#endif + if (!GetObjectW( infoPtr->u.bitmap, sizeof(BITMAP), &bm)) goto empty_rect; r.right = r.left + bm.bmWidth; @@ -1288,26 +1229,22 @@ static UINT BUTTON_CalcLabelRect(HWND hwnd, HDC hdc, RECT *rc) default: empty_rect: -#ifndef _USER32_ - if (bHasIml) - break; -#endif rc->right = r.left; rc->bottom = r.top; return (UINT)-1; } -#ifndef _USER32_ +#ifdef __REACTOS__ if (bHasIml) { - if (pdata->imlData.uAlign == BUTTON_IMAGELIST_ALIGN_LEFT) - r.left = pdata->imlData.margin.left; - else if (pdata->imlData.uAlign == BUTTON_IMAGELIST_ALIGN_RIGHT) - r.right = pdata->imlData.margin.right; - else if (pdata->imlData.uAlign == BUTTON_IMAGELIST_ALIGN_TOP) - r.top = pdata->imlData.margin.top; - else if (pdata->imlData.uAlign == BUTTON_IMAGELIST_ALIGN_BOTTOM) - r.bottom = pdata->imlData.margin.bottom; + if (infoPtr->imlData.uAlign == BUTTON_IMAGELIST_ALIGN_LEFT) + r.left = infoPtr->imlData.margin.left; + else if (infoPtr->imlData.uAlign == BUTTON_IMAGELIST_ALIGN_RIGHT) + r.right = infoPtr->imlData.margin.right; + else if (infoPtr->imlData.uAlign == BUTTON_IMAGELIST_ALIGN_TOP) + r.top = infoPtr->imlData.margin.top; + else if (infoPtr->imlData.uAlign == BUTTON_IMAGELIST_ALIGN_BOTTOM) + r.bottom = infoPtr->imlData.margin.bottom; } #endif @@ -1365,19 +1302,15 @@ static BOOL CALLBACK BUTTON_DrawTextCallback(HDC hdc, LPARAM lp, WPARAM wp, int * * Common function for drawing button label. */ - #if defined(_USER32_) -static void BUTTON_DrawLabel(HWND hwnd, HDC hdc, UINT dtFlags, const RECT *rc) -#else -static void BUTTON_DrawLabel(HWND hwnd, HDC hdc, UINT dtFlags, RECT *rc) -#endif +static void BUTTON_DrawLabel(const BUTTON_INFO *infoPtr, HDC hdc, UINT dtFlags, const RECT *rc) { DRAWSTATEPROC lpOutputProc = NULL; LPARAM lp; WPARAM wp = 0; HBRUSH hbr = 0; - UINT flags = IsWindowEnabled(hwnd) ? DSS_NORMAL : DSS_DISABLED; - LONG state = get_button_state( hwnd ); - LONG style = GetWindowLongPtrW( hwnd, GWL_STYLE ); + UINT flags = IsWindowEnabled(infoPtr->hwnd) ? DSS_NORMAL : DSS_DISABLED; + LONG state = infoPtr->state; + LONG style = GetWindowLongW( infoPtr->hwnd, GWL_STYLE ); WCHAR *text = NULL; /* FIXME: To draw disabled label in Win31 look-and-feel, we probably @@ -1385,9 +1318,9 @@ static void BUTTON_DrawLabel(HWND hwnd, HDC hdc, UINT dtFlags, RECT *rc) * I don't have Win31 on hand to verify that, so I leave it as is. */ -#ifndef _USER32_ - PBUTTON_DATA pdata = _GetButtonData(hwnd); - BUTTON_DrawIml(hdc, &pdata->imlData, rc, FALSE, 0); +#ifdef __REACTOS__ + RECT rcText = *rc; + BUTTON_DrawIml(hdc, &infoPtr->imlData, &rcText, FALSE, 0); #endif if ((style & BS_PUSHLIKE) && (state & BST_INDETERMINATE)) @@ -1401,10 +1334,9 @@ static void BUTTON_DrawLabel(HWND hwnd, HDC hdc, UINT dtFlags, RECT *rc) case BS_TEXT: /* DST_COMPLEX -- is 0 */ lpOutputProc = BUTTON_DrawTextCallback; - if (!(text = get_button_text( hwnd ))) return; + if (!(text = get_button_text( infoPtr ))) return; lp = (LPARAM)text; - wp = (WPARAM)dtFlags; - + wp = dtFlags; #ifdef __REACTOS__ if (dtFlags & DT_HIDEPREFIX) flags |= DSS_HIDEPREFIX; @@ -1413,79 +1345,66 @@ static void BUTTON_DrawLabel(HWND hwnd, HDC hdc, UINT dtFlags, RECT *rc) case BS_ICON: flags |= DST_ICON; -#ifdef _USER32_ - lp = GetWindowLongPtrW( hwnd, HIMAGE_GWL_OFFSET ); -#else - lp = get_button_image(hwnd); -#endif + lp = (LPARAM)infoPtr->u.icon; break; case BS_BITMAP: flags |= DST_BITMAP; -#ifdef _USER32_ - lp = GetWindowLongPtrW( hwnd, HIMAGE_GWL_OFFSET ); -#else - lp = get_button_image(hwnd); -#endif + lp = (LPARAM)infoPtr->u.bitmap; break; default: return; } +#ifdef __REACTOS__ + DrawStateW(hdc, hbr, lpOutputProc, lp, wp, rcText.left, rcText.top, + rcText.right - rcText.left, rcText.bottom - rcText.top, flags); +#else DrawStateW(hdc, hbr, lpOutputProc, lp, wp, rc->left, rc->top, rc->right - rc->left, rc->bottom - rc->top, flags); - HeapFree( GetProcessHeap(), 0, text ); +#endif + heap_free( text ); } /********************************************************************** * Push Button Functions */ -static void PB_Paint( HWND hwnd, HDC hDC, UINT action ) +static void PB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ) { RECT rc, r; UINT dtFlags, uState; - HPEN hOldPen; + HPEN hOldPen, hpen; HBRUSH hOldBrush; INT oldBkMode; COLORREF oldTxtColor; HFONT hFont; - LONG state = get_button_state( hwnd ); - LONG style = GetWindowLongPtrW( hwnd, GWL_STYLE ); + LONG state = infoPtr->state; + LONG style = GetWindowLongW( infoPtr->hwnd, GWL_STYLE ); BOOL pushedState = (state & BST_PUSHED); HWND parent; HRGN hrgn; -#ifndef _USER32_ +#ifdef __REACTOS__ DWORD cdrf; #endif - GetClientRect( hwnd, &rc ); + GetClientRect( infoPtr->hwnd, &rc ); /* Send WM_CTLCOLOR to allow changing the font (the colors are fixed) */ - if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont ); - parent = GetParent(hwnd); - if (!parent) parent = hwnd; -#if defined(__REACTOS__) && defined(_USER32_) - GetControlColor( parent, hwnd, hDC, WM_CTLCOLORBTN); -#else - SendMessageW( parent, WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)hwnd ); -#endif + if ((hFont = infoPtr->font)) SelectObject( hDC, hFont ); + parent = GetParent(infoPtr->hwnd); + if (!parent) parent = infoPtr->hwnd; + SendMessageW( parent, WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)infoPtr->hwnd ); hrgn = set_control_clipping( hDC, &rc ); -#ifdef __REACTOS__ - hOldPen = SelectObject(hDC, GetStockObject(DC_PEN)); - SetDCPenColor(hDC, GetSysColor(COLOR_WINDOWFRAME)); -#else - hOldPen = SelectObject(hDC, SYSCOLOR_GetPen(COLOR_WINDOWFRAME)); -#endif + + hpen = CreatePen( PS_SOLID, 1, GetSysColor(COLOR_WINDOWFRAME)); + hOldPen = SelectObject(hDC, hpen); hOldBrush = SelectObject(hDC,GetSysColorBrush(COLOR_BTNFACE)); oldBkMode = SetBkMode(hDC, TRANSPARENT); - /* completely skip the drawing if only focus has changed */ - if (action == ODA_FOCUS) goto draw_focus; - -#ifndef _USER32_ - cdrf = BUTTON_SendCustomDraw(hwnd, hDC, CDDS_PREERASE, &rc); +#ifdef __REACTOS__ + cdrf = BUTTON_SendCustomDraw(infoPtr, hDC, CDDS_PREERASE, &rc); if (cdrf == CDRF_SKIPDEFAULT) goto cleanup; #endif @@ -1497,6 +1416,9 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action ) InflateRect( &rc, -1, -1 ); } + /* completely skip the drawing if only focus has changed */ + if (action == ODA_FOCUS) goto draw_focus; + uState = DFCS_BUTTONPUSH; if (style & BS_FLAT) @@ -1514,18 +1436,18 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action ) DrawFrameControl( hDC, &rc, DFC_BUTTON, uState ); -#ifndef _USER32_ +#ifdef __REACTOS__ if (cdrf == CDRF_NOTIFYPOSTERASE) - BUTTON_SendCustomDraw(hwnd, hDC, CDDS_POSTERASE, &rc); + BUTTON_SendCustomDraw(infoPtr, hDC, CDDS_POSTERASE, &rc); - cdrf = BUTTON_SendCustomDraw(hwnd, hDC, CDDS_PREPAINT, &rc); + cdrf = BUTTON_SendCustomDraw(infoPtr, hDC, CDDS_PREPAINT, &rc); if (cdrf == CDRF_SKIPDEFAULT) goto cleanup; #endif /* draw button label */ r = rc; - dtFlags = BUTTON_CalcLabelRect(hwnd, hDC, &r); + dtFlags = BUTTON_CalcLabelRect(infoPtr, hDC, &r); if (dtFlags == (UINT)-1L) goto cleanup; @@ -1535,20 +1457,20 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action ) oldTxtColor = SetTextColor( hDC, GetSysColor(COLOR_BTNTEXT) ); - BUTTON_DrawLabel(hwnd, hDC, dtFlags, &r); + BUTTON_DrawLabel(infoPtr, hDC, dtFlags, &r); SetTextColor( hDC, oldTxtColor ); -#ifndef _USER32_ +#ifdef __REACTOS__ if (cdrf == CDRF_NOTIFYPOSTPAINT) - BUTTON_SendCustomDraw(hwnd, hDC, CDDS_POSTPAINT, &rc); + BUTTON_SendCustomDraw(infoPtr, hDC, CDDS_POSTPAINT, &rc); #endif draw_focus: if (action == ODA_FOCUS || (state & BST_FOCUS)) { #ifdef __REACTOS__ - if (!(get_ui_state(hwnd) & UISF_HIDEFOCUS)) + if (!(infoPtr->ui_state & UISF_HIDEFOCUS)) { #endif InflateRect( &rc, -2, -2 ); @@ -1564,64 +1486,57 @@ draw_focus: SetBkMode(hDC, oldBkMode); SelectClipRgn( hDC, hrgn ); if (hrgn) DeleteObject( hrgn ); + DeleteObject( hpen ); } /********************************************************************** * Check Box & Radio Button Functions */ -static void CB_Paint( HWND hwnd, HDC hDC, UINT action ) +static void CB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ) { RECT rbox, rtext, client; HBRUSH hBrush; int delta, text_offset, checkBoxWidth, checkBoxHeight; UINT dtFlags; HFONT hFont; - LONG state = get_button_state( hwnd ); - LONG style = GetWindowLongPtrW( hwnd, GWL_STYLE ); - LONG ex_style = GetWindowLongW( hwnd, GWL_EXSTYLE ); + LONG state = infoPtr->state; + LONG style = GetWindowLongW( infoPtr->hwnd, GWL_STYLE ); + LONG ex_style = GetWindowLongW( infoPtr->hwnd, GWL_EXSTYLE ); HWND parent; HRGN hrgn; if (style & BS_PUSHLIKE) { - PB_Paint( hwnd, hDC, action ); + PB_Paint( infoPtr, hDC, action ); return; } - GetClientRect(hwnd, &client); + GetClientRect(infoPtr->hwnd, &client); rbox = rtext = client; checkBoxWidth = 12 * GetDeviceCaps( hDC, LOGPIXELSX ) / 96 + 1; checkBoxHeight = 12 * GetDeviceCaps( hDC, LOGPIXELSY ) / 96 + 1; - if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont ); + if ((hFont = infoPtr->font)) SelectObject( hDC, hFont ); GetCharWidthW( hDC, '0', '0', &text_offset ); text_offset /= 2; - parent = GetParent(hwnd); - if (!parent) parent = hwnd; -#if defined(__REACTOS__) && defined(_USER32_) - hBrush = GetControlColor(parent, hwnd, hDC, WM_CTLCOLORSTATIC); -#else - hBrush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORSTATIC, - (WPARAM)hDC, (LPARAM)hwnd); + parent = GetParent(infoPtr->hwnd); + if (!parent) parent = infoPtr->hwnd; + hBrush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORSTATIC, (WPARAM)hDC, (LPARAM)infoPtr->hwnd); if (!hBrush) /* did the app forget to call defwindowproc ? */ - hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORSTATIC, - (WPARAM)hDC, (LPARAM)hwnd ); -#endif + hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORSTATIC, (WPARAM)hDC, (LPARAM)infoPtr->hwnd); hrgn = set_control_clipping( hDC, &client ); if (style & BS_LEFTTEXT || ex_style & WS_EX_RIGHT) { - /* magic +4 is what CTL3D expects */ - - rtext.right -= checkBoxWidth + text_offset;; + rtext.right -= checkBoxWidth + text_offset; rbox.left = rbox.right - checkBoxWidth; } else { - rtext.left += checkBoxWidth + text_offset;; + rtext.left += checkBoxWidth + text_offset; rbox.right = checkBoxWidth; } @@ -1631,8 +1546,8 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action ) /* Draw label */ client = rtext; - dtFlags = BUTTON_CalcLabelRect(hwnd, hDC, &rtext); - + dtFlags = BUTTON_CalcLabelRect(infoPtr, hDC, &rtext); + /* Only adjust rbox when rtext is valid */ if (dtFlags != (UINT)-1L) { @@ -1657,11 +1572,11 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action ) /* rbox must have the correct height */ delta = rbox.bottom - rbox.top - checkBoxHeight; - + if (style & BS_TOP) { if (delta > 0) { rbox.bottom = rbox.top + checkBoxHeight; - } else { + } else { rbox.top -= -delta/2 + 1; rbox.bottom = rbox.top + checkBoxHeight; } @@ -1691,22 +1606,15 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action ) return; if (action == ODA_DRAWENTIRE) - BUTTON_DrawLabel(hwnd, hDC, dtFlags, &rtext); + BUTTON_DrawLabel(infoPtr, hDC, dtFlags, &rtext); /* ... and focus */ if (action == ODA_FOCUS || (state & BST_FOCUS)) { -#ifdef __REACTOS__ - if (!(get_ui_state(hwnd) & UISF_HIDEFOCUS)) - { -#endif - rtext.left--; - rtext.right++; - IntersectRect(&rtext, &rtext, &client); - DrawFocusRect( hDC, &rtext ); -#ifdef __REACTOS__ - } -#endif + rtext.left--; + rtext.right++; + IntersectRect(&rtext, &rtext, &client); + DrawFocusRect( hDC, &rtext ); } SelectClipRgn( hDC, hrgn ); if (hrgn) DeleteObject( hrgn ); @@ -1729,7 +1637,7 @@ static void BUTTON_CheckAutoRadioButton( HWND hwnd ) { if (!sibling) break; if ((hwnd != sibling) && - ((GetWindowLongPtrW( sibling, GWL_STYLE) & BS_TYPEMASK) == BS_AUTORADIOBUTTON)) + ((GetWindowLongW( sibling, GWL_STYLE) & BS_TYPEMASK) == BS_AUTORADIOBUTTON)) SendMessageW( sibling, BM_SETCHECK, BST_UNCHECKED, 0 ); sibling = GetNextDlgGroupItem( parent, sibling, FALSE ); } while (sibling != start); @@ -1740,30 +1648,25 @@ static void BUTTON_CheckAutoRadioButton( HWND hwnd ) * Group Box Functions */ -static void GB_Paint( HWND hwnd, HDC hDC, UINT action ) +static void GB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ) { RECT rc, rcFrame; HBRUSH hbr; HFONT hFont; UINT dtFlags; TEXTMETRICW tm; - LONG style = GetWindowLongPtrW( hwnd, GWL_STYLE ); + LONG style = GetWindowLongW( infoPtr->hwnd, GWL_STYLE ); HWND parent; HRGN hrgn; - if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont ); + if ((hFont = infoPtr->font)) SelectObject( hDC, hFont ); /* GroupBox acts like static control, so it sends CTLCOLORSTATIC */ - parent = GetParent(hwnd); - if (!parent) parent = hwnd; -#if defined(__REACTOS__) && defined(_USER32_) - hbr = GetControlColor(parent, hwnd, hDC, WM_CTLCOLORSTATIC); -#else - hbr = (HBRUSH)SendMessageW(parent, WM_CTLCOLORSTATIC, (WPARAM)hDC, (LPARAM)hwnd); + parent = GetParent(infoPtr->hwnd); + if (!parent) parent = infoPtr->hwnd; + hbr = (HBRUSH)SendMessageW(parent, WM_CTLCOLORSTATIC, (WPARAM)hDC, (LPARAM)infoPtr->hwnd); if (!hbr) /* did the app forget to call defwindowproc ? */ - hbr = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORSTATIC, - (WPARAM)hDC, (LPARAM)hwnd); -#endif - GetClientRect( hwnd, &rc); + hbr = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORSTATIC, (WPARAM)hDC, (LPARAM)infoPtr->hwnd); + GetClientRect( infoPtr->hwnd, &rc); rcFrame = rc; hrgn = set_control_clipping( hDC, &rc ); @@ -1772,9 +1675,9 @@ static void GB_Paint( HWND hwnd, HDC hDC, UINT action ) DrawEdge (hDC, &rcFrame, EDGE_ETCHED, BF_RECT | ((style & BS_FLAT) ? BF_FLAT : 0)); InflateRect(&rc, -7, 1); - dtFlags = BUTTON_CalcLabelRect(hwnd, hDC, &rc); + dtFlags = BUTTON_CalcLabelRect(infoPtr, hDC, &rc); - if (dtFlags != (UINT)-1L) + if (dtFlags != (UINT)-1) { /* Because buttons have CS_PARENTDC class style, there is a chance * that label will be drawn out of client rect. @@ -1786,7 +1689,7 @@ static void GB_Paint( HWND hwnd, HDC hDC, UINT action ) FillRect(hDC, &rc, hbr); rc.left++; rc.right--; rc.bottom--; - BUTTON_DrawLabel(hwnd, hDC, dtFlags, &rc); + BUTTON_DrawLabel(infoPtr, hDC, dtFlags, &rc); } SelectClipRgn( hDC, hrgn ); if (hrgn) DeleteObject( hrgn ); @@ -1797,52 +1700,39 @@ static void GB_Paint( HWND hwnd, HDC hDC, UINT action ) * User Button Functions */ -static void UB_Paint( HWND hwnd, HDC hDC, UINT action ) +static void UB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ) { RECT rc; HBRUSH hBrush; HFONT hFont; - LONG state = get_button_state( hwnd ); + LONG state = infoPtr->state; HWND parent; - GetClientRect( hwnd, &rc); + GetClientRect( infoPtr->hwnd, &rc); - if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont ); + if ((hFont = infoPtr->font)) SelectObject( hDC, hFont ); - parent = GetParent(hwnd); - if (!parent) parent = hwnd; -#if defined(__REACTOS__) && defined(_USER32_) - hBrush = GetControlColor( parent, hwnd, hDC, WM_CTLCOLORBTN); -#else - hBrush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)hwnd); + parent = GetParent(infoPtr->hwnd); + if (!parent) parent = infoPtr->hwnd; + hBrush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)infoPtr->hwnd); if (!hBrush) /* did the app forget to call defwindowproc ? */ - hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORBTN, - (WPARAM)hDC, (LPARAM)hwnd); -#endif + hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)infoPtr->hwnd); FillRect( hDC, &rc, hBrush ); if (action == ODA_FOCUS || (state & BST_FOCUS)) -#ifdef __REACTOS__ - { - if (!(get_ui_state(hwnd) & UISF_HIDEFOCUS)) -#endif - DrawFocusRect( hDC, &rc ); -#ifdef __REACTOS__ - } -#endif + DrawFocusRect( hDC, &rc ); switch (action) { case ODA_FOCUS: - BUTTON_NOTIFY_PARENT( hwnd, (state & BST_FOCUS) ? BN_SETFOCUS : BN_KILLFOCUS ); + BUTTON_NOTIFY_PARENT( infoPtr->hwnd, (state & BST_FOCUS) ? BN_SETFOCUS : BN_KILLFOCUS ); break; case ODA_SELECT: - BUTTON_NOTIFY_PARENT( hwnd, (state & BST_PUSHED) ? BN_HILITE : BN_UNHILITE ); + BUTTON_NOTIFY_PARENT( infoPtr->hwnd, (state & BST_PUSHED) ? BN_HILITE : BN_UNHILITE ); break; default: - BUTTON_NOTIFY_PARENT( hwnd, BN_PAINT ); break; } } @@ -1852,13 +1742,13 @@ static void UB_Paint( HWND hwnd, HDC hDC, UINT action ) * Ownerdrawn Button Functions */ -static void OB_Paint( HWND hwnd, HDC hDC, UINT action ) +static void OB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ) { - LONG state = get_button_state( hwnd ); + LONG state = infoPtr->state; DRAWITEMSTRUCT dis; - LONG_PTR id = GetWindowLongPtrW( hwnd, GWLP_ID ); + LONG_PTR id = GetWindowLongPtrW( infoPtr->hwnd, GWLP_ID ); HWND parent; - HFONT hFont, hPrevFont = 0; + HFONT hFont; HRGN hrgn; dis.CtlType = ODT_BUTTON; @@ -1867,46 +1757,349 @@ static void OB_Paint( HWND hwnd, HDC hDC, UINT action ) dis.itemAction = action; dis.itemState = ((state & BST_FOCUS) ? ODS_FOCUS : 0) | ((state & BST_PUSHED) ? ODS_SELECTED : 0) | - (IsWindowEnabled(hwnd) ? 0: ODS_DISABLED); - dis.hwndItem = hwnd; + (IsWindowEnabled(infoPtr->hwnd) ? 0: ODS_DISABLED); + dis.hwndItem = infoPtr->hwnd; dis.hDC = hDC; dis.itemData = 0; - GetClientRect( hwnd, &dis.rcItem ); + GetClientRect( infoPtr->hwnd, &dis.rcItem ); - if ((hFont = get_button_font( hwnd ))) hPrevFont = SelectObject( hDC, hFont ); - parent = GetParent(hwnd); - if (!parent) parent = hwnd; -#if defined(__REACTOS__) && defined(_USER32_) - GetControlColor( parent, hwnd, hDC, WM_CTLCOLORBTN); -#else - SendMessageW( parent, WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)hwnd ); -#endif + if ((hFont = infoPtr->font)) SelectObject( hDC, hFont ); + parent = GetParent(infoPtr->hwnd); + if (!parent) parent = infoPtr->hwnd; + SendMessageW( parent, WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)infoPtr->hwnd ); hrgn = set_control_clipping( hDC, &dis.rcItem ); - SendMessageW( GetParent(hwnd), WM_DRAWITEM, id, (LPARAM)&dis ); - if (hPrevFont) SelectObject(hDC, hPrevFont); + SendMessageW( GetParent(infoPtr->hwnd), WM_DRAWITEM, id, (LPARAM)&dis ); SelectClipRgn( hDC, hrgn ); if (hrgn) DeleteObject( hrgn ); } -#ifndef _USER32_ -void BUTTON_Register() +#ifdef __REACTOS__ /* r73885 */ +static void PB_ThemedPaint( HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused, LPARAM prfFlag) +#else +static void PB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused) +#endif +{ + static const int states[] = { PBS_NORMAL, PBS_DISABLED, PBS_HOT, PBS_PRESSED, PBS_DEFAULTED }; + + RECT bgRect, textRect; + HFONT font = infoPtr->font; + HFONT hPrevFont = font ? SelectObject(hDC, font) : NULL; + int state = states[ drawState ]; + WCHAR *text = get_button_text(infoPtr); +#ifdef __REACTOS__ + HWND parent; + DWORD cdrf; + + GetClientRect(infoPtr->hwnd, &bgRect); + GetThemeBackgroundContentRect(theme, hDC, BP_PUSHBUTTON, state, &bgRect, &textRect); + + if (prfFlag == 0) + { + if (IsThemeBackgroundPartiallyTransparent(theme, BP_PUSHBUTTON, state)) + DrawThemeParentBackground(infoPtr->hwnd, hDC, NULL); + } + + parent = GetParent(infoPtr->hwnd); + if (!parent) parent = infoPtr->hwnd; + SendMessageW( parent, WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)infoPtr->hwnd ); + + cdrf = BUTTON_SendCustomDraw(infoPtr, hDC, CDDS_PREERASE, &bgRect); + if (cdrf == CDRF_SKIPDEFAULT) + goto cleanup; + + DrawThemeBackground(theme, hDC, BP_PUSHBUTTON, state, &bgRect, NULL); + + if (cdrf == CDRF_NOTIFYPOSTERASE) + BUTTON_SendCustomDraw(infoPtr, hDC, CDDS_POSTERASE, &bgRect); + + cdrf = BUTTON_SendCustomDraw(infoPtr, hDC, CDDS_PREPAINT, &bgRect); + if (cdrf == CDRF_SKIPDEFAULT) + goto cleanup; + + BUTTON_DrawIml(hDC, &infoPtr->imlData, &textRect, FALSE, drawState); +#else + GetClientRect(infoPtr->hwnd, &bgRect); + GetThemeBackgroundContentRect(theme, hDC, BP_PUSHBUTTON, state, &bgRect, &textRect); + + if (IsThemeBackgroundPartiallyTransparent(theme, BP_PUSHBUTTON, state)) + DrawThemeParentBackground(infoPtr->hwnd, hDC, NULL); + + DrawThemeBackground(theme, hDC, BP_PUSHBUTTON, state, &bgRect, NULL); +#endif + + if (text) + { + DrawThemeText(theme, hDC, BP_PUSHBUTTON, state, text, lstrlenW(text), dtFlags, 0, &textRect); + heap_free(text); + } + + if (focused) + { + MARGINS margins; + RECT focusRect = bgRect; + + GetThemeMargins(theme, hDC, BP_PUSHBUTTON, state, TMT_CONTENTMARGINS, NULL, &margins); + + focusRect.left += margins.cxLeftWidth; + focusRect.top += margins.cyTopHeight; + focusRect.right -= margins.cxRightWidth; + focusRect.bottom -= margins.cyBottomHeight; + + DrawFocusRect( hDC, &focusRect ); + } + +#ifdef __REACTOS__ + if (cdrf == CDRF_NOTIFYPOSTPAINT) + BUTTON_SendCustomDraw(infoPtr, hDC, CDDS_POSTPAINT, &bgRect); +cleanup: +#endif + if (hPrevFont) SelectObject(hDC, hPrevFont); +} + +#ifdef __REACTOS__ /* r73885 */ +static void CB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused, LPARAM prfFlag) +#else +static void CB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused) +#endif +{ + static const int cb_states[3][5] = + { + { CBS_UNCHECKEDNORMAL, CBS_UNCHECKEDHOT, CBS_UNCHECKEDPRESSED, CBS_UNCHECKEDDISABLED, CBS_UNCHECKEDNORMAL }, + { CBS_CHECKEDNORMAL, CBS_CHECKEDHOT, CBS_CHECKEDPRESSED, CBS_CHECKEDDISABLED, CBS_CHECKEDNORMAL }, + { CBS_MIXEDNORMAL, CBS_MIXEDHOT, CBS_MIXEDPRESSED, CBS_MIXEDDISABLED, CBS_MIXEDNORMAL } + }; + + static const int rb_states[2][5] = + { + { RBS_UNCHECKEDNORMAL, RBS_UNCHECKEDHOT, RBS_UNCHECKEDPRESSED, RBS_UNCHECKEDDISABLED, RBS_UNCHECKEDNORMAL }, + { RBS_CHECKEDNORMAL, RBS_CHECKEDHOT, RBS_CHECKEDPRESSED, RBS_CHECKEDDISABLED, RBS_CHECKEDNORMAL } + }; + + SIZE sz; + RECT bgRect, textRect; + HFONT font, hPrevFont = NULL; + int checkState = infoPtr->state & 3; + DWORD dwStyle = GetWindowLongW(infoPtr->hwnd, GWL_STYLE); + UINT btn_type = get_button_type( dwStyle ); + int part = (btn_type == BS_RADIOBUTTON) || (btn_type == BS_AUTORADIOBUTTON) ? BP_RADIOBUTTON : BP_CHECKBOX; + int state = (part == BP_CHECKBOX) + ? cb_states[ checkState ][ drawState ] + : rb_states[ checkState ][ drawState ]; + WCHAR *text = get_button_text(infoPtr); + LOGFONTW lf; + BOOL created_font = FALSE; +#ifdef __REACTOS__ + HWND parent; + HBRUSH hBrush; + DWORD cdrf; +#endif + + HRESULT hr = GetThemeFont(theme, hDC, part, state, TMT_FONT, &lf); + if (SUCCEEDED(hr)) { + font = CreateFontIndirectW(&lf); + if (!font) + TRACE("Failed to create font\n"); + else { + TRACE("font = %s\n", debugstr_w(lf.lfFaceName)); + hPrevFont = SelectObject(hDC, font); + created_font = TRUE; + } + } else { +#ifdef __REACTOS__ /* r73885 */ + font = infoPtr->font; +#else + font = (HFONT)SendMessageW(infoPtr->hwnd, WM_GETFONT, 0, 0); +#endif + hPrevFont = SelectObject(hDC, font); + } + + if (FAILED(GetThemePartSize(theme, hDC, part, state, NULL, TS_DRAW, &sz))) + sz.cx = sz.cy = 13; + + GetClientRect(infoPtr->hwnd, &bgRect); + +#ifdef __REACTOS__ + if (prfFlag == 0) + { + DrawThemeParentBackground(infoPtr->hwnd, hDC, NULL); + } + + parent = GetParent(infoPtr->hwnd); + if (!parent) parent = infoPtr->hwnd; + hBrush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORSTATIC, + (WPARAM)hDC, (LPARAM)infoPtr->hwnd); + if (!hBrush) /* did the app forget to call defwindowproc ? */ + hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORSTATIC, + (WPARAM)hDC, (LPARAM)infoPtr->hwnd ); + FillRect( hDC, &bgRect, hBrush ); + + cdrf = BUTTON_SendCustomDraw(infoPtr, hDC, CDDS_PREERASE, &bgRect); + if (cdrf == CDRF_SKIPDEFAULT) + goto cleanup; +#endif + + GetThemeBackgroundContentRect(theme, hDC, part, state, &bgRect, &textRect); + + if (dtFlags & DT_SINGLELINE) /* Center the checkbox / radio button to the text. */ + bgRect.top = bgRect.top + (textRect.bottom - textRect.top - sz.cy) / 2; + + /* adjust for the check/radio marker */ + bgRect.bottom = bgRect.top + sz.cy; + bgRect.right = bgRect.left + sz.cx; + textRect.left = bgRect.right + 6; + +#ifdef __REACTOS__ + DrawThemeBackground(theme, hDC, part, state, &bgRect, NULL); + + if (cdrf == CDRF_NOTIFYPOSTERASE) + BUTTON_SendCustomDraw(infoPtr, hDC, CDDS_POSTERASE, &bgRect); + + cdrf = BUTTON_SendCustomDraw(infoPtr, hDC, CDDS_PREPAINT, &bgRect); + if (cdrf == CDRF_SKIPDEFAULT) + goto cleanup; + +#else + DrawThemeParentBackground(infoPtr->hwnd, hDC, NULL); + DrawThemeBackground(theme, hDC, part, state, &bgRect, NULL); +#endif + if (text) + { + DrawThemeText(theme, hDC, part, state, text, lstrlenW(text), dtFlags, 0, &textRect); + + if (focused) + { + RECT focusRect; + + focusRect = textRect; + + DrawTextW(hDC, text, lstrlenW(text), &focusRect, dtFlags | DT_CALCRECT); + + if (focusRect.right < textRect.right) focusRect.right++; + focusRect.bottom = textRect.bottom; + + DrawFocusRect( hDC, &focusRect ); + } + + heap_free(text); + } + +#ifdef __REACTOS__ + if (cdrf == CDRF_NOTIFYPOSTPAINT) + BUTTON_SendCustomDraw(infoPtr, hDC, CDDS_POSTPAINT, &bgRect); +cleanup: +#endif + if (created_font) DeleteObject(font); + if (hPrevFont) SelectObject(hDC, hPrevFont); +} + +#ifdef __REACTOS__ /* r73885 */ +static void GB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused, LPARAM prfFlag) +#else +static void GB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused) +#endif +{ + static const int states[] = { GBS_NORMAL, GBS_DISABLED, GBS_NORMAL, GBS_NORMAL, GBS_NORMAL }; + + RECT bgRect, textRect, contentRect; + int state = states[ drawState ]; + WCHAR *text = get_button_text(infoPtr); + LOGFONTW lf; + HFONT font, hPrevFont = NULL; + BOOL created_font = FALSE; +#ifdef __REACTOS__ /* r74406 */ + HWND parent; + HBRUSH hBrush; + RECT clientRect; +#endif + + HRESULT hr = GetThemeFont(theme, hDC, BP_GROUPBOX, state, TMT_FONT, &lf); + if (SUCCEEDED(hr)) { + font = CreateFontIndirectW(&lf); + if (!font) + TRACE("Failed to create font\n"); + else { + hPrevFont = SelectObject(hDC, font); + created_font = TRUE; + } + } else { +#ifdef __REACTOS__ /* r73885 */ + font = infoPtr->font; +#else + font = (HFONT)SendMessageW(infoPtr->hwnd, WM_GETFONT, 0, 0); +#endif + hPrevFont = SelectObject(hDC, font); + } + + GetClientRect(infoPtr->hwnd, &bgRect); + textRect = bgRect; + + if (text) + { + SIZE textExtent; + GetTextExtentPoint32W(hDC, text, lstrlenW(text), &textExtent); + bgRect.top += (textExtent.cy / 2); + textRect.left += 10; + textRect.bottom = textRect.top + textExtent.cy; + textRect.right = textRect.left + textExtent.cx + 4; + + ExcludeClipRect(hDC, textRect.left, textRect.top, textRect.right, textRect.bottom); + } + + GetThemeBackgroundContentRect(theme, hDC, BP_GROUPBOX, state, &bgRect, &contentRect); + ExcludeClipRect(hDC, contentRect.left, contentRect.top, contentRect.right, contentRect.bottom); + +#ifdef __REACTOS__ /* r73885 & r74149 */ + if (prfFlag == 0) +#endif + if (IsThemeBackgroundPartiallyTransparent(theme, BP_GROUPBOX, state)) + DrawThemeParentBackground(infoPtr->hwnd, hDC, NULL); + +#ifdef __REACTOS__ /* r74406 */ + parent = GetParent(infoPtr->hwnd); + if (!parent) parent = infoPtr->hwnd; + hBrush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORSTATIC, + (WPARAM)hDC, (LPARAM)infoPtr->hwnd); + if (!hBrush) /* did the app forget to call defwindowproc ? */ + hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORSTATIC, + (WPARAM)hDC, (LPARAM)infoPtr->hwnd ); + GetClientRect(infoPtr->hwnd, &clientRect); + FillRect( hDC, &clientRect, hBrush ); +#endif + + DrawThemeBackground(theme, hDC, BP_GROUPBOX, state, &bgRect, NULL); + + SelectClipRgn(hDC, NULL); + + if (text) + { + InflateRect(&textRect, -2, 0); + DrawThemeText(theme, hDC, BP_GROUPBOX, state, text, lstrlenW(text), 0, 0, &textRect); + heap_free(text); + } + + if (created_font) DeleteObject(font); + if (hPrevFont) SelectObject(hDC, hPrevFont); +} + +void BUTTON_Register(void) { WNDCLASSW wndClass; - ZeroMemory(&wndClass, sizeof(WNDCLASSW)); - wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC; - wndClass.lpfnWndProc = ButtonWndProcW; - wndClass.cbClsExtra = 0; - wndClass.cbWndExtra = sizeof(PBUTTON_DATA); - wndClass.hCursor = LoadCursorW(0, (LPCWSTR)IDC_ARROW); - wndClass.hbrBackground = 0; + memset(&wndClass, 0, sizeof(wndClass)); + wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC; + wndClass.lpfnWndProc = BUTTON_WindowProc; + wndClass.cbClsExtra = 0; + wndClass.cbWndExtra = sizeof(BUTTON_INFO *); + wndClass.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW); + wndClass.hbrBackground = NULL; wndClass.lpszClassName = WC_BUTTONW; - RegisterClassW(&wndClass); } + +#ifdef __REACTOS__ void BUTTON_Unregister() { UnregisterClassW(WC_BUTTONW, NULL); diff --git a/dll/win32/comctl32/combo.c b/dll/win32/comctl32/combo.c new file mode 100644 index 0000000000..712e27276a --- /dev/null +++ b/dll/win32/comctl32/combo.c @@ -0,0 +1,2160 @@ +/* + * Combo controls + * + * Copyright 1997 Alex Korobka + * Copyright (c) 2005 by Frank Richter + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * 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> +#include <string.h> + +#define OEMRESOURCE + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "uxtheme.h" +#include "vssym32.h" +#include "commctrl.h" +#include "wine/unicode.h" +#include "wine/debug.h" +#include "wine/heap.h" + +#include "comctl32.h" + +WINE_DEFAULT_DEBUG_CHANNEL(combo); + + /* bits in the dwKeyData */ +#define KEYDATA_ALT 0x2000 +#define KEYDATA_PREVSTATE 0x4000 + +/* + * Additional combo box definitions + */ + +#define CB_NOTIFY( lphc, code ) \ + (SendMessageW((lphc)->owner, WM_COMMAND, \ + MAKEWPARAM(GetWindowLongPtrW((lphc)->self,GWLP_ID), (code)), (LPARAM)(lphc)->self)) + +#define CB_DISABLED( lphc ) (!IsWindowEnabled((lphc)->self)) +#define CB_OWNERDRAWN( lphc ) ((lphc)->dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) +#define CB_HASSTRINGS( lphc ) ((lphc)->dwStyle & CBS_HASSTRINGS) +#define CB_HWND( lphc ) ((lphc)->self) +#define CB_GETTYPE( lphc ) ((lphc)->dwStyle & (CBS_DROPDOWNLIST)) + +#define ISWIN31 (LOWORD(GetVersion()) == 0x0a03) + +/* + * Drawing globals + */ +static HBITMAP hComboBmp = 0; +static UINT CBitHeight, CBitWidth; + +/* + * Look and feel dependent "constants" + */ + +#define COMBO_YBORDERGAP 5 +#define COMBO_XBORDERSIZE() 2 +#define COMBO_YBORDERSIZE() 2 +#define COMBO_EDITBUTTONSPACE() 0 +#define EDIT_CONTROL_PADDING() 1 + +#define ID_CB_LISTBOX 1000 +#define ID_CB_EDIT 1001 + +/*********************************************************************** + * COMBO_Init + * + * Load combo button bitmap. + */ +static BOOL COMBO_Init(void) +{ + HDC hDC; + + if( hComboBmp ) return TRUE; + if( (hDC = CreateCompatibleDC(0)) ) + { + BOOL bRet = FALSE; + if( (hComboBmp = LoadBitmapW(0, MAKEINTRESOURCEW(OBM_COMBO))) ) + { + BITMAP bm; + HBITMAP hPrevB; + RECT r; + + GetObjectW( hComboBmp, sizeof(bm), &bm ); + CBitHeight = bm.bmHeight; + CBitWidth = bm.bmWidth; + + TRACE("combo bitmap [%i,%i]\n", CBitWidth, CBitHeight ); + + hPrevB = SelectObject( hDC, hComboBmp); + SetRect( &r, 0, 0, CBitWidth, CBitHeight ); + InvertRect( hDC, &r ); + SelectObject( hDC, hPrevB ); + bRet = TRUE; + } + DeleteDC( hDC ); + return bRet; + } + return FALSE; +} + +/*********************************************************************** + * COMBO_NCCreate + */ +static LRESULT COMBO_NCCreate(HWND hwnd, LONG style) +{ + HEADCOMBO *lphc; + + if (COMBO_Init() && (lphc = heap_alloc_zero(sizeof(*lphc)))) + { + lphc->self = hwnd; + SetWindowLongPtrW( hwnd, 0, (LONG_PTR)lphc ); + + /* some braindead apps do try to use scrollbar/border flags */ + + lphc->dwStyle = style & ~(WS_BORDER | WS_HSCROLL | WS_VSCROLL); + SetWindowLongW( hwnd, GWL_STYLE, style & ~(WS_BORDER | WS_HSCROLL | WS_VSCROLL) ); + + /* + * We also have to remove the client edge style to make sure + * we don't end-up with a non client area. + */ + SetWindowLongW( hwnd, GWL_EXSTYLE, + GetWindowLongW( hwnd, GWL_EXSTYLE ) & ~WS_EX_CLIENTEDGE ); + + if( !(style & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) ) + lphc->dwStyle |= CBS_HASSTRINGS; + if( !(GetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_NOPARENTNOTIFY) ) + lphc->wState |= CBF_NOTIFY; + + TRACE("[%p], style = %08x\n", lphc, lphc->dwStyle ); + return TRUE; + } + return FALSE; +} + +/*********************************************************************** + * COMBO_NCDestroy + */ +static LRESULT COMBO_NCDestroy( HEADCOMBO *lphc ) +{ + if (lphc) + { + TRACE("[%p]: freeing storage\n", lphc->self); + + if ( (CB_GETTYPE(lphc) != CBS_SIMPLE) && lphc->hWndLBox ) + DestroyWindow( lphc->hWndLBox ); + + SetWindowLongPtrW( lphc->self, 0, 0 ); + heap_free( lphc ); + } + + return 0; +} + +/*********************************************************************** + * CBGetTextAreaHeight + * + * This method will calculate the height of the text area of the + * combobox. + * The height of the text area is set in two ways. + * It can be set explicitly through a combobox message or through a + * WM_MEASUREITEM callback. + * If this is not the case, the height is set to font height + 4px + * This height was determined through experimentation. + * CBCalcPlacement will add 2*COMBO_YBORDERSIZE pixels for the border + */ +static INT CBGetTextAreaHeight( + HWND hwnd, + LPHEADCOMBO lphc) +{ + INT iTextItemHeight; + + if( lphc->editHeight ) /* explicitly set height */ + { + iTextItemHeight = lphc->editHeight; + } + else + { + TEXTMETRICW tm; + HDC hDC = GetDC(hwnd); + HFONT hPrevFont = 0; + INT baseUnitY; + + if (lphc->hFont) + hPrevFont = SelectObject( hDC, lphc->hFont ); + + GetTextMetricsW(hDC, &tm); + + baseUnitY = tm.tmHeight; + + if( hPrevFont ) + SelectObject( hDC, hPrevFont ); + + ReleaseDC(hwnd, hDC); + + iTextItemHeight = baseUnitY + 4; + } + + /* + * Check the ownerdraw case if we haven't asked the parent the size + * of the item yet. + */ + if ( CB_OWNERDRAWN(lphc) && + (lphc->wState & CBF_MEASUREITEM) ) + { + MEASUREITEMSTRUCT measureItem; + RECT clientRect; + INT originalItemHeight = iTextItemHeight; + UINT id = (UINT)GetWindowLongPtrW( lphc->self, GWLP_ID ); + + /* + * We use the client rect for the width of the item. + */ + GetClientRect(hwnd, &clientRect); + + lphc->wState &= ~CBF_MEASUREITEM; + + /* + * Send a first one to measure the size of the text area + */ + measureItem.CtlType = ODT_COMBOBOX; + measureItem.CtlID = id; + measureItem.itemID = -1; + measureItem.itemWidth = clientRect.right; + measureItem.itemHeight = iTextItemHeight - 6; /* ownerdrawn cb is taller */ + measureItem.itemData = 0; + SendMessageW(lphc->owner, WM_MEASUREITEM, id, (LPARAM)&measureItem); + iTextItemHeight = 6 + measureItem.itemHeight; + + /* + * Send a second one in the case of a fixed ownerdraw list to calculate the + * size of the list items. (we basically do this on behalf of the listbox) + */ + if (lphc->dwStyle & CBS_OWNERDRAWFIXED) + { + measureItem.CtlType = ODT_COMBOBOX; + measureItem.CtlID = id; + measureItem.itemID = 0; + measureItem.itemWidth = clientRect.right; + measureItem.itemHeight = originalItemHeight; + measureItem.itemData = 0; + SendMessageW(lphc->owner, WM_MEASUREITEM, id, (LPARAM)&measureItem); + lphc->fixedOwnerDrawHeight = measureItem.itemHeight; + } + + /* + * Keep the size for the next time + */ + lphc->editHeight = iTextItemHeight; + } + + return iTextItemHeight; +} + +/*********************************************************************** + * CBForceDummyResize + * + * The dummy resize is used for listboxes that have a popup to trigger + * a re-arranging of the contents of the combobox and the recalculation + * of the size of the "real" control window. + */ +static void CBForceDummyResize( + LPHEADCOMBO lphc) +{ + RECT windowRect; + int newComboHeight; + + newComboHeight = CBGetTextAreaHeight(lphc->self,lphc) + 2*COMBO_YBORDERSIZE(); + + GetWindowRect(lphc->self, &windowRect); + + /* + * We have to be careful, resizing a combobox also has the meaning that the + * dropped rect will be resized. In this case, we want to trigger a resize + * to recalculate layout but we don't want to change the dropped rectangle + * So, we pass the height of text area of control as the height. + * this will cancel-out in the processing of the WM_WINDOWPOSCHANGING + * message. + */ + SetWindowPos( lphc->self, + NULL, + 0, 0, + windowRect.right - windowRect.left, + newComboHeight, + SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE ); +} + +/*********************************************************************** + * CBCalcPlacement + * + * Set up component coordinates given valid lphc->RectCombo. + */ +static void CBCalcPlacement( + HWND hwnd, + LPHEADCOMBO lphc, + LPRECT lprEdit, + LPRECT lprButton, + LPRECT lprLB) +{ + /* + * Again, start with the client rectangle. + */ + GetClientRect(hwnd, lprEdit); + + /* + * Remove the borders + */ + InflateRect(lprEdit, -COMBO_XBORDERSIZE(), -COMBO_YBORDERSIZE()); + + /* + * Chop off the bottom part to fit with the height of the text area. + */ + lprEdit->bottom = lprEdit->top + CBGetTextAreaHeight(hwnd, lphc); + + /* + * The button starts the same vertical position as the text area. + */ + CopyRect(lprButton, lprEdit); + + /* + * If the combobox is "simple" there is no button. + */ + if( CB_GETTYPE(lphc) == CBS_SIMPLE ) + lprButton->left = lprButton->right = lprButton->bottom = 0; + else + { + /* + * Let's assume the combobox button is the same width as the + * scrollbar button. + * size the button horizontally and cut-off the text area. + */ + lprButton->left = lprButton->right - GetSystemMetrics(SM_CXVSCROLL); + lprEdit->right = lprButton->left; + } + + /* + * In the case of a dropdown, there is an additional spacing between the + * text area and the button. + */ + if( CB_GETTYPE(lphc) == CBS_DROPDOWN ) + { + lprEdit->right -= COMBO_EDITBUTTONSPACE(); + } + + /* + * If we have an edit control, we space it away from the borders slightly. + */ + if (CB_GETTYPE(lphc) != CBS_DROPDOWNLIST) + { + InflateRect(lprEdit, -EDIT_CONTROL_PADDING(), -EDIT_CONTROL_PADDING()); + } + + /* + * Adjust the size of the listbox popup. + */ + if( CB_GETTYPE(lphc) == CBS_SIMPLE ) + { + /* + * Use the client rectangle to initialize the listbox rectangle + */ + GetClientRect(hwnd, lprLB); + + /* + * Then, chop-off the top part. + */ + lprLB->top = lprEdit->bottom + COMBO_YBORDERSIZE(); + } + else + { + /* + * Make sure the dropped width is as large as the combobox itself. + */ + if (lphc->droppedWidth < (lprButton->right + COMBO_XBORDERSIZE())) + { + lprLB->right = lprLB->left + (lprButton->right + COMBO_XBORDERSIZE()); + + /* + * In the case of a dropdown, the popup listbox is offset to the right. + * so, we want to make sure it's flush with the right side of the + * combobox + */ + if( CB_GETTYPE(lphc) == CBS_DROPDOWN ) + lprLB->right -= COMBO_EDITBUTTONSPACE(); + } + else + lprLB->right = lprLB->left + lphc->droppedWidth; + } + + /* don't allow negative window width */ + if (lprEdit->right < lprEdit->left) + lprEdit->right = lprEdit->left; + + TRACE("\ttext\t= (%s)\n", wine_dbgstr_rect(lprEdit)); + + TRACE("\tbutton\t= (%s)\n", wine_dbgstr_rect(lprButton)); + + TRACE("\tlbox\t= (%s)\n", wine_dbgstr_rect(lprLB)); +} + +/*********************************************************************** + * CBGetDroppedControlRect + */ +static void CBGetDroppedControlRect( LPHEADCOMBO lphc, LPRECT lpRect) +{ + /* In windows, CB_GETDROPPEDCONTROLRECT returns the upper left corner + of the combo box and the lower right corner of the listbox */ + + GetWindowRect(lphc->self, lpRect); + + lpRect->right = lpRect->left + lphc->droppedRect.right - lphc->droppedRect.left; + lpRect->bottom = lpRect->top + lphc->droppedRect.bottom - lphc->droppedRect.top; + +} + +/*********************************************************************** + * COMBO_Create + */ +static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG style ) +{ + static const WCHAR clbName[] = {'C','o','m','b','o','L','B','o','x',0}; + static const WCHAR editName[] = {'E','d','i','t',0}; + + OpenThemeData( hwnd, WC_COMBOBOXW ); + if( !CB_GETTYPE(lphc) ) lphc->dwStyle |= CBS_SIMPLE; + if( CB_GETTYPE(lphc) != CBS_DROPDOWNLIST ) lphc->wState |= CBF_EDIT; + + lphc->owner = hwndParent; + + /* + * The item height and dropped width are not set when the control + * is created. + */ + lphc->droppedWidth = lphc->editHeight = 0; + + /* + * The first time we go through, we want to measure the ownerdraw item + */ + lphc->wState |= CBF_MEASUREITEM; + + /* M$ IE 3.01 actually creates (and rapidly destroys) an ownerless combobox */ + + if( lphc->owner || !(style & WS_VISIBLE) ) + { + UINT lbeStyle = 0; + UINT lbeExStyle = 0; + + /* + * Initialize the dropped rect to the size of the client area of the + * control and then, force all the areas of the combobox to be + * recalculated. + */ + GetClientRect( hwnd, &lphc->droppedRect ); + CBCalcPlacement(hwnd, lphc, &lphc->textRect, &lphc->buttonRect, &lphc->droppedRect ); + + /* + * Adjust the position of the popup listbox if it's necessary + */ + if ( CB_GETTYPE(lphc) != CBS_SIMPLE ) + { + lphc->droppedRect.top = lphc->textRect.bottom + COMBO_YBORDERSIZE(); + + /* + * If it's a dropdown, the listbox is offset + */ + if( CB_GETTYPE(lphc) == CBS_DROPDOWN ) + lphc->droppedRect.left += COMBO_EDITBUTTONSPACE(); + + if (lphc->droppedRect.bottom < lphc->droppedRect.top) + lphc->droppedRect.bottom = lphc->droppedRect.top; + if (lphc->droppedRect.right < lphc->droppedRect.left) + lphc->droppedRect.right = lphc->droppedRect.left; + MapWindowPoints( hwnd, 0, (LPPOINT)&lphc->droppedRect, 2 ); + } + + /* create listbox popup */ + + lbeStyle = (LBS_NOTIFY | LBS_COMBOBOX | WS_BORDER | WS_CLIPSIBLINGS | WS_CHILD) | + (style & (WS_VSCROLL | CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)); + + if( lphc->dwStyle & CBS_SORT ) + lbeStyle |= LBS_SORT; + if( lphc->dwStyle & CBS_HASSTRINGS ) + lbeStyle |= LBS_HASSTRINGS; + if( lphc->dwStyle & CBS_NOINTEGRALHEIGHT ) + lbeStyle |= LBS_NOINTEGRALHEIGHT; + if( lphc->dwStyle & CBS_DISABLENOSCROLL ) + lbeStyle |= LBS_DISABLENOSCROLL; + + if( CB_GETTYPE(lphc) == CBS_SIMPLE ) /* child listbox */ + { + lbeStyle |= WS_VISIBLE; + + /* + * In win 95 look n feel, the listbox in the simple combobox has + * the WS_EXCLIENTEDGE style instead of the WS_BORDER style. + */ + lbeStyle &= ~WS_BORDER; + lbeExStyle |= WS_EX_CLIENTEDGE; + } + else + { + lbeExStyle |= (WS_EX_TOPMOST | WS_EX_TOOLWINDOW); + } + + lphc->hWndLBox = CreateWindowExW(lbeExStyle, clbName, NULL, lbeStyle, + lphc->droppedRect.left, lphc->droppedRect.top, lphc->droppedRect.right - lphc->droppedRect.left, + lphc->droppedRect.bottom - lphc->droppedRect.top, hwnd, (HMENU)ID_CB_LISTBOX, + (HINSTANCE)GetWindowLongPtrW( hwnd, GWLP_HINSTANCE ), lphc ); + if( lphc->hWndLBox ) + { + BOOL bEdit = TRUE; + lbeStyle = WS_CHILD | WS_VISIBLE | ES_NOHIDESEL | ES_LEFT | ES_COMBO; + + if( lphc->wState & CBF_EDIT ) + { + if( lphc->dwStyle & CBS_OEMCONVERT ) + lbeStyle |= ES_OEMCONVERT; + if( lphc->dwStyle & CBS_AUTOHSCROLL ) + lbeStyle |= ES_AUTOHSCROLL; + if( lphc->dwStyle & CBS_LOWERCASE ) + lbeStyle |= ES_LOWERCASE; + else if( lphc->dwStyle & CBS_UPPERCASE ) + lbeStyle |= ES_UPPERCASE; + + if (!IsWindowEnabled(hwnd)) lbeStyle |= WS_DISABLED; + + lphc->hWndEdit = CreateWindowExW(0, editName, NULL, lbeStyle, + lphc->textRect.left, lphc->textRect.top, + lphc->textRect.right - lphc->textRect.left, + lphc->textRect.bottom - lphc->textRect.top, + hwnd, (HMENU)ID_CB_EDIT, + (HINSTANCE)GetWindowLongPtrW( hwnd, GWLP_HINSTANCE ), NULL ); + if( !lphc->hWndEdit ) + bEdit = FALSE; + } + + if( bEdit ) + { + if( CB_GETTYPE(lphc) != CBS_SIMPLE ) + { + /* Now do the trick with parent */ + SetParent(lphc->hWndLBox, HWND_DESKTOP); + /* + * If the combo is a dropdown, we must resize the control + * to fit only the text area and button. To do this, + * we send a dummy resize and the WM_WINDOWPOSCHANGING message + * will take care of setting the height for us. + */ + CBForceDummyResize(lphc); + } + + TRACE("init done\n"); + return 0; + } + ERR("edit control failure.\n"); + } else ERR("listbox failure.\n"); + } else ERR("no owner for visible combo.\n"); + + /* CreateWindow() will send WM_NCDESTROY to cleanup */ + + return -1; +} + +/*********************************************************************** + * CBPaintButton + * + * Paint combo button (normal, pressed, and disabled states). + */ +static void CBPaintButton( LPHEADCOMBO lphc, HDC hdc, RECT rectButton) +{ + UINT buttonState = DFCS_SCROLLCOMBOBOX; + + if( lphc->wState & CBF_NOREDRAW ) + return; + + + if (lphc->wState & CBF_BUTTONDOWN) + buttonState |= DFCS_PUSHED; + + if (CB_DISABLED(lphc)) + buttonState |= DFCS_INACTIVE; + + DrawFrameControl(hdc, &rectButton, DFC_SCROLL, buttonState); +} + +/*********************************************************************** + * COMBO_PrepareColors + * + * This method will sent the appropriate WM_CTLCOLOR message to + * prepare and setup the colors for the combo's DC. + * + * It also returns the brush to use for the background. + */ +static HBRUSH COMBO_PrepareColors( + LPHEADCOMBO lphc, + HDC hDC) +{ + HBRUSH hBkgBrush; + + /* + * Get the background brush for this control. + */ + if (CB_DISABLED(lphc)) + { + hBkgBrush = (HBRUSH)SendMessageW(lphc->owner, WM_CTLCOLORSTATIC, + (WPARAM)hDC, (LPARAM)lphc->self ); + + /* + * We have to change the text color since WM_CTLCOLORSTATIC will + * set it to the "enabled" color. This is the same behavior as the + * edit control + */ + SetTextColor(hDC, GetSysColor(COLOR_GRAYTEXT)); + } + else + { + /* FIXME: In which cases WM_CTLCOLORLISTBOX should be sent? */ + hBkgBrush = (HBRUSH)SendMessageW(lphc->owner, WM_CTLCOLOREDIT, + (WPARAM)hDC, (LPARAM)lphc->self ); + } + + /* + * Catch errors. + */ + if( !hBkgBrush ) + hBkgBrush = GetSysColorBrush(COLOR_WINDOW); + + return hBkgBrush; +} + +/*********************************************************************** + * CBPaintText + * + * Paint CBS_DROPDOWNLIST text field / update edit control contents. + */ +static void CBPaintText(HEADCOMBO *lphc, HDC hdc_paint) +{ + RECT rectEdit = lphc->textRect; + INT id, size = 0; + LPWSTR pText = NULL; + + TRACE("\n"); + + /* follow Windows combobox that sends a bunch of text + * inquiries to its listbox while processing WM_PAINT. */ + + if( (id = SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0) ) != LB_ERR ) + { + size = SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, id, 0); + if (size == LB_ERR) + FIXME("LB_ERR probably not handled yet\n"); + if ((pText = heap_alloc((size + 1) * sizeof(WCHAR)))) + { + /* size from LB_GETTEXTLEN may be too large, from LB_GETTEXT is accurate */ + size=SendMessageW(lphc->hWndLBox, LB_GETTEXT, id, (LPARAM)pText); + pText[size] = '\0'; /* just in case */ + } else return; + } + + if( lphc->wState & CBF_EDIT ) + { + static const WCHAR empty_stringW[] = { 0 }; + if( CB_HASSTRINGS(lphc) ) SetWindowTextW( lphc->hWndEdit, pText ? pText : empty_stringW ); + if( lphc->wState & CBF_FOCUSED ) + SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, MAXLONG); + } + else if(!(lphc->wState & CBF_NOREDRAW) && IsWindowVisible( lphc->self )) + { + /* paint text field ourselves */ + HDC hdc = hdc_paint ? hdc_paint : GetDC(lphc->self); + UINT itemState = ODS_COMBOBOXEDIT; + HFONT hPrevFont = (lphc->hFont) ? SelectObject(hdc, lphc->hFont) : 0; + HBRUSH hPrevBrush, hBkgBrush; + + /* + * Give ourselves some space. + */ + InflateRect( &rectEdit, -1, -1 ); + + hBkgBrush = COMBO_PrepareColors( lphc, hdc ); + hPrevBrush = SelectObject( hdc, hBkgBrush ); + FillRect( hdc, &rectEdit, hBkgBrush ); + + if( CB_OWNERDRAWN(lphc) ) + { + DRAWITEMSTRUCT dis; + HRGN clipRegion; + UINT ctlid = (UINT)GetWindowLongPtrW( lphc->self, GWLP_ID ); + + /* setup state for DRAWITEM message. Owner will highlight */ + if ( (lphc->wState & CBF_FOCUSED) && + !(lphc->wState & CBF_DROPPED) ) + itemState |= ODS_SELECTED | ODS_FOCUS; + + if (!IsWindowEnabled(lphc->self)) itemState |= ODS_DISABLED; + + dis.CtlType = ODT_COMBOBOX; + dis.CtlID = ctlid; + dis.hwndItem = lphc->self; + dis.itemAction = ODA_DRAWENTIRE; + dis.itemID = id; + dis.itemState = itemState; + dis.hDC = hdc; + dis.rcItem = rectEdit; + dis.itemData = SendMessageW(lphc->hWndLBox, LB_GETITEMDATA, id, 0); + + /* + * Clip the DC and have the parent draw the item. + */ + clipRegion = set_control_clipping( hdc, &rectEdit ); + + SendMessageW(lphc->owner, WM_DRAWITEM, ctlid, (LPARAM)&dis ); + + SelectClipRgn( hdc, clipRegion ); + if (clipRegion) DeleteObject( clipRegion ); + } + else + { + static const WCHAR empty_stringW[] = { 0 }; + + if ( (lphc->wState & CBF_FOCUSED) && + !(lphc->wState & CBF_DROPPED) ) { + + /* highlight */ + FillRect( hdc, &rectEdit, GetSysColorBrush(COLOR_HIGHLIGHT) ); + SetBkColor( hdc, GetSysColor( COLOR_HIGHLIGHT ) ); + SetTextColor( hdc, GetSysColor( COLOR_HIGHLIGHTTEXT ) ); + } + + ExtTextOutW( hdc, + rectEdit.left + 1, + rectEdit.top + 1, + ETO_OPAQUE | ETO_CLIPPED, + &rectEdit, + pText ? pText : empty_stringW , size, NULL ); + + if(lphc->wState & CBF_FOCUSED && !(lphc->wState & CBF_DROPPED)) + DrawFocusRect( hdc, &rectEdit ); + } + + if( hPrevFont ) + SelectObject(hdc, hPrevFont ); + + if( hPrevBrush ) + SelectObject( hdc, hPrevBrush ); + + if( !hdc_paint ) + ReleaseDC( lphc->self, hdc ); + } + + heap_free(pText); +} + +/*********************************************************************** + * CBPaintBorder + */ +static void CBPaintBorder( + HWND hwnd, + const HEADCOMBO *lphc, + HDC hdc) +{ + RECT clientRect; + + if (CB_GETTYPE(lphc) != CBS_SIMPLE) + { + GetClientRect(hwnd, &clientRect); + } + else + { + clientRect = lphc->textRect; + + InflateRect(&clientRect, EDIT_CONTROL_PADDING(), EDIT_CONTROL_PADDING()); + InflateRect(&clientRect, COMBO_XBORDERSIZE(), COMBO_YBORDERSIZE()); + } + + DrawEdge(hdc, &clientRect, EDGE_SUNKEN, BF_RECT); +} + +static LRESULT COMBO_ThemedPaint(HTHEME theme, HEADCOMBO *lphc, HDC hdc) +{ + int button_state; + RECT frame; + + /* paint border */ + if (CB_GETTYPE(lphc) != CBS_SIMPLE) + GetClientRect(lphc->self, &frame); + else + { + frame = lphc->textRect; + InflateRect(&frame, EDIT_CONTROL_PADDING(), EDIT_CONTROL_PADDING()); + InflateRect(&frame, COMBO_XBORDERSIZE(), COMBO_YBORDERSIZE()); + } + + DrawThemeBackground(theme, hdc, 0, IsWindowEnabled(lphc->self) ? CBXS_NORMAL : CBXS_DISABLED, &frame, NULL); + + /* Paint button */ + if (!IsRectEmpty(&lphc->buttonRect)) + { + if (!IsWindowEnabled(lphc->self)) + button_state = CBXS_DISABLED; + else if (lphc->wState & CBF_BUTTONDOWN) + button_state = CBXS_PRESSED; + else if (lphc->wState & CBF_HOT) + button_state = CBXS_HOT; + else + button_state = CBXS_NORMAL; + DrawThemeBackground(theme, hdc, CP_DROPDOWNBUTTON, button_state, &lphc->buttonRect, NULL); + } + + if ((lphc->dwStyle & CBS_DROPDOWNLIST) == CBS_DROPDOWNLIST) + CBPaintText(lphc, hdc); + + return 0; +} + +/*********************************************************************** + * COMBO_Paint + */ +static LRESULT COMBO_Paint(HEADCOMBO *lphc, HDC hdc) +{ + HBRUSH hPrevBrush, hBkgBrush; + + TRACE("hdc=%p\n", hdc); + + /* + * Retrieve the background brush and select it in the + * DC. + */ + hBkgBrush = COMBO_PrepareColors(lphc, hdc); + hPrevBrush = SelectObject(hdc, hBkgBrush); + if (!(lphc->wState & CBF_EDIT)) + FillRect(hdc, &lphc->textRect, hBkgBrush); + + /* + * In non 3.1 look, there is a sunken border on the combobox + */ + CBPaintBorder(lphc->self, lphc, hdc); + + if (!IsRectEmpty(&lphc->buttonRect)) + CBPaintButton(lphc, hdc, lphc->buttonRect); + + /* paint the edit control padding area */ + if (CB_GETTYPE(lphc) != CBS_DROPDOWNLIST) + { + RECT rPadEdit = lphc->textRect; + + InflateRect(&rPadEdit, EDIT_CONTROL_PADDING(), EDIT_CONTROL_PADDING()); + + FrameRect(hdc, &rPadEdit, GetSysColorBrush(COLOR_WINDOW)); + } + + if (!(lphc->wState & CBF_EDIT)) + CBPaintText( lphc, hdc ); + + if (hPrevBrush) + SelectObject( hdc, hPrevBrush ); + + return 0; +} + +/*********************************************************************** + * CBUpdateLBox + * + * Select listbox entry according to the contents of the edit control. + */ +static INT CBUpdateLBox( LPHEADCOMBO lphc, BOOL bSelect ) +{ + INT length, idx; + LPWSTR pText = NULL; + + idx = LB_ERR; + length = SendMessageW( lphc->hWndEdit, WM_GETTEXTLENGTH, 0, 0 ); + + if (length > 0) + pText = heap_alloc((length + 1) * sizeof(WCHAR)); + + TRACE("\t edit text length %i\n", length ); + + if( pText ) + { + GetWindowTextW( lphc->hWndEdit, pText, length + 1); + idx = SendMessageW(lphc->hWndLBox, LB_FINDSTRING, -1, (LPARAM)pText); + heap_free( pText ); + } + + SendMessageW(lphc->hWndLBox, LB_SETCURSEL, bSelect ? idx : -1, 0); + + /* probably superfluous but Windows sends this too */ + SendMessageW(lphc->hWndLBox, LB_SETCARETINDEX, idx < 0 ? 0 : idx, 0); + SendMessageW(lphc->hWndLBox, LB_SETTOPINDEX, idx < 0 ? 0 : idx, 0); + + return idx; +} + +/*********************************************************************** + * CBUpdateEdit + * + * Copy a listbox entry to the edit control. + */ +static void CBUpdateEdit( LPHEADCOMBO lphc , INT index ) +{ + INT length; + LPWSTR pText = NULL; + static const WCHAR empty_stringW[] = { 0 }; + + TRACE("\t %i\n", index ); + + if( index >= 0 ) /* got an entry */ + { + length = SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, index, 0); + if( length != LB_ERR) + { + if ((pText = heap_alloc((length + 1) * sizeof(WCHAR)))) + SendMessageW(lphc->hWndLBox, LB_GETTEXT, index, (LPARAM)pText); + } + } + + if( CB_HASSTRINGS(lphc) ) + { + lphc->wState |= (CBF_NOEDITNOTIFY | CBF_NOLBSELECT); + SendMessageW(lphc->hWndEdit, WM_SETTEXT, 0, pText ? (LPARAM)pText : (LPARAM)empty_stringW); + lphc->wState &= ~(CBF_NOEDITNOTIFY | CBF_NOLBSELECT); + } + + if( lphc->wState & CBF_FOCUSED ) + SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, -1); + + heap_free( pText ); +} + +/*********************************************************************** + * CBDropDown + * + * Show listbox popup. + */ +static void CBDropDown( LPHEADCOMBO lphc ) +{ + HMONITOR monitor; + MONITORINFO mon_info; + RECT rect,r; + int nItems; + int nDroppedHeight; + + TRACE("[%p]: drop down\n", lphc->self); + + CB_NOTIFY( lphc, CBN_DROPDOWN ); + + /* set selection */ + + lphc->wState |= CBF_DROPPED; + if( CB_GETTYPE(lphc) == CBS_DROPDOWN ) + { + lphc->droppedIndex = CBUpdateLBox( lphc, TRUE ); + + /* Update edit only if item is in the list */ + if( !(lphc->wState & CBF_CAPTURE) && lphc->droppedIndex >= 0) + CBUpdateEdit( lphc, lphc->droppedIndex ); + } + else + { + lphc->droppedIndex = SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0); + + SendMessageW(lphc->hWndLBox, LB_SETTOPINDEX, + lphc->droppedIndex == LB_ERR ? 0 : lphc->droppedIndex, 0); + SendMessageW(lphc->hWndLBox, LB_CARETON, 0, 0); + } + + /* now set popup position */ + GetWindowRect( lphc->self, &rect ); + + /* + * If it's a dropdown, the listbox is offset + */ + if( CB_GETTYPE(lphc) == CBS_DROPDOWN ) + rect.left += COMBO_EDITBUTTONSPACE(); + + /* if the dropped height is greater than the total height of the dropped + items list, then force the drop down list height to be the total height + of the items in the dropped list */ + + /* And Remove any extra space (Best Fit) */ + nDroppedHeight = lphc->droppedRect.bottom - lphc->droppedRect.top; + /* if listbox length has been set directly by its handle */ + GetWindowRect(lphc->hWndLBox, &r); + if (nDroppedHeight < r.bottom - r.top) + nDroppedHeight = r.bottom - r.top; + nItems = (int)SendMessageW(lphc->hWndLBox, LB_GETCOUNT, 0, 0); + + if (nItems > 0) + { + int nHeight; + int nIHeight; + + 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; + } + } + + r.left = rect.left; + r.top = rect.bottom; + r.right = r.left + lphc->droppedRect.right - lphc->droppedRect.left; + r.bottom = r.top + nDroppedHeight; + + /*If height of dropped rectangle gets beyond a screen size it should go up, otherwise down.*/ + monitor = MonitorFromRect( &rect, MONITOR_DEFAULTTOPRIMARY ); + mon_info.cbSize = sizeof(mon_info); + GetMonitorInfoW( monitor, &mon_info ); + + if (r.bottom > mon_info.rcWork.bottom) + { + r.top = max( rect.top - nDroppedHeight, mon_info.rcWork.top ); + r.bottom = min( r.top + nDroppedHeight, mon_info.rcWork.bottom ); + } + + SetWindowPos( lphc->hWndLBox, HWND_TOPMOST, r.left, r.top, r.right - r.left, r.bottom - r.top, + SWP_NOACTIVATE | SWP_SHOWWINDOW ); + + + if( !(lphc->wState & CBF_NOREDRAW) ) + RedrawWindow( lphc->self, NULL, 0, RDW_INVALIDATE | + RDW_ERASE | RDW_UPDATENOW | RDW_NOCHILDREN ); + + EnableWindow( lphc->hWndLBox, TRUE ); + if (GetCapture() != lphc->self) + SetCapture(lphc->hWndLBox); +} + +/*********************************************************************** + * CBRollUp + * + * Hide listbox popup. + */ +static void CBRollUp( LPHEADCOMBO lphc, BOOL ok, BOOL bButton ) +{ + HWND hWnd = lphc->self; + + TRACE("[%p]: sel ok? [%i] dropped? [%i]\n", + lphc->self, ok, (INT)(lphc->wState & CBF_DROPPED)); + + CB_NOTIFY( lphc, (ok) ? CBN_SELENDOK : CBN_SELENDCANCEL ); + + if( IsWindow( hWnd ) && CB_GETTYPE(lphc) != CBS_SIMPLE ) + { + + if( lphc->wState & CBF_DROPPED ) + { + RECT rect; + + lphc->wState &= ~CBF_DROPPED; + ShowWindow( lphc->hWndLBox, SW_HIDE ); + + if(GetCapture() == lphc->hWndLBox) + { + ReleaseCapture(); + } + + if( CB_GETTYPE(lphc) == CBS_DROPDOWN ) + { + rect = lphc->buttonRect; + } + else + { + if( bButton ) + { + UnionRect( &rect, + &lphc->buttonRect, + &lphc->textRect); + } + else + rect = lphc->textRect; + + bButton = TRUE; + } + + if( bButton && !(lphc->wState & CBF_NOREDRAW) ) + RedrawWindow( hWnd, &rect, 0, RDW_INVALIDATE | + RDW_ERASE | RDW_UPDATENOW | RDW_NOCHILDREN ); + CB_NOTIFY( lphc, CBN_CLOSEUP ); + } + } +} + +/*********************************************************************** + * COMBO_FlipListbox + * + * Used by the ComboLBox to show/hide itself in response to VK_F4, etc... + */ +BOOL COMBO_FlipListbox( LPHEADCOMBO lphc, BOOL ok, BOOL bRedrawButton ) +{ + if( lphc->wState & CBF_DROPPED ) + { + CBRollUp( lphc, ok, bRedrawButton ); + return FALSE; + } + + CBDropDown( lphc ); + return TRUE; +} + +/*********************************************************************** + * CBRepaintButton + */ +static void CBRepaintButton( LPHEADCOMBO lphc ) + { + InvalidateRect(lphc->self, &lphc->buttonRect, TRUE); + UpdateWindow(lphc->self); +} + +/*********************************************************************** + * COMBO_SetFocus + */ +static void COMBO_SetFocus( LPHEADCOMBO lphc ) +{ + if( !(lphc->wState & CBF_FOCUSED) ) + { + if( CB_GETTYPE(lphc) == CBS_DROPDOWNLIST ) + SendMessageW(lphc->hWndLBox, LB_CARETON, 0, 0); + + /* This is wrong. Message sequences seem to indicate that this + is set *after* the notify. */ + /* lphc->wState |= CBF_FOCUSED; */ + + if( !(lphc->wState & CBF_EDIT) ) + InvalidateRect(lphc->self, &lphc->textRect, TRUE); + + CB_NOTIFY( lphc, CBN_SETFOCUS ); + lphc->wState |= CBF_FOCUSED; + } +} + +/*********************************************************************** + * COMBO_KillFocus + */ +static void COMBO_KillFocus( LPHEADCOMBO lphc ) +{ + HWND hWnd = lphc->self; + + if( lphc->wState & CBF_FOCUSED ) + { + CBRollUp( lphc, FALSE, TRUE ); + if( IsWindow( hWnd ) ) + { + if( CB_GETTYPE(lphc) == CBS_DROPDOWNLIST ) + SendMessageW(lphc->hWndLBox, LB_CARETOFF, 0, 0); + + lphc->wState &= ~CBF_FOCUSED; + + /* redraw text */ + if( !(lphc->wState & CBF_EDIT) ) + InvalidateRect(lphc->self, &lphc->textRect, TRUE); + + CB_NOTIFY( lphc, CBN_KILLFOCUS ); + } + } +} + +/*********************************************************************** + * COMBO_Command + */ +static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd ) +{ + if ( lphc->wState & CBF_EDIT && lphc->hWndEdit == hWnd ) + { + /* ">> 8" makes gcc generate jump-table instead of cmp ladder */ + + switch( HIWORD(wParam) >> 8 ) + { + case (EN_SETFOCUS >> 8): + + TRACE("[%p]: edit [%p] got focus\n", lphc->self, lphc->hWndEdit ); + + COMBO_SetFocus( lphc ); + break; + + case (EN_KILLFOCUS >> 8): + + TRACE("[%p]: edit [%p] lost focus\n", lphc->self, lphc->hWndEdit ); + + /* NOTE: it seems that Windows' edit control sends an + * undocumented message WM_USER + 0x1B instead of this + * notification (only when it happens to be a part of + * the combo). ?? - AK. + */ + + COMBO_KillFocus( lphc ); + break; + + + case (EN_CHANGE >> 8): + /* + * In some circumstances (when the selection of the combobox + * is changed for example) we don't want the EN_CHANGE notification + * to be forwarded to the parent of the combobox. This code + * checks a flag that is set in these occasions and ignores the + * notification. + */ + if (lphc->wState & CBF_NOLBSELECT) + { + lphc->wState &= ~CBF_NOLBSELECT; + } + else + { + CBUpdateLBox( lphc, lphc->wState & CBF_DROPPED ); + } + + if (!(lphc->wState & CBF_NOEDITNOTIFY)) + CB_NOTIFY( lphc, CBN_EDITCHANGE ); + break; + + case (EN_UPDATE >> 8): + if (!(lphc->wState & CBF_NOEDITNOTIFY)) + CB_NOTIFY( lphc, CBN_EDITUPDATE ); + break; + + case (EN_ERRSPACE >> 8): + CB_NOTIFY( lphc, CBN_ERRSPACE ); + } + } + else if( lphc->hWndLBox == hWnd ) + { + switch( (short)HIWORD(wParam) ) + { + case LBN_ERRSPACE: + CB_NOTIFY( lphc, CBN_ERRSPACE ); + break; + + case LBN_DBLCLK: + CB_NOTIFY( lphc, CBN_DBLCLK ); + break; + + case LBN_SELCHANGE: + case LBN_SELCANCEL: + + TRACE("[%p]: lbox selection change [%x]\n", lphc->self, lphc->wState ); + + /* do not roll up if selection is being tracked + * by arrow keys in the dropdown listbox */ + if (!(lphc->wState & CBF_NOROLLUP)) + { + CBRollUp( lphc, (HIWORD(wParam) == LBN_SELCHANGE), TRUE ); + } + else lphc->wState &= ~CBF_NOROLLUP; + + CB_NOTIFY( lphc, CBN_SELCHANGE ); + + if( HIWORD(wParam) == LBN_SELCHANGE) + { + if( lphc->wState & CBF_EDIT ) + lphc->wState |= CBF_NOLBSELECT; + CBPaintText( lphc, NULL ); + } + break; + + case LBN_SETFOCUS: + case LBN_KILLFOCUS: + /* nothing to do here since ComboLBox always resets the focus to its + * combo/edit counterpart */ + break; + } + } + return 0; +} + +/*********************************************************************** + * COMBO_ItemOp + * + * Fixup an ownerdrawn item operation and pass it up to the combobox owner. + */ +static LRESULT COMBO_ItemOp( LPHEADCOMBO lphc, UINT msg, LPARAM lParam ) +{ + HWND hWnd = lphc->self; + UINT id = (UINT)GetWindowLongPtrW( hWnd, GWLP_ID ); + + TRACE("[%p]: ownerdraw op %04x\n", lphc->self, msg ); + + switch( msg ) + { + case WM_DELETEITEM: + { + DELETEITEMSTRUCT *lpIS = (DELETEITEMSTRUCT *)lParam; + lpIS->CtlType = ODT_COMBOBOX; + lpIS->CtlID = id; + lpIS->hwndItem = hWnd; + break; + } + case WM_DRAWITEM: + { + DRAWITEMSTRUCT *lpIS = (DRAWITEMSTRUCT *)lParam; + lpIS->CtlType = ODT_COMBOBOX; + lpIS->CtlID = id; + lpIS->hwndItem = hWnd; + break; + } + case WM_COMPAREITEM: + { + COMPAREITEMSTRUCT *lpIS = (COMPAREITEMSTRUCT *)lParam; + lpIS->CtlType = ODT_COMBOBOX; + lpIS->CtlID = id; + lpIS->hwndItem = hWnd; + break; + } + case WM_MEASUREITEM: + { + MEASUREITEMSTRUCT *lpIS = (MEASUREITEMSTRUCT *)lParam; + lpIS->CtlType = ODT_COMBOBOX; + lpIS->CtlID = id; + break; + } + } + return SendMessageW(lphc->owner, msg, id, lParam); +} + + +/*********************************************************************** + * COMBO_GetTextW + */ +static LRESULT COMBO_GetText( HEADCOMBO *lphc, INT count, LPWSTR buf ) +{ + INT length; + + if( lphc->wState & CBF_EDIT ) + return SendMessageW( lphc->hWndEdit, WM_GETTEXT, count, (LPARAM)buf ); + + /* get it from the listbox */ + + if (!count || !buf) return 0; + if( lphc->hWndLBox ) + { + INT idx = SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0); + if (idx == LB_ERR) goto error; + length = SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, idx, 0 ); + if (length == LB_ERR) goto error; + + /* 'length' is without the terminating character */ + if (length >= count) + { + WCHAR *lpBuffer = heap_alloc((length + 1) * sizeof(WCHAR)); + if (!lpBuffer) goto error; + length = SendMessageW(lphc->hWndLBox, LB_GETTEXT, idx, (LPARAM)lpBuffer); + + /* truncate if buffer is too short */ + if (length != LB_ERR) + { + lstrcpynW( buf, lpBuffer, count ); + length = count; + } + heap_free( lpBuffer ); + } + else length = SendMessageW(lphc->hWndLBox, LB_GETTEXT, idx, (LPARAM)buf); + + if (length == LB_ERR) return 0; + return length; + } + + error: /* error - truncate string, return zero */ + buf[0] = 0; + return 0; +} + +/*********************************************************************** + * CBResetPos + * + * This function sets window positions according to the updated + * component placement struct. + */ +static void CBResetPos( + LPHEADCOMBO lphc, + const RECT *rectEdit, + const RECT *rectLB, + BOOL bRedraw) +{ + BOOL bDrop = (CB_GETTYPE(lphc) != CBS_SIMPLE); + + /* NOTE: logs sometimes have WM_LBUTTONUP before a cascade of + * sizing messages */ + + if( lphc->wState & CBF_EDIT ) + SetWindowPos( lphc->hWndEdit, 0, + rectEdit->left, rectEdit->top, + rectEdit->right - rectEdit->left, + rectEdit->bottom - rectEdit->top, + SWP_NOZORDER | SWP_NOACTIVATE | ((bDrop) ? SWP_NOREDRAW : 0) ); + + SetWindowPos( lphc->hWndLBox, 0, + rectLB->left, rectLB->top, + rectLB->right - rectLB->left, + rectLB->bottom - rectLB->top, + SWP_NOACTIVATE | SWP_NOZORDER | ((bDrop) ? SWP_NOREDRAW : 0) ); + + if( bDrop ) + { + if( lphc->wState & CBF_DROPPED ) + { + lphc->wState &= ~CBF_DROPPED; + ShowWindow( lphc->hWndLBox, SW_HIDE ); + } + + if( bRedraw && !(lphc->wState & CBF_NOREDRAW) ) + RedrawWindow( lphc->self, NULL, 0, + RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW ); + } +} + + +/*********************************************************************** + * COMBO_Size + */ +static void COMBO_Size( LPHEADCOMBO lphc ) +{ + /* + * Those controls are always the same height. So we have to make sure + * they are not resized to another value. + */ + if( CB_GETTYPE(lphc) != CBS_SIMPLE ) + { + int newComboHeight, curComboHeight, curComboWidth; + RECT rc; + + GetWindowRect(lphc->self, &rc); + curComboHeight = rc.bottom - rc.top; + curComboWidth = rc.right - rc.left; + newComboHeight = CBGetTextAreaHeight(lphc->self, lphc) + 2*COMBO_YBORDERSIZE(); + + /* + * Resizing a combobox has another side effect, it resizes the dropped + * rectangle as well. However, it does it only if the new height for the + * combobox is more than the height it should have. In other words, + * if the application resizing the combobox only had the intention to resize + * the actual control, for example, to do the layout of a dialog that is + * resized, the height of the dropdown is not changed. + */ + if( curComboHeight > newComboHeight ) + { + TRACE("oldComboHeight=%d, newComboHeight=%d, oldDropBottom=%d, oldDropTop=%d\n", + curComboHeight, newComboHeight, lphc->droppedRect.bottom, + lphc->droppedRect.top); + lphc->droppedRect.bottom = lphc->droppedRect.top + curComboHeight - newComboHeight; + } + /* + * Restore original height + */ + if( curComboHeight != newComboHeight ) + SetWindowPos(lphc->self, 0, 0, 0, curComboWidth, newComboHeight, + SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOREDRAW); + } + + CBCalcPlacement(lphc->self, + lphc, + &lphc->textRect, + &lphc->buttonRect, + &lphc->droppedRect); + + CBResetPos( lphc, &lphc->textRect, &lphc->droppedRect, TRUE ); +} + + +/*********************************************************************** + * COMBO_Font + */ +static void COMBO_Font( LPHEADCOMBO lphc, HFONT hFont, BOOL bRedraw ) +{ + /* + * Set the font + */ + lphc->hFont = hFont; + + /* + * Propagate to owned windows. + */ + if( lphc->wState & CBF_EDIT ) + SendMessageW(lphc->hWndEdit, WM_SETFONT, (WPARAM)hFont, bRedraw); + SendMessageW(lphc->hWndLBox, WM_SETFONT, (WPARAM)hFont, bRedraw); + + /* + * Redo the layout of the control. + */ + if ( CB_GETTYPE(lphc) == CBS_SIMPLE) + { + CBCalcPlacement(lphc->self, + lphc, + &lphc->textRect, + &lphc->buttonRect, + &lphc->droppedRect); + + CBResetPos( lphc, &lphc->textRect, &lphc->droppedRect, TRUE ); + } + else + { + CBForceDummyResize(lphc); + } +} + + +/*********************************************************************** + * COMBO_SetItemHeight + */ +static LRESULT COMBO_SetItemHeight( LPHEADCOMBO lphc, INT index, INT height ) +{ + LRESULT lRet = CB_ERR; + + if( index == -1 ) /* set text field height */ + { + if( height < 32768 ) + { + lphc->editHeight = height + 2; /* Is the 2 for 2*EDIT_CONTROL_PADDING? */ + + /* + * Redo the layout of the control. + */ + if ( CB_GETTYPE(lphc) == CBS_SIMPLE) + { + CBCalcPlacement(lphc->self, + lphc, + &lphc->textRect, + &lphc->buttonRect, + &lphc->droppedRect); + + CBResetPos( lphc, &lphc->textRect, &lphc->droppedRect, TRUE ); + } + else + { + CBForceDummyResize(lphc); + } + + lRet = height; + } + } + else if ( CB_OWNERDRAWN(lphc) ) /* set listbox item height */ + lRet = SendMessageW(lphc->hWndLBox, LB_SETITEMHEIGHT, index, height); + return lRet; +} + +/*********************************************************************** + * COMBO_SelectString + */ +static LRESULT COMBO_SelectString( LPHEADCOMBO lphc, INT start, LPARAM pText) +{ + INT index = SendMessageW(lphc->hWndLBox, LB_SELECTSTRING, start, pText); + if( index >= 0 ) + { + if( lphc->wState & CBF_EDIT ) + CBUpdateEdit( lphc, index ); + else + { + InvalidateRect(lphc->self, &lphc->textRect, TRUE); + } + } + return (LRESULT)index; +} + +/*********************************************************************** + * COMBO_LButtonDown + */ +static void COMBO_LButtonDown( LPHEADCOMBO lphc, LPARAM lParam ) +{ + POINT pt; + BOOL bButton; + HWND hWnd = lphc->self; + + pt.x = (short)LOWORD(lParam); + pt.y = (short)HIWORD(lParam); + bButton = PtInRect(&lphc->buttonRect, pt); + + if( (CB_GETTYPE(lphc) == CBS_DROPDOWNLIST) || + (bButton && (CB_GETTYPE(lphc) == CBS_DROPDOWN)) ) + { + lphc->wState |= CBF_BUTTONDOWN; + if( lphc->wState & CBF_DROPPED ) + { + /* got a click to cancel selection */ + + lphc->wState &= ~CBF_BUTTONDOWN; + CBRollUp( lphc, TRUE, FALSE ); + if( !IsWindow( hWnd ) ) return; + + if( lphc->wState & CBF_CAPTURE ) + { + lphc->wState &= ~CBF_CAPTURE; + ReleaseCapture(); + } + } + else + { + /* drop down the listbox and start tracking */ + + lphc->wState |= CBF_CAPTURE; + SetCapture( hWnd ); + CBDropDown( lphc ); + } + if( bButton ) CBRepaintButton( lphc ); + } +} + +/*********************************************************************** + * COMBO_LButtonUp + * + * Release capture and stop tracking if needed. + */ +static void COMBO_LButtonUp( LPHEADCOMBO lphc ) +{ + if( lphc->wState & CBF_CAPTURE ) + { + lphc->wState &= ~CBF_CAPTURE; + if( CB_GETTYPE(lphc) == CBS_DROPDOWN ) + { + INT index = CBUpdateLBox( lphc, TRUE ); + /* Update edit only if item is in the list */ + if(index >= 0) + { + lphc->wState |= CBF_NOLBSELECT; + CBUpdateEdit( lphc, index ); + lphc->wState &= ~CBF_NOLBSELECT; + } + } + ReleaseCapture(); + SetCapture(lphc->hWndLBox); + } + + if( lphc->wState & CBF_BUTTONDOWN ) + { + lphc->wState &= ~CBF_BUTTONDOWN; + CBRepaintButton( lphc ); + } +} + +/*********************************************************************** + * COMBO_MouseMove + * + * Two things to do - track combo button and release capture when + * pointer goes into the listbox. + */ +static void COMBO_MouseMove( LPHEADCOMBO lphc, WPARAM wParam, LPARAM lParam ) +{ + POINT pt; + RECT lbRect; + + pt.x = (short)LOWORD(lParam); + pt.y = (short)HIWORD(lParam); + + if( lphc->wState & CBF_BUTTONDOWN ) + { + BOOL bButton; + + bButton = PtInRect(&lphc->buttonRect, pt); + + if( !bButton ) + { + lphc->wState &= ~CBF_BUTTONDOWN; + CBRepaintButton( lphc ); + } + } + + GetClientRect( lphc->hWndLBox, &lbRect ); + MapWindowPoints( lphc->self, lphc->hWndLBox, &pt, 1 ); + if( PtInRect(&lbRect, pt) ) + { + lphc->wState &= ~CBF_CAPTURE; + ReleaseCapture(); + if( CB_GETTYPE(lphc) == CBS_DROPDOWN ) CBUpdateLBox( lphc, TRUE ); + + /* hand over pointer tracking */ + SendMessageW(lphc->hWndLBox, WM_LBUTTONDOWN, wParam, lParam); + } +} + +static LRESULT COMBO_GetComboBoxInfo(const HEADCOMBO *lphc, COMBOBOXINFO *pcbi) +{ + if (!pcbi || (pcbi->cbSize < sizeof(COMBOBOXINFO))) + return FALSE; + + pcbi->rcItem = lphc->textRect; + pcbi->rcButton = lphc->buttonRect; + pcbi->stateButton = 0; + if (lphc->wState & CBF_BUTTONDOWN) + pcbi->stateButton |= STATE_SYSTEM_PRESSED; + if (IsRectEmpty(&lphc->buttonRect)) + pcbi->stateButton |= STATE_SYSTEM_INVISIBLE; + pcbi->hwndCombo = lphc->self; + pcbi->hwndItem = lphc->hWndEdit; + pcbi->hwndList = lphc->hWndLBox; + return TRUE; +} + +static LRESULT CALLBACK COMBO_WindowProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam ) +{ + HEADCOMBO *lphc = (HEADCOMBO *)GetWindowLongPtrW( hwnd, 0 ); + HTHEME theme; + + TRACE("[%p]: msg %#x wp %08lx lp %08lx\n", hwnd, message, wParam, lParam ); + + if (!IsWindow(hwnd)) return 0; + + if (lphc || message == WM_NCCREATE) + switch(message) + { + case WM_NCCREATE: + { + LONG style = ((CREATESTRUCTW *)lParam)->style; + return COMBO_NCCreate(hwnd, style); + } + + case WM_NCDESTROY: + COMBO_NCDestroy(lphc); + break;/* -> DefWindowProc */ + + case WM_CREATE: + { + HWND hwndParent; + LONG style; + + hwndParent = ((CREATESTRUCTW *)lParam)->hwndParent; + style = ((CREATESTRUCTW *)lParam)->style; + return COMBO_Create(hwnd, lphc, hwndParent, style); + } + + case WM_DESTROY: + theme = GetWindowTheme( hwnd ); + CloseThemeData( theme ); + break; + + case WM_THEMECHANGED: + theme = GetWindowTheme( hwnd ); + CloseThemeData( theme ); + OpenThemeData( hwnd, WC_COMBOBOXW ); + break; + + case WM_PRINTCLIENT: + case WM_PAINT: + { + LRESULT ret = 0; + PAINTSTRUCT ps; + HDC hdc; + + hdc = wParam ? (HDC)wParam : BeginPaint(hwnd, &ps); + + if (hdc && !(lphc->wState & CBF_NOREDRAW)) + { + HTHEME theme = GetWindowTheme(hwnd); + + if (theme) + ret = COMBO_ThemedPaint(theme, lphc, hdc); + else + ret = COMBO_Paint(lphc, hdc); + } + + if (!wParam) + EndPaint(hwnd, &ps); + + return ret; + } + case WM_ERASEBKGND: + /* do all painting in WM_PAINT like Windows does */ + return 1; + + case WM_GETDLGCODE: + { + LRESULT result = DLGC_WANTARROWS | DLGC_WANTCHARS; + if (lParam && (((LPMSG)lParam)->message == WM_KEYDOWN)) + { + int vk = (int)((LPMSG)lParam)->wParam; + + if ((vk == VK_RETURN || vk == VK_ESCAPE) && (lphc->wState & CBF_DROPPED)) + result |= DLGC_WANTMESSAGE; + } + return result; + } + + case WM_SIZE: + if (lphc->hWndLBox && !(lphc->wState & CBF_NORESIZE)) + COMBO_Size( lphc ); + return TRUE; + + case WM_SETFONT: + COMBO_Font( lphc, (HFONT)wParam, (BOOL)lParam ); + return TRUE; + + case WM_GETFONT: + return (LRESULT)lphc->hFont; + + case WM_SETFOCUS: + if (lphc->wState & CBF_EDIT) + { + SetFocus( lphc->hWndEdit ); + /* The first time focus is received, select all the text */ + if (!(lphc->wState & CBF_BEENFOCUSED)) + { + SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, -1); + lphc->wState |= CBF_BEENFOCUSED; + } + } + else + COMBO_SetFocus( lphc ); + return TRUE; + + case WM_KILLFOCUS: + { + HWND hwndFocus = (HWND)wParam; + if (!hwndFocus || (hwndFocus != lphc->hWndEdit && hwndFocus != lphc->hWndLBox)) + COMBO_KillFocus( lphc ); + return TRUE; + } + + case WM_COMMAND: + return COMBO_Command( lphc, wParam, (HWND)lParam ); + + case WM_GETTEXT: + return COMBO_GetText( lphc, wParam, (LPWSTR)lParam ); + + case WM_SETTEXT: + case WM_GETTEXTLENGTH: + case WM_CLEAR: + if ((message == WM_GETTEXTLENGTH) && !ISWIN31 && !(lphc->wState & CBF_EDIT)) + { + int j = SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0); + if (j == -1) return 0; + return SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, j, 0); + } + else if ( lphc->wState & CBF_EDIT ) + { + LRESULT ret; + lphc->wState |= CBF_NOEDITNOTIFY; + ret = SendMessageW(lphc->hWndEdit, message, wParam, lParam); + lphc->wState &= ~CBF_NOEDITNOTIFY; + return ret; + } + else + return CB_ERR; + + case WM_CUT: + case WM_PASTE: + case WM_COPY: + if (lphc->wState & CBF_EDIT) + return SendMessageW(lphc->hWndEdit, message, wParam, lParam); + else return CB_ERR; + + case WM_DRAWITEM: + case WM_DELETEITEM: + case WM_COMPAREITEM: + case WM_MEASUREITEM: + return COMBO_ItemOp(lphc, message, lParam); + + case WM_ENABLE: + if (lphc->wState & CBF_EDIT) + EnableWindow( lphc->hWndEdit, (BOOL)wParam ); + EnableWindow( lphc->hWndLBox, (BOOL)wParam ); + + /* Force the control to repaint when the enabled state changes. */ + InvalidateRect(lphc->self, NULL, TRUE); + return TRUE; + + case WM_SETREDRAW: + if (wParam) + lphc->wState &= ~CBF_NOREDRAW; + else + lphc->wState |= CBF_NOREDRAW; + + if ( lphc->wState & CBF_EDIT ) + SendMessageW(lphc->hWndEdit, message, wParam, lParam); + SendMessageW(lphc->hWndLBox, message, wParam, lParam); + return 0; + + case WM_SYSKEYDOWN: + if ( KEYDATA_ALT & HIWORD(lParam) ) + if( wParam == VK_UP || wParam == VK_DOWN ) + COMBO_FlipListbox( lphc, FALSE, FALSE ); + return 0; + + case WM_KEYDOWN: + if ((wParam == VK_RETURN || wParam == VK_ESCAPE) && + (lphc->wState & CBF_DROPPED)) + { + CBRollUp( lphc, wParam == VK_RETURN, FALSE ); + return TRUE; + } + else if ((wParam == VK_F4) && !(lphc->wState & CBF_EUI)) + { + COMBO_FlipListbox( lphc, FALSE, FALSE ); + return TRUE; + } + /* fall through */ + case WM_CHAR: + case WM_IME_CHAR: + { + HWND hwndTarget; + + if ( lphc->wState & CBF_EDIT ) + hwndTarget = lphc->hWndEdit; + else + hwndTarget = lphc->hWndLBox; + + return SendMessageW(hwndTarget, message, wParam, lParam); + } + + case WM_LBUTTONDOWN: + if ( !(lphc->wState & CBF_FOCUSED) ) SetFocus( lphc->self ); + if ( lphc->wState & CBF_FOCUSED ) COMBO_LButtonDown( lphc, lParam ); + return TRUE; + + case WM_LBUTTONUP: + COMBO_LButtonUp( lphc ); + return TRUE; + + case WM_MOUSEMOVE: + if (!IsRectEmpty(&lphc->buttonRect)) + { + POINT pt; + + pt.x = (short)LOWORD(lParam); + pt.y = (short)HIWORD(lParam); + + if (PtInRect(&lphc->buttonRect, pt)) + { + if (!(lphc->wState & CBF_HOT)) + { + lphc->wState |= CBF_HOT; + RedrawWindow(hwnd, &lphc->buttonRect, 0, RDW_INVALIDATE | RDW_UPDATENOW); + } + } + else if (lphc->wState & CBF_HOT) + { + lphc->wState &= ~CBF_HOT; + RedrawWindow(hwnd, &lphc->buttonRect, 0, RDW_INVALIDATE | RDW_UPDATENOW); + } + } + + if ( lphc->wState & CBF_CAPTURE ) + COMBO_MouseMove( lphc, wParam, lParam ); + return TRUE; + + case WM_MOUSEWHEEL: + if (wParam & (MK_SHIFT | MK_CONTROL)) + return DefWindowProcW(hwnd, message, wParam, lParam); + + if (GET_WHEEL_DELTA_WPARAM(wParam) > 0) return SendMessageW(hwnd, WM_KEYDOWN, VK_UP, 0); + if (GET_WHEEL_DELTA_WPARAM(wParam) < 0) return SendMessageW(hwnd, WM_KEYDOWN, VK_DOWN, 0); + return TRUE; + + /* Combo messages */ + case CB_ADDSTRING: + if (lphc->dwStyle & CBS_LOWERCASE) + CharLowerW((LPWSTR)lParam); + else if (lphc->dwStyle & CBS_UPPERCASE) + CharUpperW((LPWSTR)lParam); + return SendMessageW(lphc->hWndLBox, LB_ADDSTRING, 0, lParam); + + case CB_INSERTSTRING: + if (lphc->dwStyle & CBS_LOWERCASE) + CharLowerW((LPWSTR)lParam); + else if (lphc->dwStyle & CBS_UPPERCASE) + CharUpperW((LPWSTR)lParam); + return SendMessageW(lphc->hWndLBox, LB_INSERTSTRING, wParam, lParam); + + case CB_DELETESTRING: + return SendMessageW(lphc->hWndLBox, LB_DELETESTRING, wParam, 0); + + case CB_SELECTSTRING: + return COMBO_SelectString(lphc, (INT)wParam, lParam); + + case CB_FINDSTRING: + return SendMessageW(lphc->hWndLBox, LB_FINDSTRING, wParam, lParam); + + case CB_FINDSTRINGEXACT: + return SendMessageW(lphc->hWndLBox, LB_FINDSTRINGEXACT, wParam, lParam); + + case CB_SETITEMHEIGHT: + return COMBO_SetItemHeight( lphc, (INT)wParam, (INT)lParam); + + case CB_GETITEMHEIGHT: + if ((INT)wParam >= 0) /* listbox item */ + return SendMessageW(lphc->hWndLBox, LB_GETITEMHEIGHT, wParam, 0); + return CBGetTextAreaHeight(hwnd, lphc); + + case CB_RESETCONTENT: + SendMessageW(lphc->hWndLBox, LB_RESETCONTENT, 0, 0); + + if ((lphc->wState & CBF_EDIT) && CB_HASSTRINGS(lphc)) + { + static const WCHAR empty_stringW[] = { 0 }; + SendMessageW(lphc->hWndEdit, WM_SETTEXT, 0, (LPARAM)empty_stringW); + } + else + InvalidateRect(lphc->self, NULL, TRUE); + return TRUE; + + case CB_INITSTORAGE: + return SendMessageW(lphc->hWndLBox, LB_INITSTORAGE, wParam, lParam); + + case CB_GETHORIZONTALEXTENT: + return SendMessageW(lphc->hWndLBox, LB_GETHORIZONTALEXTENT, 0, 0); + + case CB_SETHORIZONTALEXTENT: + return SendMessageW(lphc->hWndLBox, LB_SETHORIZONTALEXTENT, wParam, 0); + + case CB_GETTOPINDEX: + return SendMessageW(lphc->hWndLBox, LB_GETTOPINDEX, 0, 0); + + case CB_GETLOCALE: + return SendMessageW(lphc->hWndLBox, LB_GETLOCALE, 0, 0); + + case CB_SETLOCALE: + return SendMessageW(lphc->hWndLBox, LB_SETLOCALE, wParam, 0); + + case CB_SETDROPPEDWIDTH: + if ((CB_GETTYPE(lphc) == CBS_SIMPLE) || (INT)wParam >= 32768) + return CB_ERR; + + /* new value must be higher than combobox width */ + if ((INT)wParam >= lphc->droppedRect.right - lphc->droppedRect.left) + lphc->droppedWidth = wParam; + else if (wParam) + lphc->droppedWidth = 0; + + /* recalculate the combobox area */ + CBCalcPlacement(hwnd, lphc, &lphc->textRect, &lphc->buttonRect, &lphc->droppedRect ); + + /* fall through */ + case CB_GETDROPPEDWIDTH: + if (lphc->droppedWidth) + return lphc->droppedWidth; + return lphc->droppedRect.right - lphc->droppedRect.left; + + case CB_GETDROPPEDCONTROLRECT: + if (lParam) + CBGetDroppedControlRect(lphc, (LPRECT)lParam ); + return CB_OKAY; + + case CB_GETDROPPEDSTATE: + return (lphc->wState & CBF_DROPPED) != 0; + + case CB_DIR: + return SendMessageW(lphc->hWndLBox, LB_DIR, wParam, lParam); + + case CB_SHOWDROPDOWN: + if (CB_GETTYPE(lphc) != CBS_SIMPLE) + { + if (wParam) + { + if (!(lphc->wState & CBF_DROPPED)) + CBDropDown( lphc ); + } + else if (lphc->wState & CBF_DROPPED) + CBRollUp( lphc, FALSE, TRUE ); + } + return TRUE; + + case CB_GETCOUNT: + return SendMessageW(lphc->hWndLBox, LB_GETCOUNT, 0, 0); + + case CB_GETCURSEL: + return SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0); + + case CB_SETCURSEL: + lParam = SendMessageW(lphc->hWndLBox, LB_SETCURSEL, wParam, 0); + if (lParam >= 0) + SendMessageW(lphc->hWndLBox, LB_SETTOPINDEX, wParam, 0); + + /* no LBN_SELCHANGE in this case, update manually */ + CBPaintText(lphc, NULL); + lphc->wState &= ~CBF_SELCHANGE; + return lParam; + + case CB_GETLBTEXT: + return SendMessageW(lphc->hWndLBox, LB_GETTEXT, wParam, lParam); + + case CB_GETLBTEXTLEN: + return SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, wParam, 0); + + case CB_GETITEMDATA: + return SendMessageW(lphc->hWndLBox, LB_GETITEMDATA, wParam, 0); + + case CB_SETITEMDATA: + return SendMessageW(lphc->hWndLBox, LB_SETITEMDATA, wParam, lParam); + + case CB_GETEDITSEL: + /* Edit checks passed parameters itself */ + if (lphc->wState & CBF_EDIT) + return SendMessageW(lphc->hWndEdit, EM_GETSEL, wParam, lParam); + return CB_ERR; + + case CB_SETEDITSEL: + if (lphc->wState & CBF_EDIT) + return SendMessageW(lphc->hWndEdit, EM_SETSEL, (INT)(SHORT)LOWORD(lParam), (INT)(SHORT)HIWORD(lParam) ); + return CB_ERR; + + case CB_SETEXTENDEDUI: + if (CB_GETTYPE(lphc) == CBS_SIMPLE ) + return CB_ERR; + if (wParam) + lphc->wState |= CBF_EUI; + else + lphc->wState &= ~CBF_EUI; + return CB_OKAY; + + case CB_GETEXTENDEDUI: + return (lphc->wState & CBF_EUI) != 0; + + case CB_GETCOMBOBOXINFO: + return COMBO_GetComboBoxInfo(lphc, (COMBOBOXINFO *)lParam); + + case CB_LIMITTEXT: + if (lphc->wState & CBF_EDIT) + return SendMessageW(lphc->hWndEdit, EM_LIMITTEXT, wParam, lParam); + return TRUE; + + default: + if (message >= WM_USER) + WARN("unknown msg WM_USER+%04x wp=%04lx lp=%08lx\n", message - WM_USER, wParam, lParam ); + break; + } + + return DefWindowProcW(hwnd, message, wParam, lParam); +} + +void COMBO_Register(void) +{ + WNDCLASSW wndClass; + + memset(&wndClass, 0, sizeof(wndClass)); + wndClass.style = CS_PARENTDC | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS; + wndClass.lpfnWndProc = COMBO_WindowProc; + wndClass.cbClsExtra = 0; + wndClass.cbWndExtra = sizeof(HEADCOMBO *); + wndClass.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW); + wndClass.hbrBackground = NULL; + wndClass.lpszClassName = WC_COMBOBOXW; + RegisterClassW(&wndClass); +} diff --git a/dll/win32/comctl32/comboex.c b/dll/win32/comctl32/comboex.c index 68709f018e..3c3714ac56 100644 --- a/dll/win32/comctl32/comboex.c +++ b/dll/win32/comctl32/comboex.c @@ -18,19 +18,19 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - * NOTE - * ... 11900 lines suppressed ...
6 years, 8 months
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
25
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Results per page:
10
25
50
100
200