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
January 2020
----- 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
21 participants
133 discussions
Start a n
N
ew thread
[reactos] 01/01: [DNSRSLVR] R_ResolverFlushCache should only flush cached records which were not read from the hosts file
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=17f932d78e98f2686cc61…
commit 17f932d78e98f2686cc61acdf200f48d03f7edf9 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Mon Jan 6 00:45:41 2020 +0100 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Mon Jan 6 00:46:37 2020 +0100 [DNSRSLVR] R_ResolverFlushCache should only flush cached records which were not read from the hosts file --- base/services/dnsrslvr/cache.c | 29 ++++++++++++++++++++--------- base/services/dnsrslvr/hostsfile.c | 12 ++++++------ base/services/dnsrslvr/precomp.h | 20 +++++++++++++++++--- base/services/dnsrslvr/rpcserver.c | 9 ++++----- 4 files changed, 47 insertions(+), 23 deletions(-) diff --git a/base/services/dnsrslvr/cache.c b/base/services/dnsrslvr/cache.c index af4cc2a8597..e61cc8695a7 100644 --- a/base/services/dnsrslvr/cache.c +++ b/base/services/dnsrslvr/cache.c @@ -44,7 +44,7 @@ DnsIntCacheFree(VOID) if (!DnsCache.RecordList.Flink) return; - DnsIntCacheFlush(); + DnsIntCacheFlush(CACHE_FLUSH_ALL); DeleteCriticalSection(&DnsCache.Lock); DnsCacheInitialized = FALSE; @@ -65,13 +65,14 @@ DnsIntCacheRemoveEntryItem(PRESOLVER_CACHE_ENTRY CacheEntry) HeapFree(GetProcessHeap(), 0, CacheEntry); } -VOID -DnsIntCacheFlush(VOID) +DNS_STATUS +DnsIntCacheFlush( + _In_ ULONG ulFlags) { - PLIST_ENTRY Entry; + PLIST_ENTRY Entry, NextEntry; PRESOLVER_CACHE_ENTRY CacheEntry; - DPRINT("DnsIntCacheFlush()\n"); + DPRINT("DnsIntCacheFlush(%lu)\n", ulFlags); /* Lock the cache */ DnsCacheLock(); @@ -80,18 +81,24 @@ DnsIntCacheFlush(VOID) Entry = DnsCache.RecordList.Flink; while (Entry != &DnsCache.RecordList) { + NextEntry = Entry->Flink; + /* Get this entry */ CacheEntry = CONTAINING_RECORD(Entry, RESOLVER_CACHE_ENTRY, CacheLink); /* Remove it from list */ - DnsIntCacheRemoveEntryItem(CacheEntry); + if (((ulFlags & CACHE_FLUSH_HOSTS_FILE_ENTRIES) && (CacheEntry->bHostsFileEntry != FALSE)) || + ((ulFlags & CACHE_FLUSH_NON_HOSTS_FILE_ENTRIES) && (CacheEntry->bHostsFileEntry == FALSE))) + DnsIntCacheRemoveEntryItem(CacheEntry); /* Move to the next entry */ - Entry = DnsCache.RecordList.Flink; + Entry = NextEntry; } /* Unlock the cache */ DnsCacheUnlock(); + + return ERROR_SUCCESS; } DNS_STATUS @@ -178,11 +185,14 @@ DnsIntCacheRemoveEntryByName(LPCWSTR Name) } VOID -DnsIntCacheAddEntry(PDNS_RECORDW Record) +DnsIntCacheAddEntry( + _In_ PDNS_RECORDW Record, + _In_ BOOL bHostsFileEntry) { PRESOLVER_CACHE_ENTRY Entry; - DPRINT("DnsIntCacheAddEntry(%p)\n", Record); + DPRINT("DnsIntCacheAddEntry(%p %u)\n", + Record, bHostsFileEntry); DPRINT("Name: %S\n", Record->pName); DPRINT("TTL: %lu\n", Record->dwTtl); @@ -195,6 +205,7 @@ DnsIntCacheAddEntry(PDNS_RECORDW Record) if (!Entry) return; + Entry->bHostsFileEntry = bHostsFileEntry; Entry->Record = DnsRecordSetCopyEx(Record, DnsCharSetUnicode, DnsCharSetUnicode); /* Insert it to our List */ diff --git a/base/services/dnsrslvr/hostsfile.c b/base/services/dnsrslvr/hostsfile.c index 1c80dc0cffb..62554b91aa2 100644 --- a/base/services/dnsrslvr/hostsfile.c +++ b/base/services/dnsrslvr/hostsfile.c @@ -113,7 +113,7 @@ AddIpv4HostEntries( /* Prepare the PTR record */ swprintf(szReverseName, - L"%u.%u.%u.%u.in-addr.arpa", + L"%u.%u.%u.%u.in-addr.arpa.", pAddress->S_un.S_un_b.s_b4, pAddress->S_un.S_un_b.s_b3, pAddress->S_un.S_un_b.s_b2, @@ -130,8 +130,8 @@ AddIpv4HostEntries( PtrRecord.Data.PTR.pNameHost = pszHostName; - DnsIntCacheAddEntry(&ARecord); - DnsIntCacheAddEntry(&PtrRecord); + DnsIntCacheAddEntry(&ARecord, TRUE); + DnsIntCacheAddEntry(&PtrRecord, TRUE); } @@ -171,7 +171,7 @@ AddIpv6HostEntries( szReverseName[j + 2] = szHexChar[(pAddress->u.Byte[k] >> 4) & 0xF]; szReverseName[j + 3] = L'.'; } - wcscat(szReverseName, L"ip6.arpa"); + wcscat(szReverseName, L"ip6.arpa."); ZeroMemory(&PtrRecord, sizeof(DNS_RECORDW)); @@ -184,8 +184,8 @@ AddIpv6HostEntries( PtrRecord.Data.PTR.pNameHost = pszHostName; - DnsIntCacheAddEntry(&AAAARecord); - DnsIntCacheAddEntry(&PtrRecord); + DnsIntCacheAddEntry(&AAAARecord, TRUE); + DnsIntCacheAddEntry(&PtrRecord, TRUE); } diff --git a/base/services/dnsrslvr/precomp.h b/base/services/dnsrslvr/precomp.h index 81189cda9e6..2b7e5f35dd6 100644 --- a/base/services/dnsrslvr/precomp.h +++ b/base/services/dnsrslvr/precomp.h @@ -27,6 +27,7 @@ typedef struct _RESOLVER_CACHE_ENTRY { LIST_ENTRY CacheLink; + BOOL bHostsFileEntry; PDNS_RECORDW Record; } RESOLVER_CACHE_ENTRY, *PRESOLVER_CACHE_ENTRY; @@ -42,7 +43,14 @@ typedef struct _RESOLVER_CACHE VOID DnsIntCacheInitialize(VOID); VOID DnsIntCacheRemoveEntryItem(PRESOLVER_CACHE_ENTRY CacheEntry); VOID DnsIntCacheFree(VOID); -VOID DnsIntCacheFlush(VOID); + +#define CACHE_FLUSH_HOSTS_FILE_ENTRIES 0x00000001 +#define CACHE_FLUSH_NON_HOSTS_FILE_ENTRIES 0x00000002 +#define CACHE_FLUSH_ALL 0x00000003 + +DNS_STATUS +DnsIntCacheFlush( + _In_ ULONG ulFlags); DNS_STATUS DnsIntCacheGetEntryByName( @@ -51,8 +59,14 @@ DnsIntCacheGetEntryByName( DWORD dwFlags, PDNS_RECORDW *Record); -VOID DnsIntCacheAddEntry(PDNS_RECORDW Record); -BOOL DnsIntCacheRemoveEntryByName(LPCWSTR Name); +VOID +DnsIntCacheAddEntry( + _In_ PDNS_RECORDW Record, + _In_ BOOL bHostsFileEntry); + +BOOL +DnsIntCacheRemoveEntryByName( + _In_ LPCWSTR Name); DNS_STATUS DnsIntCacheGetEntries( diff --git a/base/services/dnsrslvr/rpcserver.c b/base/services/dnsrslvr/rpcserver.c index f79850ddb06..59e91cb4791 100644 --- a/base/services/dnsrslvr/rpcserver.c +++ b/base/services/dnsrslvr/rpcserver.c @@ -62,11 +62,10 @@ __stdcall R_ResolverFlushCache( _In_ DNSRSLVR_HANDLE pwszServerName) { - DPRINT("R_ResolverFlushCache()\n"); + DPRINT("R_ResolverFlushCache(%S)\n", + pwszServerName); - // FIXME Should store (and flush) entries by server handle - DnsIntCacheFlush(); - return ERROR_SUCCESS; + return DnsIntCacheFlush(CACHE_FLUSH_NON_HOSTS_FILE_ENTRIES); } @@ -126,7 +125,7 @@ R_ResolverQuery( if (Status == ERROR_SUCCESS) { DPRINT("DNS query successful!\n"); - DnsIntCacheAddEntry(*ppResultRecords); + DnsIntCacheAddEntry(*ppResultRecords, FALSE); } } }
4 years, 11 months
1
0
0
0
[reactos] 01/01: [WININET_WINETEST] http: Remove ROSTESTS_73_FIXED workaround
by Serge Gautherie
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=df84f41298c926bc91a9d…
commit df84f41298c926bc91a9d1711946904dff83afc0 Author: Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr> AuthorDate: Thu Jan 2 03:42:07 2020 +0100 Commit: Victor Perevertkin <victor(a)perevertkin.ru> CommitDate: Sun Jan 5 22:36:47 2020 +0200 [WININET_WINETEST] http: Remove ROSTESTS_73_FIXED workaround ROSTESTS-73 --- modules/rostests/winetests/wininet/http.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/rostests/winetests/wininet/http.c b/modules/rostests/winetests/wininet/http.c index de34a37cd6b..7b7ccd265ad 100644 --- a/modules/rostests/winetests/wininet/http.c +++ b/modules/rostests/winetests/wininet/http.c @@ -3753,11 +3753,7 @@ static void test_conn_close(int port) SET_EXPECT(INTERNET_STATUS_CONNECTION_CLOSED); SET_EXPECT(INTERNET_STATUS_REQUEST_COMPLETE); SetEvent(conn_close_event); -#ifdef ROSTESTS_73_FIXED WaitForSingleObject(complete_event, INFINITE); -#else /* ROSTESTS_73_FIXED */ - ok(WaitForSingleObject(complete_event, 5000) == WAIT_OBJECT_0, "Wait timed out\n"); -#endif /* ROSTESTS_73_FIXED */ ok(req_error == ERROR_SUCCESS, "req_error = %u\n", req_error); CLEAR_NOTIFIED(INTERNET_STATUS_RESPONSE_RECEIVED); CHECK_NOTIFIED(INTERNET_STATUS_CLOSING_CONNECTION);
4 years, 11 months
1
0
0
0
[reactos] 01/01: [TIMEDATE] Update the clock on WM_TIMECHANGE
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6ad4f9e7bbab0effbdb18…
commit 6ad4f9e7bbab0effbdb18423f842dc6ab1d1dc12 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sun Jan 5 12:21:53 2020 +0100 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sun Jan 5 12:21:53 2020 +0100 [TIMEDATE] Update the clock on WM_TIMECHANGE --- dll/cpl/timedate/clock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dll/cpl/timedate/clock.c b/dll/cpl/timedate/clock.c index ebf9e8df2d2..3fb30f6d8b8 100644 --- a/dll/cpl/timedate/clock.c +++ b/dll/cpl/timedate/clock.c @@ -163,6 +163,7 @@ ClockWndProc(HWND hwnd, pClockData->cyClient = HIWORD(lParam); break; + case WM_TIMECHANGE: case WM_TIMER: GetLocalTime(&pClockData->stCurrent); InvalidateRect(hwnd, NULL, FALSE);
4 years, 11 months
1
0
0
0
[reactos] 01/01: [SYSDM] Improve the user profile dialog
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ba783adf1e2456745e6e4…
commit ba783adf1e2456745e6e483ac3ae04cd0e3f0c0b Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sat Jan 4 14:54:30 2020 +0100 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sat Jan 4 14:54:30 2020 +0100 [SYSDM] Improve the user profile dialog - Currently used profiles cannot be copied or deleted. - Unknown profiles cannot be copied. - A double click on a profile opens the change profile type dialog. --- dll/cpl/sysdm/userprofile.c | 62 ++++++++++++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 21 deletions(-) diff --git a/dll/cpl/sysdm/userprofile.c b/dll/cpl/sysdm/userprofile.c index bd2ac0fe80d..faef5431970 100644 --- a/dll/cpl/sysdm/userprofile.c +++ b/dll/cpl/sysdm/userprofile.c @@ -18,6 +18,7 @@ typedef struct _PROFILEDATA { DWORD dwRefCount; DWORD dwState; + BOOL bUnknownProfile; PWSTR pszFullName; PWSTR pszProfilePath; } PROFILEDATA, *PPROFILEDATA; @@ -391,7 +392,8 @@ BOOL GetProfileName( _In_ PSID pProfileSid, _In_ DWORD dwNameBufferSize, - _Out_ PWSTR pszNameBuffer) + _Out_ PWSTR pszNameBuffer, + _Out_ PBOOL pbUnknownProfile) { WCHAR szAccountName[128], szDomainName[128]; DWORD dwAccountNameSize, dwDomainNameSize; @@ -409,6 +411,7 @@ GetProfileName( { /* Unknown account */ LoadStringW(hApplet, IDS_USERPROFILE_ACCOUNT_UNKNOWN, pszNameBuffer, dwNameBufferSize); + *pbUnknownProfile = TRUE; } else { @@ -426,6 +429,7 @@ GetProfileName( /* Normal account */ wsprintf(pszNameBuffer, L"%s\\%s", szDomainName, szAccountName); } + *pbUnknownProfile = FALSE; } return TRUE; @@ -479,6 +483,7 @@ AddUserProfile( HANDLE hFile; SYSTEMTIME SystemTime; ULONGLONG ullProfileSize; + BOOL bUnknownProfile; DWORD dwError; /* Get the profile path */ @@ -521,7 +526,10 @@ AddUserProfile( GetProfileSize(szProfilePath, &ullProfileSize); /* Get the profile name */ - if (!GetProfileName(pProfileSid, ARRAYSIZE(szNameBuffer), szNameBuffer)) + if (!GetProfileName(pProfileSid, + ARRAYSIZE(szNameBuffer), + szNameBuffer, + &bUnknownProfile)) return; /* Get the profile state value */ @@ -560,6 +568,7 @@ AddUserProfile( pProfileData->dwRefCount = dwRefCount; pProfileData->dwState = dwState; + pProfileData->bUnknownProfile = bUnknownProfile; ptr = (PWSTR)((ULONG_PTR)pProfileData + sizeof(PROFILEDATA)); pProfileData->pszFullName = ptr; @@ -629,29 +638,37 @@ UpdateButtonState( BOOL bChange = FALSE; BOOL bCopy = FALSE; BOOL bDelete = FALSE; + PPROFILEDATA pProfileData; - iSelected = ListView_GetNextItem(hwndListView, -1, LVNI_SELECTED); - if (iSelected != -1) + if (ListView_GetSelectedCount(hwndListView) != 0) { - Item.mask = LVIF_PARAM; - Item.iItem = iSelected; - Item.iSubItem = 0; - if (ListView_GetItem(hwndListView, &Item)) + iSelected = ListView_GetNextItem(hwndListView, -1, LVNI_SELECTED); + if (iSelected != -1) { - if (Item.lParam != 0) + Item.mask = LVIF_PARAM; + Item.iItem = iSelected; + Item.iSubItem = 0; + if (ListView_GetItem(hwndListView, &Item)) { - bCopy = (((PPROFILEDATA)Item.lParam)->dwRefCount == 0); - bDelete = (((PPROFILEDATA)Item.lParam)->dwRefCount == 0); + if (Item.lParam != 0) + { + pProfileData = (PPROFILEDATA)Item.lParam; + + if (pProfileData->bUnknownProfile) + { + bDelete = TRUE; + bCopy = FALSE; + } + else + { + bDelete = (pProfileData->dwRefCount == 0); + bCopy = (pProfileData->dwRefCount == 0); + } + } } - } - bChange = TRUE; - } - else - { - bChange = FALSE; - bCopy = FALSE; - bDelete = FALSE; + bChange = TRUE; + } } EnableWindow(GetDlgItem(hwndDlg, IDC_USERPROFILE_CHANGE), bChange); @@ -823,9 +840,12 @@ OnNotify( { ShellExecuteW(hwndDlg, NULL, L"usrmgr.cpl", NULL, NULL, 0); } - else if (nmhdr->idFrom == IDC_USERPROFILE_LIST && nmhdr->code == LVN_ITEMCHANGED) + else if (nmhdr->idFrom == IDC_USERPROFILE_LIST) { - UpdateButtonState(hwndDlg, nmhdr->hwndFrom); + if (nmhdr->code == LVN_ITEMCHANGED) + UpdateButtonState(hwndDlg, nmhdr->hwndFrom); + else if (nmhdr->code == NM_DBLCLK) + ChangeUserProfileType(hwndDlg); } }
4 years, 11 months
1
0
0
0
[reactos] 03/03: [PSDK] Support STRICT_TYPED_ITEMIDS in shdeprecated.idl. CORE-16385
by Suraj K Suresh
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fbc14d52cd17f38b17809…
commit fbc14d52cd17f38b178093ef2e0e7439fa76d208 Author: Suraj K Suresh <kssuraj15(a)gmail.com> AuthorDate: Wed Dec 25 00:24:51 2019 +0530 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Fri Jan 3 22:42:35 2020 +0100 [PSDK] Support STRICT_TYPED_ITEMIDS in shdeprecated.idl. CORE-16385 --- dll/win32/shell32/wine/shellord.c | 2 +- sdk/include/psdk/shdeprecated.idl | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dll/win32/shell32/wine/shellord.c b/dll/win32/shell32/wine/shellord.c index 51231c6afc7..a8bdab0e62c 100644 --- a/dll/win32/shell32/wine/shellord.c +++ b/dll/win32/shell32/wine/shellord.c @@ -743,7 +743,7 @@ void WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv) if (SUCCEEDED(SHGetSpecialFolderLocation(hwnd, CSIDL_RECENT, &pidl))) { SHGetPathFromIDListA(pidl, link_dir); - IMalloc_Free(ppM,pidl); + IMalloc_Free(ppM, pidl); } else { /* serious issues */ diff --git a/sdk/include/psdk/shdeprecated.idl b/sdk/include/psdk/shdeprecated.idl index 7e2e38949ed..edcde04a8ad 100644 --- a/sdk/include/psdk/shdeprecated.idl +++ b/sdk/include/psdk/shdeprecated.idl @@ -50,7 +50,7 @@ interface ITravelEntry : IUnknown [in] BOOL fIsLocalAnchor); HRESULT GetPidl( - [out] LPITEMIDLIST *ppidl); + [out] PIDLIST_ABSOLUTE *ppidl); }; [ @@ -84,7 +84,7 @@ interface ITravelLog : IUnknown HRESULT FindTravelEntry( [in] IUnknown *punk, - [in] LPCITEMIDLIST pidl, + [in] PCIDLIST_ABSOLUTE pidl, [out] ITravelEntry **ppte); HRESULT GetToolTipText( @@ -343,17 +343,17 @@ typedef struct basebrowserdataxp DWORD _fCreatingViewWindow; UINT _uActivateState; - LPCITEMIDLIST _pidlNewShellView; + PCIDLIST_ABSOLUTE _pidlNewShellView; IOleCommandTarget *_pctView; - LPITEMIDLIST _pidlCur; + PIDLIST_ABSOLUTE _pidlCur; IShellView *_psv; IShellFolder *_psf; HWND _hwndView; LPWSTR _pszTitleCur; - LPITEMIDLIST _pidlPending; + PIDLIST_ABSOLUTE _pidlPending; IShellView *_psvPending; IShellFolder *_psfPending; HWND _hwndViewPending; @@ -378,17 +378,17 @@ typedef struct basebrowserdatalh DWORD _fCreatingViewWindow; UINT _uActivateState; - LPCITEMIDLIST _pidlNewShellView; + PCIDLIST_ABSOLUTE _pidlNewShellView; IOleCommandTarget *_pctView; - LPITEMIDLIST _pidlCur; + PIDLIST_ABSOLUTE _pidlCur; IShellView *_psv; IShellFolder *_psf; HWND _hwndView; LPWSTR _pszTitleCur; - LPITEMIDLIST _pidlPending; + PIDLIST_ABSOLUTE _pidlPending; IShellView *_psvPending; IShellFolder *_psfPending; HWND _hwndViewPending; @@ -535,13 +535,13 @@ interface IBrowserService2 : IBrowserService HRESULT _DisableModeless(); HRESULT _NavigateToPidl( - [in] LPCITEMIDLIST pidl, + [in] PCIDLIST_ABSOLUTE pidl, [in] DWORD grfHLNF, [in] DWORD dwFlags); HRESULT _TryShell2Rename( [in] IShellView *psv, - [in] LPCITEMIDLIST pidlNew); + [in] PCIDLIST_ABSOLUTE pidlNew); HRESULT _SwitchActivationNow(); @@ -593,7 +593,7 @@ interface IBrowserService2 : IBrowserService [in] HMONITOR hmon); IStream* v_GetViewStream( - [in] LPCITEMIDLIST pidl, + [in] PCIDLIST_ABSOLUTE pidl, [in] DWORD grfMode, [in] LPCWSTR pwszName); @@ -647,7 +647,7 @@ interface IBrowserService2 : IBrowserService [in] BOOL bUseHmonitor); HRESULT v_CheckZoneCrossing( - [in, out] LPCITEMIDLIST pidl); + [in, out] PCIDLIST_ABSOLUTE pidl); }; [ @@ -666,7 +666,7 @@ interface IBrowserService3 : IBrowserService2 [in] UINT uiCP, [in] LPCWSTR pwszPath, [in] DWORD dwFlags, - [out] LPITEMIDLIST *ppidlOut); + [out] PIDLIST_ABSOLUTE *ppidlOut); }; [
4 years, 11 months
1
0
0
0
[reactos] 02/03: [PSDK] Support STRICT_TYPED_ITEMIDS in shlwapi.h. CORE-16385
by Suraj K Suresh
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d7f224dce35923463a794…
commit d7f224dce35923463a7946b752a9a1bd79478073 Author: Suraj K Suresh <kssuraj15(a)gmail.com> AuthorDate: Tue Dec 24 21:18:43 2019 +0530 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Fri Jan 3 22:42:35 2020 +0100 [PSDK] Support STRICT_TYPED_ITEMIDS in shlwapi.h. CORE-16385 --- sdk/include/psdk/shlwapi.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/include/psdk/shlwapi.h b/sdk/include/psdk/shlwapi.h index 4782f64b43e..40fefc512b4 100644 --- a/sdk/include/psdk/shlwapi.h +++ b/sdk/include/psdk/shlwapi.h @@ -1738,14 +1738,14 @@ HRESULT WINAPI StrRetToStrA( _Inout_ STRRET*, - _In_opt_ LPCITEMIDLIST, + _In_opt_ PCUITEMID_CHILD, _Outptr_ LPSTR*); HRESULT WINAPI StrRetToStrW( _Inout_ STRRET*, - _In_opt_ LPCITEMIDLIST, + _In_opt_ PCUITEMID_CHILD, _Outptr_ LPWSTR*); #define StrRetToStr WINELIB_NAME_AW(StrRetToStr) @@ -1754,7 +1754,7 @@ HRESULT WINAPI StrRetToBufA( _Inout_ STRRET*, - _In_opt_ LPCITEMIDLIST, + _In_opt_ PCUITEMID_CHILD, _Out_writes_(cchBuf) LPSTR, UINT cchBuf); @@ -1762,7 +1762,7 @@ HRESULT WINAPI StrRetToBufW( _Inout_ STRRET*, - _In_opt_ LPCITEMIDLIST, + _In_opt_ PCUITEMID_CHILD, _Out_writes_(cchBuf) LPWSTR, UINT cchBuf); @@ -1772,7 +1772,7 @@ HRESULT WINAPI StrRetToBSTR( _Inout_ STRRET*, - _In_opt_ LPCITEMIDLIST, + _In_opt_ PCUITEMID_CHILD, _Outptr_ BSTR*); BOOL WINAPI IsCharSpaceA(CHAR); @@ -2002,7 +2002,7 @@ HRESULT WINAPI DllInstall(BOOL, _In_opt_ LPCWSTR) DECLSPEC_HIDDEN; HRESULT WINAPI SHGetViewStatePropertyBag( - _In_opt_ LPCITEMIDLIST pidl, + _In_opt_ PCIDLIST_ABSOLUTE pidl, _In_opt_ LPWSTR bag_name, DWORD flags, _In_ REFIID riid,
4 years, 11 months
1
0
0
0
[reactos] 01/03: [PSDK] Support STRICT_TYPED_ITEMIDS in shlobj.h. CORE-16385
by Suraj K Suresh
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ecb3ee54275f6b47d8665…
commit ecb3ee54275f6b47d8665dfb311af4bb0cb12ca8 Author: Suraj K Suresh <kssuraj15(a)gmail.com> AuthorDate: Mon Dec 23 14:21:51 2019 +0530 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Fri Jan 3 22:42:34 2020 +0100 [PSDK] Support STRICT_TYPED_ITEMIDS in shlobj.h. CORE-16385 --- dll/win32/shell32/CShellItem.cpp | 8 +- dll/win32/shell32/wine/pidl.c | 4 +- dll/win32/shell32/wine/shellord.c | 6 +- sdk/include/psdk/shlobj.h | 216 +++++++++++++++++++------------------- sdk/include/psdk/shobjidl.idl | 32 +++--- 5 files changed, 133 insertions(+), 133 deletions(-) diff --git a/dll/win32/shell32/CShellItem.cpp b/dll/win32/shell32/CShellItem.cpp index f60da93a3f5..b95eb4cf0f8 100644 --- a/dll/win32/shell32/CShellItem.cpp +++ b/dll/win32/shell32/CShellItem.cpp @@ -24,8 +24,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); -EXTERN_C HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent, - IShellFolder *psfParent, LPCITEMIDLIST pidl, IShellItem **ppsi); +EXTERN_C HRESULT WINAPI SHCreateShellItem(PCIDLIST_ABSOLUTE pidlParent, + IShellFolder *psfParent, PCUITEMID_CHILD pidl, IShellItem **ppsi); CShellItem::CShellItem() : m_pidl(NULL) @@ -261,8 +261,8 @@ HRESULT WINAPI CShellItem::GetIDList(PIDLIST_ABSOLUTE *ppidl) return E_OUTOFMEMORY; } -HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent, - IShellFolder *psfParent, LPCITEMIDLIST pidl, IShellItem **ppsi) +HRESULT WINAPI SHCreateShellItem(PCIDLIST_ABSOLUTE pidlParent, + IShellFolder *psfParent, PCUITEMID_CHILD pidl, IShellItem **ppsi) { HRESULT hr; CComPtr<IShellItem> newShellItem; diff --git a/dll/win32/shell32/wine/pidl.c b/dll/win32/shell32/wine/pidl.c index 4f917e16296..cfe204aa5e8 100644 --- a/dll/win32/shell32/wine/pidl.c +++ b/dll/win32/shell32/wine/pidl.c @@ -638,7 +638,7 @@ BOOL WINAPI ILIsParent(LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild, BOOL b * NOTES * exported by ordinal. */ -LPITEMIDLIST WINAPI ILFindChild(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) +PUIDLIST_RELATIVE WINAPI ILFindChild(PIDLIST_ABSOLUTE pidl1, PCIDLIST_ABSOLUTE pidl2) { LPCITEMIDLIST pidltemp1 = pidl1; LPCITEMIDLIST pidltemp2 = pidl2; @@ -674,7 +674,7 @@ LPITEMIDLIST WINAPI ILFindChild(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) ret = NULL; /* elements of pidl1 left*/ } TRACE_(shell)("--- %p\n", ret); - return (LPITEMIDLIST)ret; /* pidl 1 is shorter */ + return (PUIDLIST_RELATIVE)ret; /* pidl 1 is shorter */ } /************************************************************************* diff --git a/dll/win32/shell32/wine/shellord.c b/dll/win32/shell32/wine/shellord.c index 71f35e4d866..51231c6afc7 100644 --- a/dll/win32/shell32/wine/shellord.c +++ b/dll/win32/shell32/wine/shellord.c @@ -743,7 +743,7 @@ void WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv) if (SUCCEEDED(SHGetSpecialFolderLocation(hwnd, CSIDL_RECENT, &pidl))) { SHGetPathFromIDListA(pidl, link_dir); - IMalloc_Free(ppM, pidl); + IMalloc_Free(ppM,pidl); } else { /* serious issues */ @@ -1824,7 +1824,7 @@ HRESULT WINAPI SHCreateStdEnumFmtEtc( /************************************************************************* * SHFindFiles (SHELL32.90) */ -BOOL WINAPI SHFindFiles( LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile ) +BOOL WINAPI SHFindFiles( PCIDLIST_ABSOLUTE pidlFolder, PCIDLIST_ABSOLUTE pidlSaveFile ) { FIXME("params ignored: %p %p\n", pidlFolder, pidlSaveFile); if (SHRestricted(REST_NOFIND)) @@ -1870,7 +1870,7 @@ VOID WINAPI SHUpdateImageA(LPCSTR pszHashItem, INT iIndex, UINT uFlags, INT iIma FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_a(pszHashItem), iIndex, uFlags, iImageIndex); } -INT WINAPI SHHandleUpdateImage(LPCITEMIDLIST pidlExtra) +INT WINAPI SHHandleUpdateImage(PCIDLIST_ABSOLUTE pidlExtra) { FIXME("%p - stub\n", pidlExtra); diff --git a/sdk/include/psdk/shlobj.h b/sdk/include/psdk/shlobj.h index f287ded6412..a425b21bc79 100644 --- a/sdk/include/psdk/shlobj.h +++ b/sdk/include/psdk/shlobj.h @@ -135,9 +135,9 @@ HRESULT WINAPI SHCreateQueryCancelAutoPlayMoniker(IMoniker**); HRESULT WINAPI SHCreateShellItem( - _In_opt_ LPCITEMIDLIST, + _In_opt_ PCIDLIST_ABSOLUTE, _In_opt_ IShellFolder*, - _In_ LPCITEMIDLIST, + _In_ PCUITEMID_CHILD, _Outptr_ IShellItem**); DWORD WINAPI SHCLSIDFromStringA(_In_ LPCSTR, _Out_ CLSID*); @@ -152,7 +152,7 @@ SHCreateStdEnumFmtEtc( _Outptr_ IEnumFORMATETC**); void WINAPI SHDestroyPropSheetExtArray(_In_ HPSXA); -BOOL WINAPI SHFindFiles(_In_opt_ LPCITEMIDLIST, _In_opt_ LPCITEMIDLIST); +BOOL WINAPI SHFindFiles(_In_opt_ PCIDLIST_ABSOLUTE, _In_opt_ PCIDLIST_ABSOLUTE); DWORD WINAPI SHFormatDrive(_In_ HWND, UINT, UINT, UINT); void WINAPI SHFree(_In_opt_ LPVOID); @@ -196,25 +196,25 @@ _Success_(return != 0) BOOL WINAPI SHGetPathFromIDListA( - _In_ LPCITEMIDLIST, + _In_ PCIDLIST_ABSOLUTE, _Out_writes_(MAX_PATH) LPSTR); _Success_(return != 0) BOOL WINAPI SHGetPathFromIDListW( - _In_ LPCITEMIDLIST, + _In_ PCIDLIST_ABSOLUTE, _Out_writes_(MAX_PATH) LPWSTR); #define SHGetPathFromIDList WINELIB_NAME_AW(SHGetPathFromIDList) -INT WINAPI SHHandleUpdateImage(_In_ LPCITEMIDLIST); +INT WINAPI SHHandleUpdateImage(_In_ PCIDLIST_ABSOLUTE); HRESULT WINAPI SHILCreateFromPath( - _In_ LPCWSTR, - _Outptr_ LPITEMIDLIST*, + _In_ PCWSTR, + _Outptr_ PIDLIST_ABSOLUTE*, _Inout_opt_ DWORD*); HRESULT WINAPI SHLoadOLE(LPARAM); @@ -222,9 +222,9 @@ HRESULT WINAPI SHLoadOLE(LPARAM); HRESULT WINAPI SHParseDisplayName( - _In_ LPCWSTR, + _In_ PCWSTR, _In_opt_ IBindCtx*, - _Outptr_ LPITEMIDLIST*, + _Outptr_ PIDLIST_ABSOLUTE*, _In_ SFGAOF, _Out_opt_ SFGAOF*); @@ -252,13 +252,13 @@ SHReplaceFromPropSheetExtArray( _In_ LPFNADDPROPSHEETPAGE, LPARAM); -LPITEMIDLIST WINAPI SHSimpleIDListFromPath(LPCWSTR); +PIDLIST_ABSOLUTE WINAPI SHSimpleIDListFromPath(PCWSTR); int WINAPI SHMapPIDLToSystemImageListIndex( _In_ IShellFolder*, - _In_ LPCITEMIDLIST, + _In_ PCUITEMID_CHILD, _Out_opt_ int*); HRESULT WINAPI SHStartNetConnectionDialog(HWND,LPCSTR,DWORD); @@ -1104,25 +1104,25 @@ typedef INT (CALLBACK *BFFCALLBACK)(HWND,UINT,LPARAM,LPARAM); #include <pshpack8.h> typedef struct tagBROWSEINFOA { - HWND hwndOwner; - LPCITEMIDLIST pidlRoot; - LPSTR pszDisplayName; - LPCSTR lpszTitle; - UINT ulFlags; - BFFCALLBACK lpfn; - LPARAM lParam; - INT iImage; + HWND hwndOwner; + PCIDLIST_ABSOLUTE pidlRoot; + LPSTR pszDisplayName; + LPCSTR lpszTitle; + UINT ulFlags; + BFFCALLBACK lpfn; + LPARAM lParam; + INT iImage; } BROWSEINFOA, *PBROWSEINFOA, *LPBROWSEINFOA; typedef struct tagBROWSEINFOW { - HWND hwndOwner; - LPCITEMIDLIST pidlRoot; - LPWSTR pszDisplayName; - LPCWSTR lpszTitle; - UINT ulFlags; - BFFCALLBACK lpfn; - LPARAM lParam; - INT iImage; + HWND hwndOwner; + PCIDLIST_ABSOLUTE pidlRoot; + LPWSTR pszDisplayName; + LPCWSTR lpszTitle; + UINT ulFlags; + BFFCALLBACK lpfn; + LPARAM lParam; + INT iImage; } BROWSEINFOW, *PBROWSEINFOW, *LPBROWSEINFOW; #define BROWSEINFO WINELIB_NAME_AW(BROWSEINFO) @@ -1166,8 +1166,8 @@ typedef struct tagBROWSEINFOW { #define BFFM_SETOKTEXT (WM_USER+105) #define BFFM_SETEXPANDED (WM_USER+106) -LPITEMIDLIST WINAPI SHBrowseForFolderA(_In_ LPBROWSEINFOA lpbi); -LPITEMIDLIST WINAPI SHBrowseForFolderW(_In_ LPBROWSEINFOW lpbi); +PIDLIST_ABSOLUTE WINAPI SHBrowseForFolderA(_In_ LPBROWSEINFOA lpbi); +PIDLIST_ABSOLUTE WINAPI SHBrowseForFolderW(_In_ LPBROWSEINFOW lpbi); #define SHBrowseForFolder WINELIB_NAME_AW(SHBrowseForFolder) #define BFFM_SETSTATUSTEXT WINELIB_NAME_AW(BFFM_SETSTATUSTEXT) @@ -1191,13 +1191,13 @@ typedef HRESULT typedef struct _CSFV { - UINT cbSize; - IShellFolder* pshf; - IShellView* psvOuter; - LPCITEMIDLIST pidl; - LONG lEvents; - LPFNVIEWCALLBACK pfnCallback; - FOLDERVIEWMODE fvm; + UINT cbSize; + IShellFolder* pshf; + IShellView* psvOuter; + PCIDLIST_ABSOLUTE pidl; + LONG lEvents; + LPFNVIEWCALLBACK pfnCallback; + FOLDERVIEWMODE fvm; } CSFV, *LPCSFV; #include <poppack.h> @@ -1403,7 +1403,7 @@ HRESULT WINAPI SHGetDataFromIDListA( _In_ LPSHELLFOLDER psf, - _In_ LPCITEMIDLIST pidl, + _In_ PCUITEMID_CHILD pidl, int nFormat, _Out_writes_bytes_(cb) LPVOID pv, int cb); @@ -1412,14 +1412,14 @@ HRESULT WINAPI SHGetDataFromIDListW( _In_ LPSHELLFOLDER psf, - _In_ LPCITEMIDLIST pidl, + _In_ PCUITEMID_CHILD pidl, int nFormat, _Out_writes_bytes_(cb) LPVOID pv, int cb); #define SHGetDataFromIDList WINELIB_NAME_AW(SHGetDataFromIDList) -LPITEMIDLIST +PIDLIST_ABSOLUTE WINAPI SHCloneSpecialIDList( _Reserved_ HWND hwnd, @@ -1454,37 +1454,37 @@ _Check_return_ HRESULT WINAPI SHGetMalloc(_Outptr_ LPMALLOC *lpmal); typedef struct { - BOOL fShowAllObjects : 1; - BOOL fShowExtensions : 1; - BOOL fNoConfirmRecycle : 1; - - BOOL fShowSysFiles : 1; - BOOL fShowCompColor : 1; - BOOL fDoubleClickInWebView : 1; - BOOL fDesktopHTML : 1; - BOOL fWin95Classic : 1; - BOOL fDontPrettyPath : 1; - BOOL fShowAttribCol : 1; - BOOL fMapNetDrvBtn : 1; - BOOL fShowInfoTip : 1; - BOOL fHideIcons : 1; - BOOL fWebView : 1; - BOOL fFilter : 1; - BOOL fShowSuperHidden : 1; - BOOL fNoNetCrawling : 1; - - UINT :15; /* Required for proper binary layout with gcc */ + BOOL fShowAllObjects : 1; + BOOL fShowExtensions : 1; + BOOL fNoConfirmRecycle : 1; + + BOOL fShowSysFiles : 1; + BOOL fShowCompColor : 1; + BOOL fDoubleClickInWebView : 1; + BOOL fDesktopHTML : 1; + BOOL fWin95Classic : 1; + BOOL fDontPrettyPath : 1; + BOOL fShowAttribCol : 1; + BOOL fMapNetDrvBtn : 1; + BOOL fShowInfoTip : 1; + BOOL fHideIcons : 1; + BOOL fWebView : 1; + BOOL fFilter : 1; + BOOL fShowSuperHidden : 1; + BOOL fNoNetCrawling : 1; + + UINT :15; /* Required for proper binary layout with gcc */ DWORD dwWin95Unused; UINT uWin95Unused; - LONG lParamSort; - int iSortDirection; - UINT version; - UINT uNotUsed; - BOOL fSepProcess: 1; - BOOL fStartPanelOn: 1; - BOOL fShowStartPage: 1; - UINT fSpareFlags : 13; - UINT :15; /* Required for proper binary layout with gcc */ + LONG lParamSort; + int iSortDirection; + UINT version; + UINT uNotUsed; + BOOL fSepProcess: 1; + BOOL fStartPanelOn: 1; + BOOL fShowStartPage: 1; + UINT fSpareFlags : 13; + UINT :15; /* Required for proper binary layout with gcc */ } SHELLSTATE, *LPSHELLSTATE; VOID WINAPI SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet); @@ -1713,7 +1713,7 @@ DWORD WINAPI SHRestricted(RESTRICTIONS rest); */ typedef struct _SHChangeNotifyEntry { - LPCITEMIDLIST pidl; + PCIDLIST_ABSOLUTE pidl; BOOL fRecursive; } SHChangeNotifyEntry; @@ -1824,25 +1824,25 @@ typedef struct tagDATABLOCKHEADER #ifdef LF_FACESIZE typedef struct { DATABLOCK_HEADER dbh; - WORD wFillAttribute; - WORD wPopupFillAttribute; + WORD wFillAttribute; + WORD wPopupFillAttribute; COORD dwScreenBufferSize; COORD dwWindowSize; COORD dwWindowOrigin; DWORD nFont; DWORD nInputBufferSize; COORD dwFontSize; - UINT uFontFamily; - UINT uFontWeight; + UINT uFontFamily; + UINT uFontWeight; WCHAR FaceName[LF_FACESIZE]; - UINT uCursorSize; - BOOL bFullScreen; - BOOL bQuickEdit; - BOOL bInsertMode; - BOOL bAutoPosition; - UINT uHistoryBufferSize; - UINT uNumberOfHistoryBuffers; - BOOL bHistoryNoDup; + UINT uCursorSize; + BOOL bFullScreen; + BOOL bQuickEdit; + BOOL bInsertMode; + BOOL bAutoPosition; + UINT uHistoryBufferSize; + UINT uNumberOfHistoryBuffers; + BOOL bHistoryNoDup; COLORREF ColorTable[16]; } NT_CONSOLE_PROPS, *LPNT_CONSOLE_PROPS; #endif @@ -1875,7 +1875,7 @@ typedef struct { typedef struct { DWORD cbSize; DWORD dwSignature; - BYTE abPropertyStorage[1]; + BYTE abPropertyStorage[1]; } EXP_PROPERTYSTORAGE; #define EXP_SZ_LINK_SIG 0xA0000001 /* EXP_SZ_LINK */ @@ -1919,7 +1919,7 @@ WINAPI SHChangeNotification_Lock( _In_ HANDLE hChangeNotification, DWORD dwProcessId, - _Outptr_opt_result_buffer_(2)_Outptr_opt_result_buffer_(2) LPITEMIDLIST **pppidl, + _Outptr_opt_result_buffer_(2)_Outptr_opt_result_buffer_(2) PIDLIST_ABSOLUTE **pppidl, _Out_opt_ LONG *plEvent); BOOL WINAPI SHChangeNotification_Unlock(_In_ HANDLE hLock); @@ -1928,8 +1928,8 @@ HRESULT WINAPI SHGetRealIDL( _In_ IShellFolder *psf, - _In_ LPCITEMIDLIST pidlSimple, - _Outptr_ LPITEMIDLIST * ppidlReal); + _In_ PCUITEMID_CHILD pidlSimple, + _Outptr_ PITEMID_CHILD * ppidlReal); /**************************************************************************** * SHCreateDirectory API @@ -1961,7 +1961,7 @@ WINAPI SHGetSpecialFolderLocation( _Reserved_ HWND hwndOwner, _In_ int nFolder, - _Outptr_ LPITEMIDLIST *ppidl); + _Outptr_ PIDLIST_ABSOLUTE *ppidl); HRESULT WINAPI @@ -1970,7 +1970,7 @@ SHGetFolderLocation( _In_ int nFolder, _In_opt_ HANDLE hToken, _In_ DWORD dwReserved, - _Outptr_ LPITEMIDLIST *ppidl); + _Outptr_ PIDLIST_ABSOLUTE *ppidl); /**************************************************************************** * SHGetFolderPath API @@ -2077,10 +2077,10 @@ _Check_return_ HRESULT WINAPI SHGetDesktopFolder(_Outptr_ IShellFolder * *); HRESULT WINAPI SHBindToParent( - _In_ LPCITEMIDLIST pidl, + _In_ PCIDLIST_ABSOLUTE pidl, _In_ REFIID riid, _Outptr_ LPVOID *ppv, - _Outptr_opt_ LPCITEMIDLIST *ppidlLast); + _Outptr_opt_ PCUITEMID_CHILD *ppidlLast); /**************************************************************************** * SHDefExtractIcon API @@ -2289,25 +2289,25 @@ SHDoDragDrop( #define PID_IS_COMMENT 13 -LPITEMIDLIST WINAPI ILAppendID(_In_opt_ LPITEMIDLIST, _In_ LPCSHITEMID, BOOL); -LPITEMIDLIST WINAPI ILClone(_In_ LPCITEMIDLIST); -LPITEMIDLIST WINAPI ILCloneFirst(_In_ LPCITEMIDLIST); -LPITEMIDLIST WINAPI ILCreateFromPathA(_In_ LPCSTR); -LPITEMIDLIST WINAPI ILCreateFromPathW(_In_ LPCWSTR); +PIDLIST_RELATIVE WINAPI ILAppendID(_In_opt_ PIDLIST_RELATIVE, _In_ LPCSHITEMID, BOOL); +PIDLIST_RELATIVE WINAPI ILClone(_In_ PCUIDLIST_RELATIVE); +PITEMID_CHILD WINAPI ILCloneFirst(_In_ PCUIDLIST_RELATIVE); +PIDLIST_ABSOLUTE WINAPI ILCreateFromPathA(_In_ PCSTR); +PIDLIST_ABSOLUTE WINAPI ILCreateFromPathW(_In_ PCWSTR); #define ILCreateFromPath WINELIB_NAME_AW(ILCreateFromPath) -LPITEMIDLIST WINAPI ILCombine(_In_opt_ LPCITEMIDLIST, _In_opt_ LPCITEMIDLIST); -LPITEMIDLIST WINAPI ILFindChild(_In_ LPCITEMIDLIST, _In_ LPCITEMIDLIST); -LPITEMIDLIST WINAPI ILFindLastID(_In_ LPCITEMIDLIST); -void WINAPI ILFree(_In_opt_ LPITEMIDLIST); -LPITEMIDLIST WINAPI ILGetNext(_In_opt_ LPCITEMIDLIST); -UINT WINAPI ILGetSize(_In_opt_ LPCITEMIDLIST); -BOOL WINAPI ILIsEqual(_In_ LPCITEMIDLIST, _In_ LPCITEMIDLIST); -BOOL WINAPI ILIsParent(_In_ LPCITEMIDLIST, _In_ LPCITEMIDLIST, BOOL); -HRESULT WINAPI ILLoadFromStream(_In_ LPSTREAM, _Inout_ LPITEMIDLIST*); -BOOL WINAPI ILRemoveLastID(_Inout_opt_ LPITEMIDLIST); -HRESULT WINAPI ILSaveToStream(_In_ LPSTREAM, _In_ LPCITEMIDLIST); - -static inline BOOL ILIsEmpty(_In_opt_ LPCITEMIDLIST pidl) +PIDLIST_ABSOLUTE WINAPI ILCombine(_In_opt_ PCIDLIST_ABSOLUTE, _In_opt_ PCUIDLIST_RELATIVE); +PUIDLIST_RELATIVE WINAPI ILFindChild(_In_ PIDLIST_ABSOLUTE, _In_ PCIDLIST_ABSOLUTE); +PUITEMID_CHILD WINAPI ILFindLastID(_In_ PCUIDLIST_RELATIVE); +void WINAPI ILFree(_In_opt_ PIDLIST_RELATIVE); +PUIDLIST_RELATIVE WINAPI ILGetNext(_In_opt_ PCUIDLIST_RELATIVE); +UINT WINAPI ILGetSize(_In_opt_ PCUIDLIST_RELATIVE); +BOOL WINAPI ILIsEqual(_In_ PCIDLIST_ABSOLUTE, _In_ PCIDLIST_ABSOLUTE); +BOOL WINAPI ILIsParent(_In_ PCIDLIST_ABSOLUTE, _In_ PCIDLIST_ABSOLUTE, BOOL); +HRESULT WINAPI ILLoadFromStream(_In_ LPSTREAM, _Inout_ PIDLIST_RELATIVE*); +BOOL WINAPI ILRemoveLastID(_Inout_opt_ PUIDLIST_RELATIVE); +HRESULT WINAPI ILSaveToStream(_In_ LPSTREAM, _In_ PCUIDLIST_RELATIVE); + +static inline BOOL ILIsEmpty(_In_opt_ PCUIDLIST_RELATIVE pidl) { return !(pidl && pidl->mkid.cb); } diff --git a/sdk/include/psdk/shobjidl.idl b/sdk/include/psdk/shobjidl.idl index a94f1a9f4c6..4d5d278dca0 100644 --- a/sdk/include/psdk/shobjidl.idl +++ b/sdk/include/psdk/shobjidl.idl @@ -102,7 +102,7 @@ interface IEnumIDList : IUnknown HRESULT Next( [in] ULONG celt, - [out, size_is(celt), length_is(*pceltFetched)] LPITEMIDLIST *rgelt, + [out, size_is(celt), length_is(*pceltFetched)] PITEMID_CHILD *rgelt, [out] ULONG *pceltFetched); HRESULT Skip( [in] ULONG celt ); @@ -764,7 +764,7 @@ interface IShellView : IOleWindow HRESULT SaveViewState(); HRESULT SelectItem( - [in] LPCITEMIDLIST pidlItem, + [in] PCUITEMID_CHILD pidlItem, [in] SVSIF uFlags); HRESULT GetItemObject( [in] UINT uItem, @@ -801,10 +801,10 @@ cpp_quote("#include <poppack.h>") [in] LPSV2CVW2_PARAMS view_params ); HRESULT HandleRename( - [in] LPCITEMIDLIST new_pidl + [in] PCUITEMID_CHILD new_pidl ); HRESULT SelectAndPositionItem( - [in] LPCITEMIDLIST item, + [in] PCUITEMID_CHILD item, [in] UINT flags, [in] POINT *point ); @@ -1079,7 +1079,7 @@ cpp_quote("#endif") HRESULT TranslateAcceleratorSB( [in] MSG *pmsg, [in] WORD wID ); HRESULT BrowseObject( - [in] LPCITEMIDLIST pidl, + [in] PCUIDLIST_RELATIVE pidl, [in] UINT wFlags); HRESULT GetViewStateStream( @@ -1307,7 +1307,7 @@ interface IPersistFolder3 : IPersistFolder2 { typedef struct { - LPITEMIDLIST pidlTargetFolder; + PIDLIST_ABSOLUTE pidlTargetFolder; WCHAR szTargetParsingName[MAX_PATH]; WCHAR szNetworkProvider[MAX_PATH]; DWORD dwAttributes; @@ -1316,7 +1316,7 @@ interface IPersistFolder3 : IPersistFolder2 HRESULT InitializeEx( [in] IBindCtx *pbc, - [in] LPCITEMIDLIST pidlRoot, + [in] PCIDLIST_ABSOLUTE pidlRoot, [in] const PERSIST_FOLDER_TARGET_INFO *ppfti); HRESULT GetFolderTargetInfo( [out] PERSIST_FOLDER_TARGET_INFO *ppfti ); @@ -1416,7 +1416,7 @@ cpp_quote("#define CDBOSC_STATECHANGE 0x00000004") HRESULT OnDefaultCommand( [in] IShellView *shv ); HRESULT OnStateChange( [in] IShellView *shv, [in] ULONG uChange ); - HRESULT IncludeObject( [in] IShellView *shv, [in] LPCITEMIDLIST pidl ); + HRESULT IncludeObject( [in] IShellView *shv, [in] PCUITEMID_CHILD pidl ); } @@ -1988,8 +1988,8 @@ interface IShellChangeNotify : IUnknown { HRESULT OnChange( [in] LONG lEvent, - [in] LPCITEMIDLIST pidl1, - [in] LPCITEMIDLIST pidl2); + [in] PCIDLIST_ABSOLUTE pidl1, + [in] PCIDLIST_ABSOLUTE pidl2); } cpp_quote("#define STR_FILE_SYS_BIND_DATA L\"File System Bind Data\"") @@ -2625,8 +2625,8 @@ typedef struct tagSMDATA UINT uIdParent; UINT uIdAncestor; IUnknown *punk; - LPITEMIDLIST pidlFolder; - LPITEMIDLIST pidlItem; + PIDLIST_ABSOLUTE pidlFolder; + PUITEMID_CHILD pidlItem; IShellFolder *psf; void *pvUserData; } SMDATA, *LPSMDATA; @@ -2646,8 +2646,8 @@ typedef struct tagSMINFO typedef struct tagSHCSCHANGENOTIFYSTRUCT { LONG lEvent; - LPCITEMIDLIST pidl1; - LPCITEMIDLIST pidl2; + PCIDLIST_ABSOLUTE pidl1; + PCIDLIST_ABSOLUTE pidl2; } SMCSHCHANGENOTIFYSTRUCT, *PSMCSHCHANGENOTIFYSTRUCT; cpp_quote("#include <poppack.h>") @@ -2762,13 +2762,13 @@ interface IShellMenu : IUnknown HRESULT SetShellFolder( [in] IShellFolder *psf, - [in] LPCITEMIDLIST pidlFolder, + [in] PCIDLIST_ABSOLUTE pidlFolder, [in] HKEY hKey, [in] DWORD dwFlags); HRESULT GetShellFolder( [out] DWORD *pdwFlags, - [out] LPITEMIDLIST *ppidl, + [out] PIDLIST_ABSOLUTE *ppidl, [in] REFIID riid, [out] void **ppv);
4 years, 11 months
1
0
0
0
[reactos] 01/01: [CRT] Define _INTEGRAL_MAX_BITS only if it isn't already defined by the compiler. CORE-16555
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ef0a1eb527c1ea34d128e…
commit ef0a1eb527c1ea34d128e2043a3387dd20b7e500 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Fri Jan 3 19:33:21 2020 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Fri Jan 3 19:33:21 2020 +0100 [CRT] Define _INTEGRAL_MAX_BITS only if it isn't already defined by the compiler. CORE-16555 --- sdk/include/crt/_mingw.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/include/crt/_mingw.h b/sdk/include/crt/_mingw.h index 1d79edaff1c..b63e0b3b17a 100644 --- a/sdk/include/crt/_mingw.h +++ b/sdk/include/crt/_mingw.h @@ -7,7 +7,9 @@ #ifndef _INC_MINGW #define _INC_MINGW +#ifndef _INTEGRAL_MAX_BITS #define _INTEGRAL_MAX_BITS 64 +#endif #ifndef MINGW64 #define MINGW64
4 years, 11 months
1
0
0
0
[reactos] 01/01: [NTDLL_APITEST] Addendum to ae8c9a1f: really test the "zero Length, non-zero MaximumLength" case. + add few simplifications.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ef2e1871b18be3a489b16…
commit ef2e1871b18be3a489b1649207f423471332c024 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Fri Jan 3 17:41:14 2020 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Fri Jan 3 17:41:14 2020 +0100 [NTDLL_APITEST] Addendum to ae8c9a1f: really test the "zero Length, non-zero MaximumLength" case. + add few simplifications. --- modules/rostests/apitests/ntdll/RtlValidateUnicodeString.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/rostests/apitests/ntdll/RtlValidateUnicodeString.c b/modules/rostests/apitests/ntdll/RtlValidateUnicodeString.c index 8c900613d0e..c66c94dc14e 100644 --- a/modules/rostests/apitests/ntdll/RtlValidateUnicodeString.c +++ b/modules/rostests/apitests/ntdll/RtlValidateUnicodeString.c @@ -34,7 +34,7 @@ START_TEST(RtlValidateUnicodeString) ok(Status == STATUS_INVALID_PARAMETER, "Status = 0x%lx\n", Status); // With a non-NULL but empty buffer, and zero lengths. - String.Buffer = L""; + RtlInitEmptyUnicodeString(&String, L"", 0); Status = RtlValidateUnicodeString(0, &String); ok(Status == STATUS_SUCCESS, "Status = 0x%lx\n", Status); Status = RtlValidateUnicodeString(1, &String); @@ -43,7 +43,7 @@ START_TEST(RtlValidateUnicodeString) ok(Status == STATUS_INVALID_PARAMETER, "Status = 0x%lx\n", Status); // With a non-NULL but empty buffer, and zero Length, non-zero MaximumLength. - String.Buffer = L""; + RtlInitEmptyUnicodeString(&String, L"", sizeof(WCHAR)); String.Length = 0; Status = RtlValidateUnicodeString(0, &String); ok(Status == STATUS_SUCCESS, "Status = 0x%lx\n", Status); @@ -78,7 +78,8 @@ START_TEST(RtlValidateUnicodeString) Status = RtlValidateUnicodeString(0, &String); ok(Status == STATUS_INVALID_PARAMETER, "Status = 0x%lx\n", Status); - // NULL buffer, non-zero Length, zero MaximumLength. + // NULL buffer, non-zero Length, zero MaximumLength + // (tests also the case Length > MaximumLength that must fail). String = ValidString; String.Buffer = NULL; String.MaximumLength = 0; @@ -98,7 +99,6 @@ START_TEST(RtlValidateUnicodeString) Status = RtlValidateUnicodeString(0, &String); ok(Status == STATUS_INVALID_PARAMETER, "Status = 0x%lx\n", Status); - String = ValidString; String.MaximumLength--; // MaximumLength was already >= 2 so it remains > 0. Status = RtlValidateUnicodeString(0, &String); ok(Status == STATUS_INVALID_PARAMETER, "Status = 0x%lx\n", Status);
4 years, 11 months
1
0
0
0
[reactos] 01/01: [BLUE] Add IOCTL buffers validation. Addendum to commit bfd8a848.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=afb14bff33efedffa796d…
commit afb14bff33efedffa796df27fa8d288b1ee1c504 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Tue Dec 24 13:27:15 2019 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Fri Jan 3 17:17:03 2020 +0100 [BLUE] Add IOCTL buffers validation. Addendum to commit bfd8a848. Also convert all sizes and positions of CONSOLE_DRAW to USHORT since this is the standard type for all console buffer positions & sizes (minimum value 0, maximum value 0xFFFF == 65535). --- drivers/setup/blue/blue.c | 459 +++++++++++++++++++++------- sdk/include/reactos/drivers/blue/ntddblue.h | 20 +- 2 files changed, 363 insertions(+), 116 deletions(-) diff --git a/drivers/setup/blue/blue.c b/drivers/setup/blue/blue.c index 2558506fb53..def5049fa32 100644 --- a/drivers/setup/blue/blue.c +++ b/drivers/setup/blue/blue.c @@ -292,7 +292,7 @@ ScrInbvCleanup(VOID) ThreadHandle = InterlockedExchangePointer((PVOID*)&InbvThreadHandle, NULL); if (ThreadHandle) { - KeWaitForSingleObject(&ThreadHandle, Executive, KernelMode, FALSE, NULL); + ZwWaitForSingleObject(ThreadHandle, Executive, KernelMode, FALSE, NULL); /* Close its handle */ ObCloseHandle(ThreadHandle, KernelMode); } @@ -658,14 +658,21 @@ ScrResetScreen( return TRUE; // STATUS_SUCCESS; } -static DRIVER_DISPATCH ScrCreate; +static DRIVER_DISPATCH ScrCreateClose; static NTSTATUS NTAPI -ScrCreate( +ScrCreateClose( _In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp) { - // Irp->IoStatus.Information = FILE_OPENED; + PIO_STACK_LOCATION stk = IoGetCurrentIrpStackLocation(Irp); + + UNREFERENCED_PARAMETER(DeviceObject); + + if (stk->MajorFunction == IRP_MJ_CREATE) + Irp->IoStatus.Information = FILE_OPENED; + // else: IRP_MJ_CLOSE + Irp->IoStatus.Status = STATUS_SUCCESS; IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_SUCCESS; @@ -824,7 +831,7 @@ ScrWrite( Status = STATUS_SUCCESS; Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_VIDEO_INCREMENT); return Status; } @@ -838,29 +845,48 @@ ScrIoControl( { NTSTATUS Status; PIO_STACK_LOCATION stk = IoGetCurrentIrpStackLocation(Irp); - PDEVICE_EXTENSION DeviceExtension; + PDEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension; - DeviceExtension = DeviceObject->DeviceExtension; switch (stk->Parameters.DeviceIoControl.IoControlCode) { case IOCTL_CONSOLE_RESET_SCREEN: { - BOOLEAN Enable = !!*(PULONG)Irp->AssociatedIrp.SystemBuffer; + BOOLEAN Enable; + + /* Validate input buffer */ + if (stk->Parameters.DeviceIoControl.InputBufferLength < sizeof(ULONG)) + { + Status = STATUS_INVALID_PARAMETER; + break; + } + ASSERT(Irp->AssociatedIrp.SystemBuffer); + + Enable = !!*(PULONG)Irp->AssociatedIrp.SystemBuffer; /* Fully enable or disable the screen */ Status = (ScrResetScreen(DeviceExtension, TRUE, Enable) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL); - Irp->IoStatus.Information = 0; break; } case IOCTL_CONSOLE_GET_SCREEN_BUFFER_INFO: { - PCONSOLE_SCREEN_BUFFER_INFO pcsbi = (PCONSOLE_SCREEN_BUFFER_INFO)Irp->AssociatedIrp.SystemBuffer; + PCONSOLE_SCREEN_BUFFER_INFO pcsbi; USHORT rows = DeviceExtension->Rows; USHORT columns = DeviceExtension->Columns; + /* Validate output buffer */ + if (stk->Parameters.DeviceIoControl.OutputBufferLength < sizeof(CONSOLE_SCREEN_BUFFER_INFO)) + { + Status = STATUS_INVALID_PARAMETER; + break; + } + ASSERT(Irp->AssociatedIrp.SystemBuffer); + + pcsbi = (PCONSOLE_SCREEN_BUFFER_INFO)Irp->AssociatedIrp.SystemBuffer; + RtlZeroMemory(pcsbi, sizeof(CONSOLE_SCREEN_BUFFER_INFO)); + pcsbi->dwSize.X = columns; pcsbi->dwSize.Y = rows; @@ -884,7 +910,17 @@ ScrIoControl( case IOCTL_CONSOLE_SET_SCREEN_BUFFER_INFO: { - PCONSOLE_SCREEN_BUFFER_INFO pcsbi = (PCONSOLE_SCREEN_BUFFER_INFO)Irp->AssociatedIrp.SystemBuffer; + PCONSOLE_SCREEN_BUFFER_INFO pcsbi; + + /* Validate input buffer */ + if (stk->Parameters.DeviceIoControl.InputBufferLength < sizeof(CONSOLE_SCREEN_BUFFER_INFO)) + { + Status = STATUS_INVALID_PARAMETER; + break; + } + ASSERT(Irp->AssociatedIrp.SystemBuffer); + + pcsbi = (PCONSOLE_SCREEN_BUFFER_INFO)Irp->AssociatedIrp.SystemBuffer; if ( pcsbi->dwCursorPosition.X < 0 || pcsbi->dwCursorPosition.X >= DeviceExtension->Columns || pcsbi->dwCursorPosition.Y < 0 || pcsbi->dwCursorPosition.Y >= DeviceExtension->Rows ) @@ -911,7 +947,18 @@ ScrIoControl( case IOCTL_CONSOLE_GET_CURSOR_INFO: { - PCONSOLE_CURSOR_INFO pcci = (PCONSOLE_CURSOR_INFO)Irp->AssociatedIrp.SystemBuffer; + PCONSOLE_CURSOR_INFO pcci; + + /* Validate output buffer */ + if (stk->Parameters.DeviceIoControl.OutputBufferLength < sizeof(CONSOLE_CURSOR_INFO)) + { + Status = STATUS_INVALID_PARAMETER; + break; + } + ASSERT(Irp->AssociatedIrp.SystemBuffer); + + pcci = (PCONSOLE_CURSOR_INFO)Irp->AssociatedIrp.SystemBuffer; + RtlZeroMemory(pcci, sizeof(CONSOLE_CURSOR_INFO)); pcci->dwSize = DeviceExtension->CursorSize; pcci->bVisible = DeviceExtension->CursorVisible; @@ -923,7 +970,17 @@ ScrIoControl( case IOCTL_CONSOLE_SET_CURSOR_INFO: { - PCONSOLE_CURSOR_INFO pcci = (PCONSOLE_CURSOR_INFO)Irp->AssociatedIrp.SystemBuffer; + PCONSOLE_CURSOR_INFO pcci; + + /* Validate input buffer */ + if (stk->Parameters.DeviceIoControl.InputBufferLength < sizeof(CONSOLE_CURSOR_INFO)) + { + Status = STATUS_INVALID_PARAMETER; + break; + } + ASSERT(Irp->AssociatedIrp.SystemBuffer); + + pcci = (PCONSOLE_CURSOR_INFO)Irp->AssociatedIrp.SystemBuffer; DeviceExtension->CursorSize = pcci->dwSize; DeviceExtension->CursorVisible = pcci->bVisible; @@ -937,7 +994,18 @@ ScrIoControl( case IOCTL_CONSOLE_GET_MODE: { - PCONSOLE_MODE pcm = (PCONSOLE_MODE)Irp->AssociatedIrp.SystemBuffer; + PCONSOLE_MODE pcm; + + /* Validate output buffer */ + if (stk->Parameters.DeviceIoControl.OutputBufferLength < sizeof(CONSOLE_MODE)) + { + Status = STATUS_INVALID_PARAMETER; + break; + } + ASSERT(Irp->AssociatedIrp.SystemBuffer); + + pcm = (PCONSOLE_MODE)Irp->AssociatedIrp.SystemBuffer; + RtlZeroMemory(pcm, sizeof(CONSOLE_MODE)); pcm->dwMode = DeviceExtension->Mode; @@ -948,8 +1016,17 @@ ScrIoControl( case IOCTL_CONSOLE_SET_MODE: { - PCONSOLE_MODE pcm = (PCONSOLE_MODE)Irp->AssociatedIrp.SystemBuffer; + PCONSOLE_MODE pcm; + /* Validate input buffer */ + if (stk->Parameters.DeviceIoControl.InputBufferLength < sizeof(CONSOLE_MODE)) + { + Status = STATUS_INVALID_PARAMETER; + break; + } + ASSERT(Irp->AssociatedIrp.SystemBuffer); + + pcm = (PCONSOLE_MODE)Irp->AssociatedIrp.SystemBuffer; DeviceExtension->Mode = pcm->dwMode; Irp->IoStatus.Information = 0; @@ -959,17 +1036,31 @@ ScrIoControl( case IOCTL_CONSOLE_FILL_OUTPUT_ATTRIBUTE: { - POUTPUT_ATTRIBUTE Buf = (POUTPUT_ATTRIBUTE)Irp->AssociatedIrp.SystemBuffer; + POUTPUT_ATTRIBUTE Buf; PUCHAR vidmem; ULONG offset; ULONG dwCount; - ULONG nMaxLength = Buf->nLength; + ULONG nMaxLength; + + /* Validate input and output buffers */ + if (stk->Parameters.DeviceIoControl.InputBufferLength < sizeof(OUTPUT_ATTRIBUTE) || + stk->Parameters.DeviceIoControl.OutputBufferLength < sizeof(OUTPUT_ATTRIBUTE)) + { + Status = STATUS_INVALID_PARAMETER; + break; + } + ASSERT(Irp->AssociatedIrp.SystemBuffer); + + Buf = (POUTPUT_ATTRIBUTE)Irp->AssociatedIrp.SystemBuffer; + nMaxLength = Buf->nLength; + + Buf->dwTransfered = 0; + Irp->IoStatus.Information = sizeof(OUTPUT_ATTRIBUTE); if ( Buf->dwCoord.X < 0 || Buf->dwCoord.X >= DeviceExtension->Columns || - Buf->dwCoord.Y < 0 || Buf->dwCoord.Y >= DeviceExtension->Rows ) + Buf->dwCoord.Y < 0 || Buf->dwCoord.Y >= DeviceExtension->Rows || + nMaxLength == 0 ) { - Buf->dwTransfered = 0; - Irp->IoStatus.Information = 0; Status = STATUS_SUCCESS; break; } @@ -987,39 +1078,63 @@ ScrIoControl( { vidmem[offset + (dwCount * 2)] = (char)Buf->wAttribute; } + Buf->dwTransfered = dwCount; } - Buf->dwTransfered = nMaxLength; - - Irp->IoStatus.Information = 0; Status = STATUS_SUCCESS; break; } case IOCTL_CONSOLE_READ_OUTPUT_ATTRIBUTE: { - POUTPUT_ATTRIBUTE Buf = (POUTPUT_ATTRIBUTE)Irp->AssociatedIrp.SystemBuffer; - PUSHORT pAttr = (PUSHORT)MmGetSystemAddressForMdl(Irp->MdlAddress); + POUTPUT_ATTRIBUTE Buf; + PUSHORT pAttr; PUCHAR vidmem; ULONG offset; ULONG dwCount; ULONG nMaxLength; + /* Validate input buffer */ + if (stk->Parameters.DeviceIoControl.InputBufferLength < sizeof(OUTPUT_ATTRIBUTE)) + { + Status = STATUS_INVALID_PARAMETER; + break; + } + ASSERT(Irp->AssociatedIrp.SystemBuffer); + + Buf = (POUTPUT_ATTRIBUTE)Irp->AssociatedIrp.SystemBuffer; + Irp->IoStatus.Information = 0; + + /* Validate output buffer */ + if (stk->Parameters.DeviceIoControl.OutputBufferLength == 0) + { + Status = STATUS_SUCCESS; + break; + } + ASSERT(Irp->MdlAddress); + pAttr = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority); + if (pAttr == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + break; + } + if ( Buf->dwCoord.X < 0 || Buf->dwCoord.X >= DeviceExtension->Columns || Buf->dwCoord.Y < 0 || Buf->dwCoord.Y >= DeviceExtension->Rows ) { - Buf->dwTransfered = 0; - Irp->IoStatus.Information = 0; Status = STATUS_SUCCESS; break; } + nMaxLength = stk->Parameters.DeviceIoControl.OutputBufferLength; + nMaxLength /= sizeof(USHORT); + if (DeviceExtension->Enabled && DeviceExtension->VideoMemory) { vidmem = DeviceExtension->VideoMemory; offset = (Buf->dwCoord.X + Buf->dwCoord.Y * DeviceExtension->Columns) * 2 + 1; - nMaxLength = min(stk->Parameters.DeviceIoControl.OutputBufferLength, + nMaxLength = min(nMaxLength, (DeviceExtension->Rows - Buf->dwCoord.Y) * DeviceExtension->Columns - Buf->dwCoord.X); @@ -1027,75 +1142,123 @@ ScrIoControl( { *((PCHAR)pAttr) = vidmem[offset + (dwCount * 2)]; } - - Buf->dwTransfered = dwCount; - } - else - { - Buf->dwTransfered = 0; + Irp->IoStatus.Information = dwCount * sizeof(USHORT); } - Irp->IoStatus.Information = sizeof(OUTPUT_ATTRIBUTE); Status = STATUS_SUCCESS; break; } case IOCTL_CONSOLE_WRITE_OUTPUT_ATTRIBUTE: { - PCOORD pCoord = (PCOORD)MmGetSystemAddressForMdl(Irp->MdlAddress); - PCHAR pAttr = (PCHAR)(pCoord + 1); + COORD dwCoord; + PCOORD pCoord; + PUSHORT pAttr; PUCHAR vidmem; ULONG offset; ULONG dwCount; ULONG nMaxLength; - if ( pCoord->X < 0 || pCoord->X >= DeviceExtension->Columns || - pCoord->Y < 0 || pCoord->Y >= DeviceExtension->Rows ) + // + // NOTE: For whatever reason no OUTPUT_ATTRIBUTE structure + // is used for this IOCTL. + // + + /* Validate output buffer */ + if (stk->Parameters.DeviceIoControl.OutputBufferLength < sizeof(COORD)) + { + Status = STATUS_INVALID_PARAMETER; + break; + } + ASSERT(Irp->MdlAddress); + pCoord = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority); + if (pCoord == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + break; + } + /* Capture the input info data */ + dwCoord = *pCoord; + + nMaxLength = stk->Parameters.DeviceIoControl.OutputBufferLength - sizeof(COORD); + nMaxLength /= sizeof(USHORT); + + Irp->IoStatus.Information = 0; + + if ( dwCoord.X < 0 || dwCoord.X >= DeviceExtension->Columns || + dwCoord.Y < 0 || dwCoord.Y >= DeviceExtension->Rows || + nMaxLength == 0 ) { - Irp->IoStatus.Information = 0; Status = STATUS_SUCCESS; break; } + pAttr = (PUSHORT)(pCoord + 1); + if (DeviceExtension->Enabled && DeviceExtension->VideoMemory) { vidmem = DeviceExtension->VideoMemory; - offset = (pCoord->X + pCoord->Y * DeviceExtension->Columns) * 2 + 1; + offset = (dwCoord.X + dwCoord.Y * DeviceExtension->Columns) * 2 + 1; - nMaxLength = min(stk->Parameters.DeviceIoControl.OutputBufferLength - sizeof(COORD), - (DeviceExtension->Rows - pCoord->Y) - * DeviceExtension->Columns - pCoord->X); + nMaxLength = min(nMaxLength, + (DeviceExtension->Rows - dwCoord.Y) + * DeviceExtension->Columns - dwCoord.X); for (dwCount = 0; dwCount < nMaxLength; dwCount++, pAttr++) { - vidmem[offset + (dwCount * 2)] = *pAttr; + vidmem[offset + (dwCount * 2)] = *((PCHAR)pAttr); } + Irp->IoStatus.Information = dwCount * sizeof(USHORT); } - Irp->IoStatus.Information = 0; Status = STATUS_SUCCESS; break; } case IOCTL_CONSOLE_SET_TEXT_ATTRIBUTE: - DeviceExtension->CharAttribute = (USHORT)*(PUSHORT)Irp->AssociatedIrp.SystemBuffer; + { + /* Validate input buffer */ + if (stk->Parameters.DeviceIoControl.InputBufferLength < sizeof(USHORT)) + { + Status = STATUS_INVALID_PARAMETER; + break; + } + ASSERT(Irp->AssociatedIrp.SystemBuffer); + + DeviceExtension->CharAttribute = *(PUSHORT)Irp->AssociatedIrp.SystemBuffer; + Irp->IoStatus.Information = 0; Status = STATUS_SUCCESS; break; + } case IOCTL_CONSOLE_FILL_OUTPUT_CHARACTER: { - POUTPUT_CHARACTER Buf = (POUTPUT_CHARACTER)Irp->AssociatedIrp.SystemBuffer; + POUTPUT_CHARACTER Buf; PUCHAR vidmem; ULONG offset; ULONG dwCount; - ULONG nMaxLength = Buf->nLength; + ULONG nMaxLength; + + /* Validate input and output buffers */ + if (stk->Parameters.DeviceIoControl.InputBufferLength < sizeof(OUTPUT_CHARACTER) || + stk->Parameters.DeviceIoControl.OutputBufferLength < sizeof(OUTPUT_CHARACTER)) + { + Status = STATUS_INVALID_PARAMETER; + break; + } + ASSERT(Irp->AssociatedIrp.SystemBuffer); + + Buf = (POUTPUT_CHARACTER)Irp->AssociatedIrp.SystemBuffer; + nMaxLength = Buf->nLength; + + Buf->dwTransfered = 0; + Irp->IoStatus.Information = sizeof(OUTPUT_CHARACTER); if ( Buf->dwCoord.X < 0 || Buf->dwCoord.X >= DeviceExtension->Columns || - Buf->dwCoord.Y < 0 || Buf->dwCoord.Y >= DeviceExtension->Rows ) + Buf->dwCoord.Y < 0 || Buf->dwCoord.Y >= DeviceExtension->Rows || + nMaxLength == 0 ) { - Buf->dwTransfered = 0; - Irp->IoStatus.Information = 0; Status = STATUS_SUCCESS; break; } @@ -1113,39 +1276,62 @@ ScrIoControl( { vidmem[offset + (dwCount * 2)] = (char)Buf->cCharacter; } + Buf->dwTransfered = dwCount; } - Buf->dwTransfered = nMaxLength; - - Irp->IoStatus.Information = 0; Status = STATUS_SUCCESS; break; } case IOCTL_CONSOLE_READ_OUTPUT_CHARACTER: { - POUTPUT_CHARACTER Buf = (POUTPUT_CHARACTER)Irp->AssociatedIrp.SystemBuffer; - PCHAR pChar = (PCHAR)MmGetSystemAddressForMdl(Irp->MdlAddress); + POUTPUT_CHARACTER Buf; + PCHAR pChar; PUCHAR vidmem; ULONG offset; ULONG dwCount; ULONG nMaxLength; + /* Validate input buffer */ + if (stk->Parameters.DeviceIoControl.InputBufferLength < sizeof(OUTPUT_CHARACTER)) + { + Status = STATUS_INVALID_PARAMETER; + break; + } + ASSERT(Irp->AssociatedIrp.SystemBuffer); + + Buf = (POUTPUT_CHARACTER)Irp->AssociatedIrp.SystemBuffer; + Irp->IoStatus.Information = 0; + + /* Validate output buffer */ + if (stk->Parameters.DeviceIoControl.OutputBufferLength == 0) + { + Status = STATUS_SUCCESS; + break; + } + ASSERT(Irp->MdlAddress); + pChar = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority); + if (pChar == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + break; + } + if ( Buf->dwCoord.X < 0 || Buf->dwCoord.X >= DeviceExtension->Columns || Buf->dwCoord.Y < 0 || Buf->dwCoord.Y >= DeviceExtension->Rows ) { - Buf->dwTransfered = 0; - Irp->IoStatus.Information = 0; Status = STATUS_SUCCESS; break; } + nMaxLength = stk->Parameters.DeviceIoControl.OutputBufferLength; + if (DeviceExtension->Enabled && DeviceExtension->VideoMemory) { vidmem = DeviceExtension->VideoMemory; offset = (Buf->dwCoord.X + Buf->dwCoord.Y * DeviceExtension->Columns) * 2; - nMaxLength = min(stk->Parameters.DeviceIoControl.OutputBufferLength, + nMaxLength = min(nMaxLength, (DeviceExtension->Rows - Buf->dwCoord.Y) * DeviceExtension->Columns - Buf->dwCoord.X); @@ -1153,72 +1339,135 @@ ScrIoControl( { *pChar = vidmem[offset + (dwCount * 2)]; } - - Buf->dwTransfered = dwCount; - } - else - { - Buf->dwTransfered = 0; + Irp->IoStatus.Information = dwCount * sizeof(CHAR); } - Irp->IoStatus.Information = sizeof(OUTPUT_ATTRIBUTE); Status = STATUS_SUCCESS; break; } case IOCTL_CONSOLE_WRITE_OUTPUT_CHARACTER: { - PCOORD pCoord = (PCOORD)MmGetSystemAddressForMdl(Irp->MdlAddress); - PCHAR pChar = (PCHAR)(pCoord + 1); + COORD dwCoord; + PCOORD pCoord; + PCHAR pChar; PUCHAR vidmem; ULONG offset; ULONG dwCount; ULONG nMaxLength; - if ( pCoord->X < 0 || pCoord->X >= DeviceExtension->Columns || - pCoord->Y < 0 || pCoord->Y >= DeviceExtension->Rows ) + // + // NOTE: For whatever reason no OUTPUT_CHARACTER structure + // is used for this IOCTL. + // + + /* Validate output buffer */ + if (stk->Parameters.DeviceIoControl.OutputBufferLength < sizeof(COORD)) + { + Status = STATUS_INVALID_PARAMETER; + break; + } + ASSERT(Irp->MdlAddress); + pCoord = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority); + if (pCoord == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + break; + } + /* Capture the input info data */ + dwCoord = *pCoord; + + nMaxLength = stk->Parameters.DeviceIoControl.OutputBufferLength - sizeof(COORD); + Irp->IoStatus.Information = 0; + + if ( dwCoord.X < 0 || dwCoord.X >= DeviceExtension->Columns || + dwCoord.Y < 0 || dwCoord.Y >= DeviceExtension->Rows || + nMaxLength == 0 ) { - Irp->IoStatus.Information = 0; Status = STATUS_SUCCESS; break; } + pChar = (PCHAR)(pCoord + 1); + if (DeviceExtension->Enabled && DeviceExtension->VideoMemory) { vidmem = DeviceExtension->VideoMemory; - offset = (pCoord->X + pCoord->Y * DeviceExtension->Columns) * 2; + offset = (dwCoord.X + dwCoord.Y * DeviceExtension->Columns) * 2; - nMaxLength = min(stk->Parameters.DeviceIoControl.OutputBufferLength - sizeof(COORD), - (DeviceExtension->Rows - pCoord->Y) - * DeviceExtension->Columns - pCoord->X); + nMaxLength = min(nMaxLength, + (DeviceExtension->Rows - dwCoord.Y) + * DeviceExtension->Columns - dwCoord.X); for (dwCount = 0; dwCount < nMaxLength; dwCount++, pChar++) { vidmem[offset + (dwCount * 2)] = *pChar; } + Irp->IoStatus.Information = dwCount * sizeof(CHAR); } - Irp->IoStatus.Information = 0; Status = STATUS_SUCCESS; break; } case IOCTL_CONSOLE_DRAW: { - PCONSOLE_DRAW ConsoleDraw; + CONSOLE_DRAW ConsoleDraw; + PCONSOLE_DRAW pConsoleDraw; PUCHAR Src, Dest; UINT32 SrcDelta, DestDelta, i; + /* Validate output buffer */ + if (stk->Parameters.DeviceIoControl.OutputBufferLength < sizeof(CONSOLE_DRAW)) + { + Status = STATUS_INVALID_PARAMETER; + break; + } + ASSERT(Irp->MdlAddress); + pConsoleDraw = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority); + if (pConsoleDraw == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + break; + } + /* Capture the input info data */ + ConsoleDraw = *pConsoleDraw; + + /* Check whether we have the size for the header plus the data area */ + if ((stk->Parameters.DeviceIoControl.OutputBufferLength - sizeof(CONSOLE_DRAW)) / 2 + < ((ULONG)ConsoleDraw.SizeX * (ULONG)ConsoleDraw.SizeY)) + { + Status = STATUS_INVALID_BUFFER_SIZE; + break; + } + + // TODO: For the moment if the ConsoleDraw rectangle has borders + // out of the screen-buffer we just bail out. Would it be better + // to actually clip the rectangle within its borders instead? + if ( ConsoleDraw.X < 0 || ConsoleDraw.X >= DeviceExtension->Columns || + ConsoleDraw.Y < 0 || ConsoleDraw.Y >= DeviceExtension->Rows ) + { + Status = STATUS_SUCCESS; + break; + } + if ( ConsoleDraw.SizeX >= DeviceExtension->Columns - ConsoleDraw.X || + ConsoleDraw.SizeY >= DeviceExtension->Rows - ConsoleDraw.Y ) + { + Status = STATUS_SUCCESS; + break; + } + if (DeviceExtension->Enabled && DeviceExtension->VideoMemory) { - ConsoleDraw = (PCONSOLE_DRAW) MmGetSystemAddressForMdl(Irp->MdlAddress); - Src = (PUCHAR) (ConsoleDraw + 1); - SrcDelta = ConsoleDraw->SizeX * 2; + Src = (PUCHAR)(pConsoleDraw + 1); + SrcDelta = ConsoleDraw.SizeX * 2; Dest = DeviceExtension->VideoMemory + - (ConsoleDraw->X + ConsoleDraw->Y * DeviceExtension->Columns) * 2; + (ConsoleDraw.X + ConsoleDraw.Y * DeviceExtension->Columns) * 2; DestDelta = DeviceExtension->Columns * 2; + /* 2 == sizeof(CHAR) + sizeof(BYTE) */ - for (i = 0; i < ConsoleDraw->SizeY; i++) + /* Copy each line */ + for (i = 0; i < ConsoleDraw.SizeY; i++) { RtlCopyMemory(Dest, Src, SrcDelta); Src += SrcDelta; @@ -1227,8 +1476,8 @@ ScrIoControl( } /* Set the cursor position, clipping it to the screen */ - DeviceExtension->CursorX = min(max(ConsoleDraw->CursorX, 0), DeviceExtension->Columns - 1); - DeviceExtension->CursorY = min(max(ConsoleDraw->CursorY, 0), DeviceExtension->Rows - 1); + DeviceExtension->CursorX = min(max(ConsoleDraw.CursorX, 0), DeviceExtension->Columns - 1); + DeviceExtension->CursorY = min(max(ConsoleDraw.CursorY, 0), DeviceExtension->Rows - 1); if (DeviceExtension->Enabled) ScrSetCursor(DeviceExtension); @@ -1239,14 +1488,19 @@ ScrIoControl( case IOCTL_CONSOLE_LOADFONT: { - ULONG CodePage = *(PULONG)Irp->AssociatedIrp.SystemBuffer; - DeviceExtension->CodePage = CodePage; - - if (DeviceExtension->Enabled && DeviceExtension->VideoMemory) + /* Validate input buffer */ + if (stk->Parameters.DeviceIoControl.InputBufferLength < sizeof(ULONG)) { - /* Upload a font for the codepage if needed */ - ScrLoadFontTable(CodePage); + Status = STATUS_INVALID_PARAMETER; + break; } + ASSERT(Irp->AssociatedIrp.SystemBuffer); + + DeviceExtension->CodePage = *(PULONG)Irp->AssociatedIrp.SystemBuffer; + + /* Upload a font for the codepage if needed */ + if (DeviceExtension->Enabled && DeviceExtension->VideoMemory) + ScrLoadFontTable(DeviceExtension->CodePage); Irp->IoStatus.Information = 0; Status = STATUS_SUCCESS; @@ -1258,7 +1512,7 @@ ScrIoControl( } Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_VIDEO_INCREMENT); return Status; } @@ -1270,23 +1524,16 @@ ScrDispatch( _In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp) { - NTSTATUS Status; PIO_STACK_LOCATION stk = IoGetCurrentIrpStackLocation(Irp); - switch (stk->MajorFunction) - { - case IRP_MJ_CLOSE: - Status = STATUS_SUCCESS; - break; + UNREFERENCED_PARAMETER(DeviceObject); - default: - Status = STATUS_NOT_IMPLEMENTED; - break; - } + DPRINT1("ScrDispatch(0x%p): stk->MajorFunction = %lu UNIMPLEMENTED\n", + DeviceObject, stk->MajorFunction); - Irp->IoStatus.Status = Status; + Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; IoCompleteRequest(Irp, IO_NO_INCREMENT); - return Status; + return STATUS_NOT_IMPLEMENTED; } /* @@ -1305,8 +1552,8 @@ DriverEntry( DPRINT("Screen Driver 0.0.6\n"); - DriverObject->MajorFunction[IRP_MJ_CREATE] = ScrCreate; - DriverObject->MajorFunction[IRP_MJ_CLOSE] = ScrDispatch; + DriverObject->MajorFunction[IRP_MJ_CREATE] = ScrCreateClose; + DriverObject->MajorFunction[IRP_MJ_CLOSE] = ScrCreateClose; DriverObject->MajorFunction[IRP_MJ_READ] = ScrDispatch; DriverObject->MajorFunction[IRP_MJ_WRITE] = ScrWrite; DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = ScrIoControl; diff --git a/sdk/include/reactos/drivers/blue/ntddblue.h b/sdk/include/reactos/drivers/blue/ntddblue.h index 5c6df7bfff7..0d41d0f158d 100644 --- a/sdk/include/reactos/drivers/blue/ntddblue.h +++ b/sdk/include/reactos/drivers/blue/ntddblue.h @@ -11,13 +11,13 @@ #define IOCTL_CONSOLE_SET_MODE CTL_CODE(FILE_DEVICE_SCREEN, 0x806, METHOD_BUFFERED, FILE_WRITE_ACCESS) #define IOCTL_CONSOLE_FILL_OUTPUT_ATTRIBUTE CTL_CODE(FILE_DEVICE_SCREEN, 0x810, METHOD_BUFFERED, FILE_WRITE_ACCESS) -#define IOCTL_CONSOLE_READ_OUTPUT_ATTRIBUTE CTL_CODE(FILE_DEVICE_SCREEN, 0x811, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) -#define IOCTL_CONSOLE_WRITE_OUTPUT_ATTRIBUTE CTL_CODE(FILE_DEVICE_SCREEN, 0x812, METHOD_IN_DIRECT, FILE_ANY_ACCESS) +#define IOCTL_CONSOLE_READ_OUTPUT_ATTRIBUTE CTL_CODE(FILE_DEVICE_SCREEN, 0x811, METHOD_OUT_DIRECT, FILE_READ_ACCESS) +#define IOCTL_CONSOLE_WRITE_OUTPUT_ATTRIBUTE CTL_CODE(FILE_DEVICE_SCREEN, 0x812, METHOD_IN_DIRECT, FILE_WRITE_ACCESS) #define IOCTL_CONSOLE_SET_TEXT_ATTRIBUTE CTL_CODE(FILE_DEVICE_SCREEN, 0x813, METHOD_BUFFERED, FILE_WRITE_ACCESS) #define IOCTL_CONSOLE_FILL_OUTPUT_CHARACTER CTL_CODE(FILE_DEVICE_SCREEN, 0x820, METHOD_BUFFERED, FILE_WRITE_ACCESS) -#define IOCTL_CONSOLE_READ_OUTPUT_CHARACTER CTL_CODE(FILE_DEVICE_SCREEN, 0x821, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) -#define IOCTL_CONSOLE_WRITE_OUTPUT_CHARACTER CTL_CODE(FILE_DEVICE_SCREEN, 0x822, METHOD_IN_DIRECT, FILE_ANY_ACCESS) +#define IOCTL_CONSOLE_READ_OUTPUT_CHARACTER CTL_CODE(FILE_DEVICE_SCREEN, 0x821, METHOD_OUT_DIRECT, FILE_READ_ACCESS) +#define IOCTL_CONSOLE_WRITE_OUTPUT_CHARACTER CTL_CODE(FILE_DEVICE_SCREEN, 0x822, METHOD_IN_DIRECT, FILE_WRITE_ACCESS) #define IOCTL_CONSOLE_DRAW CTL_CODE(FILE_DEVICE_SCREEN, 0x830, METHOD_IN_DIRECT, FILE_WRITE_ACCESS) @@ -48,12 +48,12 @@ typedef struct tagOUTPUT_CHARACTER typedef struct tagCONSOLE_DRAW { - ULONG X; /* Origin */ - ULONG Y; - ULONG SizeX; /* Size of the screen buffer (chars) */ - ULONG SizeY; - ULONG CursorX; /* New cursor position (screen-relative) */ - ULONG CursorY; + USHORT X; /* Origin */ + USHORT Y; + USHORT SizeX; /* Size of the screen buffer (chars) */ + USHORT SizeY; + USHORT CursorX; /* New cursor position (screen-relative) */ + USHORT CursorY; /* Followed by screen buffer in char/attrib format */ } CONSOLE_DRAW, *PCONSOLE_DRAW;
4 years, 11 months
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
14
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Results per page:
10
25
50
100
200