ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
August 2016
----- 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
20 participants
462 discussions
Start a n
N
ew thread
[akhaldi] 72338: [COMDLG32] Sync with Wine Staging 1.9.16. CORE-11866
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Aug 19 09:24:04 2016 New Revision: 72338 URL:
http://svn.reactos.org/svn/reactos?rev=72338&view=rev
Log: [COMDLG32] Sync with Wine Staging 1.9.16. CORE-11866 Modified: trunk/reactos/dll/win32/comdlg32/colordlg.c trunk/reactos/dll/win32/comdlg32/filedlg.c trunk/reactos/dll/win32/comdlg32/itemdlg.c trunk/reactos/dll/win32/comdlg32/printdlg.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/comdlg32/colordlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/colordl…
============================================================================== --- trunk/reactos/dll/win32/comdlg32/colordlg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comdlg32/colordlg.c [iso-8859-1] Fri Aug 19 09:24:04 2016 @@ -235,7 +235,7 @@ /* draw it */ hdc = GetDC(hwnd); DrawFocusRect(hdc, &rect); - CopyRect(&lpp->focusRect, &rect); + lpp->focusRect = rect; lpp->hwndFocus = hwnd; ReleaseDC(hwnd, hdc); } Modified: trunk/reactos/dll/win32/comdlg32/filedlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/filedlg…
============================================================================== --- trunk/reactos/dll/win32/comdlg32/filedlg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comdlg32/filedlg.c [iso-8859-1] Fri Aug 19 09:24:04 2016 @@ -196,6 +196,7 @@ static LPITEMIDLIST GetPidlFromName(IShellFolder *psf,LPWSTR lpcstrFileName); static BOOL IsPidlFolder (LPSHELLFOLDER psf, LPCITEMIDLIST pidl); static UINT GetNumSelected( IDataObject *doSelected ); +static void COMCTL32_ReleaseStgMedium(STGMEDIUM medium); /* Shell memory allocation */ static void *MemAlloc(UINT size); @@ -3588,6 +3589,25 @@ } /*********************************************************************** + * get_def_format + * + * Fill the FORMATETC used in the shell id list + */ +static FORMATETC get_def_format(void) +{ + static CLIPFORMAT cfFormat; + FORMATETC formatetc; + + if (!cfFormat) cfFormat = RegisterClipboardFormatA(CFSTR_SHELLIDLISTA); + formatetc.cfFormat = cfFormat; + formatetc.ptd = 0; + formatetc.dwAspect = DVASPECT_CONTENT; + formatetc.lindex = -1; + formatetc.tymed = TYMED_HGLOBAL; + return formatetc; +} + +/*********************************************************************** * FILEDLG95_FILENAME_FillFromSelection * * fills the edit box from the cached DataObject @@ -3596,84 +3616,72 @@ { FileOpenDlgInfos *fodInfos; LPITEMIDLIST pidl; - UINT nFiles = 0, nFileToOpen, nFileSelected, nLength = 0; - WCHAR lpstrTemp[MAX_PATH]; - LPWSTR lpstrAllFile, lpstrCurrFile; + LPWSTR lpstrAllFiles, lpstrTmp; + UINT nFiles = 0, nFileToOpen, nFileSelected, nAllFilesLength = 0, nThisFileLength, nAllFilesMaxLength; + STGMEDIUM medium; + LPIDA cida; + FORMATETC formatetc = get_def_format(); TRACE("\n"); fodInfos = GetPropA(hwnd,FileOpenDlgInfosStr); - /* Count how many files we have */ - nFileSelected = GetNumSelected( fodInfos->Shell.FOIDataObject ); - - /* calculate the string length, count files */ - if (nFileSelected >= 1) - { - nLength += 3; /* first and last quotes, trailing \0 */ - for ( nFileToOpen = 0; nFileToOpen < nFileSelected; nFileToOpen++ ) - { - pidl = GetPidlFromDataObject( fodInfos->Shell.FOIDataObject, nFileToOpen+1 ); - + if (FAILED(IDataObject_GetData(fodInfos->Shell.FOIDataObject, &formatetc, &medium))) + return; + + cida = GlobalLock(medium.u.hGlobal); + nFileSelected = cida->cidl; + + /* Allocate a buffer */ + nAllFilesMaxLength = MAX_PATH + 3; + lpstrAllFiles = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nAllFilesMaxLength * sizeof(WCHAR)); + if (!lpstrAllFiles) + goto ret; + + /* Loop through the selection, handle only files (not folders) */ + for (nFileToOpen = 0; nFileToOpen < nFileSelected; nFileToOpen++) + { + pidl = (LPITEMIDLIST)((LPBYTE)cida + cida->aoffset[nFileToOpen + 1]); if (pidl) - { - /* get the total length of the selected file names */ - lpstrTemp[0] = '\0'; - GetName( fodInfos->Shell.FOIShellFolder, pidl, SHGDN_INFOLDER|SHGDN_FORPARSING, lpstrTemp ); - - if ( ! IsPidlFolder(fodInfos->Shell.FOIShellFolder, pidl) ) /* Ignore folders */ - { - nLength += lstrlenW( lpstrTemp ) + 3; - nFiles++; - } - COMDLG32_SHFree( pidl ); - } - } - } - - /* allocate the buffer */ - if (nFiles <= 1) nLength = MAX_PATH; - lpstrAllFile = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nLength * sizeof(WCHAR)); - - /* Generate the string for the edit control */ - if(nFiles >= 1) - { - lpstrCurrFile = lpstrAllFile; - for ( nFileToOpen = 0; nFileToOpen < nFileSelected; nFileToOpen++ ) - { - pidl = GetPidlFromDataObject( fodInfos->Shell.FOIDataObject, nFileToOpen+1 ); - - if (pidl) - { - /* get the file name */ - lpstrTemp[0] = '\0'; - GetName( fodInfos->Shell.FOIShellFolder, pidl, SHGDN_INFOLDER|SHGDN_FORPARSING, lpstrTemp ); - - if (! IsPidlFolder(fodInfos->Shell.FOIShellFolder, pidl)) /* Ignore folders */ - { - if ( nFiles > 1) - { - *lpstrCurrFile++ = '\"'; - lstrcpyW( lpstrCurrFile, lpstrTemp ); - lpstrCurrFile += lstrlenW( lpstrTemp ); - *lpstrCurrFile++ = '\"'; - *lpstrCurrFile++ = ' '; - *lpstrCurrFile = 0; - } - else - { - lstrcpyW( lpstrAllFile, lpstrTemp ); - } - } - COMDLG32_SHFree( pidl ); - } - } - SetWindowTextW( fodInfos->DlgInfos.hwndFileName, lpstrAllFile ); - - /* Select the file name like Windows does */ - if (filename_is_edit( fodInfos )) - SendMessageW(fodInfos->DlgInfos.hwndFileName, EM_SETSEL, 0, -1); - } - HeapFree(GetProcessHeap(),0, lpstrAllFile ); + { + if (!IsPidlFolder(fodInfos->Shell.FOIShellFolder, pidl)) + { + if (nAllFilesLength + MAX_PATH + 3 > nAllFilesMaxLength) + { + nAllFilesMaxLength *= 2; + lpstrTmp = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, lpstrAllFiles, nAllFilesMaxLength * sizeof(WCHAR)); + if (!lpstrTmp) + goto ret; + lpstrAllFiles = lpstrTmp; + } + nFiles += 1; + lpstrAllFiles[nAllFilesLength++] = '"'; + GetName(fodInfos->Shell.FOIShellFolder, pidl, SHGDN_INFOLDER | SHGDN_FORPARSING, lpstrAllFiles + nAllFilesLength); + nThisFileLength = lstrlenW(lpstrAllFiles + nAllFilesLength); + nAllFilesLength += nThisFileLength; + lpstrAllFiles[nAllFilesLength++] = '"'; + lpstrAllFiles[nAllFilesLength++] = ' '; + } + } + } + + if (nFiles != 0) + { + /* If there's only one file, use the name as-is without quotes */ + lpstrTmp = lpstrAllFiles; + if (nFiles == 1) + { + lpstrTmp += 1; + lpstrTmp[nThisFileLength] = 0; + } + SetWindowTextW(fodInfos->DlgInfos.hwndFileName, lpstrTmp); + /* Select the file name like Windows does */ + if (filename_is_edit(fodInfos)) + SendMessageW(fodInfos->DlgInfos.hwndFileName, EM_SETSEL, 0, -1); + } + +ret: + HeapFree(GetProcessHeap(), 0, lpstrAllFiles); + COMCTL32_ReleaseStgMedium(medium); } @@ -3733,15 +3741,6 @@ MemFree(lpstrEdit); return nFileCount; } - -#define SETDefFormatEtc(fe,cf,med) \ -{ \ - (fe).cfFormat = cf;\ - (fe).dwAspect = DVASPECT_CONTENT; \ - (fe).ptd =NULL;\ - (fe).tymed = med;\ - (fe).lindex = -1;\ -}; /* * DATAOBJECT Helper functions @@ -3776,16 +3775,13 @@ { STGMEDIUM medium; - FORMATETC formatetc; + FORMATETC formatetc = get_def_format(); LPITEMIDLIST pidl = NULL; TRACE("sv=%p index=%u\n", doSelected, nPidlIndex); if (!doSelected) return NULL; - - /* Set the FORMATETC structure*/ - SETDefFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLISTA), TYMED_HGLOBAL); /* Get the pidls from IDataObject */ if(SUCCEEDED(IDataObject_GetData(doSelected,&formatetc,&medium))) @@ -3810,14 +3806,11 @@ { UINT retVal = 0; STGMEDIUM medium; - FORMATETC formatetc; + FORMATETC formatetc = get_def_format(); TRACE("sv=%p\n", doSelected); if (!doSelected) return 0; - - /* Set the FORMATETC structure*/ - SETDefFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLISTA), TYMED_HGLOBAL); /* Get the pidls from IDataObject */ if(SUCCEEDED(IDataObject_GetData(doSelected,&formatetc,&medium))) Modified: trunk/reactos/dll/win32/comdlg32/itemdlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/itemdlg…
============================================================================== --- trunk/reactos/dll/win32/comdlg32/itemdlg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comdlg32/itemdlg.c [iso-8859-1] Fri Aug 19 09:24:04 2016 @@ -386,14 +386,12 @@ static BOOL set_file_name(FileDialogImpl *This, LPCWSTR str) { - HWND hwnd_edit = GetDlgItem(This->dlg_hwnd, IDC_FILENAME); - if(This->set_filename) LocalFree(This->set_filename); - This->set_filename = StrDupW(str); - - return SendMessageW(hwnd_edit, WM_SETTEXT, 0, (LPARAM)str); + This->set_filename = str ? StrDupW(str) : NULL; + + return SetDlgItemTextW(This->dlg_hwnd, IDC_FILENAME, This->set_filename); } static void fill_filename_from_selection(FileDialogImpl *This) @@ -2610,10 +2608,8 @@ return E_INVALIDARG; *pszName = NULL; - if(get_file_name(This, pszName)) - return S_OK; - else - return E_FAIL; + get_file_name(This, pszName); + return *pszName ? S_OK : E_FAIL; } static HRESULT WINAPI IFileDialog2_fnSetTitle(IFileDialog2 *iface, LPCWSTR pszTitle) Modified: trunk/reactos/dll/win32/comdlg32/printdlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/printdl…
============================================================================== --- trunk/reactos/dll/win32/comdlg32/printdlg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comdlg32/printdlg.c [iso-8859-1] Fri Aug 19 09:24:04 2016 @@ -3595,11 +3595,8 @@ default_page_paint_hook(hWnd, WM_PSD_MARGINRECT, (WPARAM)hdc, (LPARAM)&rcMargin, data); /* give text a bit of a space from the frame */ - rcMargin.left += 2; - rcMargin.top += 2; - rcMargin.right -= 2; - rcMargin.bottom -= 2; - + InflateRect(&rcMargin, -2, -2); + /* if the space is too small then we make sure to not draw anything */ rcMargin.left = min(rcMargin.left, rcMargin.right); rcMargin.top = min(rcMargin.top, rcMargin.bottom); Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Fri Aug 19 09:24:04 2016 @@ -55,7 +55,7 @@ reactos/dll/win32/clusapi # Synced to WineStaging-1.9.11 reactos/dll/win32/comcat # Synced to WineStaging-1.9.11 reactos/dll/win32/comctl32 # Synced to WineStaging-1.9.16 -reactos/dll/win32/comdlg32 # Synced to WineStaging-1.9.11 +reactos/dll/win32/comdlg32 # Synced to WineStaging-1.9.16 reactos/dll/win32/compstui # Synced to WineStaging-1.9.11 reactos/dll/win32/credui # Synced to WineStaging-1.9.16 reactos/dll/win32/crypt32 # Synced to WineStaging-1.9.16
8 years, 4 months
1
0
0
0
[akhaldi] 72337: [SETUPAPI_WINETEST] Sync with Wine Staging 1.9.16. CORE-11866
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Aug 19 09:21:44 2016 New Revision: 72337 URL:
http://svn.reactos.org/svn/reactos?rev=72337&view=rev
Log: [SETUPAPI_WINETEST] Sync with Wine Staging 1.9.16. CORE-11866 Modified: trunk/rostests/winetests/setupapi/install.c Modified: trunk/rostests/winetests/setupapi/install.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/setupapi/instal…
============================================================================== --- trunk/rostests/winetests/setupapi/install.c [iso-8859-1] (original) +++ trunk/rostests/winetests/setupapi/install.c [iso-8859-1] Fri Aug 19 09:21:44 2016 @@ -655,7 +655,7 @@ ok(ERROR_DIRECTORY == GetLastError(), "expected error ERROR_DIRECTORY, got %d\n", GetLastError()); - /* now check the buffer content of a vaild call + /* now check the buffer contents of a valid call */ *ptr = 0; expected = 3 + strlen(inffile) + strlen(inffile2);
8 years, 4 months
1
0
0
0
[akhaldi] 72336: [PSDK] Update icftypes.idl. CORE-11866
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Aug 19 09:20:52 2016 New Revision: 72336 URL:
http://svn.reactos.org/svn/reactos?rev=72336&view=rev
Log: [PSDK] Update icftypes.idl. CORE-11866 Modified: trunk/reactos/sdk/include/psdk/icftypes.idl Modified: trunk/reactos/sdk/include/psdk/icftypes.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/icftypes.…
============================================================================== --- trunk/reactos/sdk/include/psdk/icftypes.idl [iso-8859-1] (original) +++ trunk/reactos/sdk/include/psdk/icftypes.idl [iso-8859-1] Fri Aug 19 09:20:52 2016 @@ -28,6 +28,14 @@ NET_FW_PROFILE_CURRENT, NET_FW_PROFILE_TYPE_MAX } NET_FW_PROFILE_TYPE; + +typedef enum NET_FW_PROFILE_TYPE2_ +{ + NET_FW_PROFILE2_DOMAIN = 0x0001, + NET_FW_PROFILE2_PRIVATE = 0x0002, + NET_FW_PROFILE2_PUBLIC = 0x0004, + NET_FW_PROFILE2_ALL = 0x7FFFFFFF +} NET_FW_PROFILE_TYPE2; typedef enum NET_FW_IP_VERSION_ { @@ -67,3 +75,24 @@ NET_FW_IP_PROTOCOL_TCP = 6, NET_FW_IP_PROTOCOL_UDP = 17 } NET_FW_IP_PROTOCOL; + +typedef enum NET_FW_RULE_DIRECTION_ +{ + NET_FW_RULE_DIR_IN = 1, + NET_FW_RULE_DIR_OUT, + NET_FW_RULE_DIR_MAX +} NET_FW_RULE_DIRECTION; + +typedef enum NET_FW_ACTION_ +{ + NET_FW_ACTION_BLOCK, + NET_FW_ACTION_ALLOW, + NET_FW_ACTION_MAX +} NET_FW_ACTION; + +typedef enum NET_FW_MODIFY_STATE_ +{ + NET_FW_MODIFY_STATE_OK, + NET_FW_MODIFY_STATE_GP_OVERRIDE, + NET_FW_MODIFY_STATE_INBOUND_BLOCKED +} NET_FW_MODIFY_STATE;
8 years, 4 months
1
0
0
0
[jimtabor] 72335: [NtUser] - Patch by Józef Kucia : Prevent resetting WS_MINIMIZE through SetWindowLong.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Aug 18 23:37:42 2016 New Revision: 72335 URL:
http://svn.reactos.org/svn/reactos?rev=72335&view=rev
Log: [NtUser] - Patch by Józef Kucia : Prevent resetting WS_MINIMIZE through SetWindowLong. Modified: trunk/reactos/win32ss/user/ntuser/window.c Modified: trunk/reactos/win32ss/user/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/window…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] Thu Aug 18 23:37:42 2016 @@ -3587,8 +3587,10 @@ if (!bAlter) co_IntSendMessage(hWnd, WM_STYLECHANGING, GWL_STYLE, (LPARAM) &Style); - /* WS_CLIPSIBLINGS can't be reset on top-level windows */ + /* WS_CLIPSIBLINGS can't be reset on top-level windows */ if (Window->spwndParent == UserGetDesktopWindow()) Style.styleNew |= WS_CLIPSIBLINGS; + /* WS_MINIMIZE can't be reset */ + if (OldValue & WS_MINIMIZE) Style.styleNew |= WS_MINIMIZE; /* Fixes wine FIXME: changing WS_DLGFRAME | WS_THICKFRAME is supposed to change WS_EX_WINDOWEDGE too */ if (IntCheckFrameEdge(NewValue, Window->ExStyle)) Window->ExStyle |= WS_EX_WINDOWEDGE;
8 years, 4 months
1
0
0
0
[zhu] 72334: Added back UDP code from the original driver I received to work on. Modified address creation function to support UDP, ICMP, and RAW. Added TDI_QUERY_ADDRESS_INFO handler.
by zhu@svn.reactos.org
Author: zhu Date: Thu Aug 18 21:38:06 2016 New Revision: 72334 URL:
http://svn.reactos.org/svn/reactos?rev=72334&view=rev
Log: Added back UDP code from the original driver I received to work on. Modified address creation function to support UDP, ICMP, and RAW. Added TDI_QUERY_ADDRESS_INFO handler. Modified: branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/address.c branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/information.c branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/main.c Modified: branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/address.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/lwIP-tcpip/drivers/ne…
============================================================================== --- branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/address.c [iso-8859-1] (original) +++ branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/address.c [iso-8859-1] Thu Aug 18 21:38:06 2016 @@ -212,6 +212,10 @@ static LIST_ENTRY AddressListHead; /* Forward-declare lwIP callback functions */ +static u8_t lwip_raw_ReceiveDatagram_callback(void *arg, struct raw_pcb *pcb, struct pbuf *p, + ip_addr_t *addr); +static void lwip_udp_ReceiveDatagram_callback(void *arg, struct udp_pcb *pcb, struct pbuf *p, + ip_addr_t *addr, u16_t port); static err_t lwip_tcp_accept_callback(void *arg, struct tcp_pcb *newpcb, err_t err); static err_t lwip_tcp_recv_callback(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err); static err_t lwip_tcp_sent_callback(void *arg, struct tcp_pcb *tpcb, u16_t len); @@ -1690,6 +1694,90 @@ return Status; } +static +BOOLEAN +ReceiveDatagram( + ADDRESS_FILE* AddressFile, + struct pbuf *p, + ip_addr_t *addr, + u16_t port) +{ + KIRQL OldIrql; + LIST_ENTRY* ListEntry; + RECEIVE_DATAGRAM_REQUEST* Request; + ip_addr_t RequestAddr; + BOOLEAN Result = FALSE; + + NT_ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL); + + DPRINT1("Receiving datagram for addr 0x%08x on port %u.\n", ip4_addr_get_u32(addr), port); + + /* Block any cancellation that could occur */ + IoAcquireCancelSpinLock(&OldIrql); + KeAcquireSpinLockAtDpcLevel(&AddressFile->RequestLock); + + ListEntry = AddressFile->RequestListHead.Flink; + while (ListEntry != &AddressFile->RequestListHead) + { + Request = CONTAINING_RECORD(ListEntry, RECEIVE_DATAGRAM_REQUEST, ListEntry); + ListEntry = ListEntry->Flink; + + ip4_addr_set_u32(&RequestAddr, Request->RemoteAddress.in_addr); + + if ((RequestAddr.addr == IPADDR_ANY) || + (ip_addr_cmp(&RequestAddr, addr) && + ((Request->RemoteAddress.sin_port == lwip_htons(port)) || !port))) + { + PTA_IP_ADDRESS ReturnAddress; + PIRP Irp; + + DPRINT1("Found a corresponding IRP.\n"); + + Irp = Request->Irp; + + /* We found a request for this one */ + IoSetCancelRoutine(Irp, NULL); + RemoveEntryList(&Request->ListEntry); + Result = TRUE; + + KeReleaseSpinLockFromDpcLevel(&AddressFile->RequestLock); + IoReleaseCancelSpinLock(OldIrql); + + /* In case of UDP, lwip provides a pbuf directly pointing to the data. + * In other case, we must skip the IP header */ + Irp->IoStatus.Information = pbuf_copy_partial( + p, + Request->Buffer, + Request->BufferLength, + 0); + ReturnAddress = Request->ReturnInfo->RemoteAddress; + ReturnAddress->Address->AddressLength = TDI_ADDRESS_LENGTH_IP; + ReturnAddress->Address->AddressType = TDI_ADDRESS_TYPE_IP; + ReturnAddress->Address->Address->sin_port = lwip_htons(port); + ReturnAddress->Address->Address->in_addr = ip4_addr_get_u32(addr); + RtlZeroMemory(ReturnAddress->Address->Address->sin_zero, + sizeof(ReturnAddress->Address->Address->sin_zero)); + + if (Request->BufferLength < p->tot_len) + Irp->IoStatus.Status = STATUS_BUFFER_OVERFLOW; + else + Irp->IoStatus.Status = STATUS_SUCCESS; + IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + + ExFreePoolWithTag(Request, TAG_ADDRESS_FILE); + + /* Start again from the beginning */ + IoAcquireCancelSpinLock(&OldIrql); + KeAcquireSpinLockAtDpcLevel(&AddressFile->RequestLock); + } + } + + KeReleaseSpinLockFromDpcLevel(&AddressFile->RequestLock); + IoReleaseCancelSpinLock(OldIrql); + + return Result; +} + /** * TCP/IP Stack Functions **/ @@ -1809,6 +1897,8 @@ { PADDRESS_FILE AddressFile; PLIST_ENTRY Entry; + + ip_addr_t IpAddr; /* If a netif is specified, check for AddressFile with matching netif and port in order to * detect duplicates */ @@ -1859,18 +1949,34 @@ RtlCopyMemory(&AddressFile->Address, Address, sizeof(*Address)); AddressFile->NetInterface = lwip_netif; - /* Entity ID */ + /* Entity ID and, for unconnected protocols, lwIP PCB and callback functions. */ switch (Protocol) { case IPPROTO_TCP : InsertEntityInstance(CO_TL_ENTITY, &AddressFile->Instance); break; - case IPPROTO_ICMP : - InsertEntityInstance(ER_ENTITY, &AddressFile->Instance); + case IPPROTO_UDP : + ip4_addr_set_u32(&IpAddr, AddressFile->Address.in_addr); + InsertEntityInstance(CL_TL_ENTITY, &AddressFile->Instance); + AddressFile->lwip_udp_pcb = udp_new(); + udp_bind(AddressFile->lwip_udp_pcb, &IpAddr, lwip_ntohs(AddressFile->Address.sin_port)); + ip_set_option(AddressFile->lwip_udp_pcb, SOF_BROADCAST); + udp_recv(AddressFile->lwip_udp_pcb, lwip_udp_ReceiveDatagram_callback, AddressFile); break; default : - /* UDP, RAW */ - InsertEntityInstance(CL_TL_ENTITY, &AddressFile->Instance); + if (Protocol == IPPROTO_ICMP) + { + InsertEntityInstance(ER_ENTITY, &AddressFile->Instance); + } + else + { + InsertEntityInstance(CL_TL_ENTITY, &AddressFile->Instance); + } + ip4_addr_set_u32(&IpAddr, AddressFile->Address.in_addr); + AddressFile->lwip_raw_pcb = raw_new(Protocol); + raw_bind(AddressFile->lwip_raw_pcb, &IpAddr); + ip_set_option(AddressFile->lwip_raw_pcb, SOF_BROADCAST); + raw_recv(AddressFile->lwip_raw_pcb, lwip_raw_ReceiveDatagram_callback, AddressFile); break; } @@ -1880,7 +1986,6 @@ /* UDP and RAW variables */ KeInitializeSpinLock(&AddressFile->RequestLock); InitializeListHead(&AddressFile->RequestListHead); - AddressFile->lwip_raw_pcb = NULL; /* Add to master list */ InsertTailList(&AddressListHead, &AddressFile->ListEntry); @@ -1988,6 +2093,66 @@ /** * lwIP Callback Functions **/ + +static +u8_t +lwip_raw_ReceiveDatagram_callback( + void *arg, + struct raw_pcb *pcb, + struct pbuf *p, + ip_addr_t *addr) +{ + BOOLEAN Result; + ADDRESS_FILE* AddressFile = arg; + + UNREFERENCED_PARAMETER(pcb); + + /* If this is for ICMP, only process the "echo received" packets. + * The rest is processed by lwip. */ + if (AddressFile->Protocol == IPPROTO_ICMP) + { + /* See icmp_input */ + s16_t hlen; + struct ip_hdr *iphdr; + + iphdr = (struct ip_hdr *)p->payload; + hlen = IPH_HL(iphdr) * 4; + + /* Adjust the pbuf to skip the IP header */ + if (pbuf_header(p, -hlen)) + return FALSE; + + if (*((u8_t*)p->payload) != ICMP_ER) + { + pbuf_header(p, hlen); + return FALSE; + } + + pbuf_header(p, hlen); + } + + Result = ReceiveDatagram(arg, p, addr, 0); + + if (Result) + pbuf_free(p); + + return Result; +} + +static +void +lwip_udp_ReceiveDatagram_callback( + void *arg, + struct udp_pcb *pcb, + struct pbuf *p, + ip_addr_t *addr, + u16_t port) +{ + UNREFERENCED_PARAMETER(pcb); + + ReceiveDatagram(arg, p, addr, port); + pbuf_free(p); +} static err_t Modified: branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/information.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/lwIP-tcpip/drivers/ne…
============================================================================== --- branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/information.c [iso-8859-1] (original) +++ branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/information.c [iso-8859-1] Thu Aug 18 21:38:06 2016 @@ -158,6 +158,31 @@ /* See what we are queried */ switch (Query->QueryType) { + case TDI_QUERY_ADDRESS_INFO : + PTDI_ADDRESS_INFO AddressInfo; + PADDRESS_FILE AddressFile; + PTA_ADDRESS TAAddress; + + if (MmGetMdlByteCount(Irp->MdlAddress) < sizeof(*AddressInfo)) { + DPRINT1("MDL buffer too small.\n"); + Status = STATUS_BUFFER_TOO_SMALL; + break; + } + + AddressFile = IrpSp->FileObject->FsContext; + + AddressInfo = MmGetSystemAddressForMdl(Irp->MdlAddress); + AddressInfo->ActivityCount = AddressFile->RefCount; + AddressInfo->Address.TAAddressCount = 1; + + TAAddress = AddressInfo->Address.Address; + TAAddress->AddressLength = TDI_ADDRESS_LENGTH_IP; + TAAddress->AddressType = TDI_ADDRESS_TYPE_IP; + RtlCopyMemory(&TAAddress->Address[0], &AddressFile->Address, TDI_ADDRESS_LENGTH_IP); + + Status = STATUS_SUCCESS; + + break; case TDI_QUERY_MAX_DATAGRAM_INFO: { PTDI_MAX_DATAGRAM_INFO MaxDatagramInfo; Modified: branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/main.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/lwIP-tcpip/drivers/ne…
============================================================================== --- branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/main.c [iso-8859-1] (original) +++ branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/main.c [iso-8859-1] Thu Aug 18 21:38:06 2016 @@ -428,9 +428,7 @@ break; case TDI_RECEIVE_DATAGRAM: DPRINT1("TCPIP: TDI_RECEIVE_DATAGRAM!\n"); - Status = STATUS_NOT_IMPLEMENTED; - break; - //return TcpIpReceiveDatagram(Irp); + return TcpIpReceiveDatagram(Irp); case TDI_SEND: DPRINT1("TCPIP: TDI_SEND!\n"); @@ -456,9 +454,7 @@ case TDI_SEND_DATAGRAM: DPRINT1("TCPIP: TDI_SEND_DATAGRAM!\n"); - Status = STATUS_NOT_IMPLEMENTED; - break; - //return TcpIpSendDatagram(Irp); + return TcpIpSendDatagram(Irp); case TDI_ACCEPT: DPRINT1("TCPIP: TDI_ACCEPT!\n");
8 years, 4 months
1
0
0
0
[mjansen] 72333: Addendum to r72332
by mjansen@svn.reactos.org
Author: mjansen Date: Thu Aug 18 19:34:12 2016 New Revision: 72333 URL:
http://svn.reactos.org/svn/reactos?rev=72333&view=rev
Log: Addendum to r72332 Modified: trunk/reactos/sdk/include/psdk/gdipluscolor.h Modified: trunk/reactos/sdk/include/psdk/gdipluscolor.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/gdiplusco…
============================================================================== --- trunk/reactos/sdk/include/psdk/gdipluscolor.h [iso-8859-1] (original) +++ trunk/reactos/sdk/include/psdk/gdipluscolor.h [iso-8859-1] Thu Aug 18 19:34:12 2016 @@ -106,7 +106,7 @@ VOID SetFromCOLORREF(COLORREF rgb) { - Argb = 0xff000000 | rgb & 0x000000ff << 16 | rgb & 0x0000ff00 | rgb & 0x00ff0000 >> 16; + Argb = 0xff000000 | (rgb & 0x000000ff) << 16 | (rgb & 0x0000ff00) | (rgb & 0x00ff0000) >> 16; } VOID SetValue(ARGB argb) @@ -116,7 +116,7 @@ COLORREF ToCOLORREF(VOID) { - return Argb & 0x000000ff << 16 | Argb & 0x0000ff00 | Argb & 0x00ff0000 >> 16; + return (Argb & 0x000000ff) << 16 | (Argb & 0x0000ff00) | (Argb & 0x00ff0000) >> 16; } protected:
8 years, 4 months
1
0
0
0
[mjansen] 72332: [ATL][ATL_APITEST] Add CImage initial implementation + tests, by Katayama Hirofumi MZ. CORE-10029 #comment Thanks, first iteration committed! - Tests focus mainly on loading + savi...
by mjansen@svn.reactos.org
Author: mjansen Date: Thu Aug 18 19:27:49 2016 New Revision: 72332 URL:
http://svn.reactos.org/svn/reactos?rev=72332&view=rev
Log: [ATL][ATL_APITEST] Add CImage initial implementation + tests, by Katayama Hirofumi MZ. CORE-10029 #comment Thanks, first iteration committed! - Tests focus mainly on loading + saving images. - The implementation is not perfect yet, see CImage_WIP.txt for test results. - The GDI+ functions should be fixed before this test can pass fully, MS' ATL fails in ReactOS, but passes on Windows. Added: trunk/reactos/sdk/lib/atl/atlimage.h (with props) trunk/rostests/apitests/atl/CImage.cpp (with props) trunk/rostests/apitests/atl/CImage_WIP.txt (with props) trunk/rostests/apitests/atl/ant.bmp (with props) trunk/rostests/apitests/atl/cross.bmp (with props) trunk/rostests/apitests/atl/devenv/ trunk/rostests/apitests/atl/devenv/CImage.sln (with props) trunk/rostests/apitests/atl/devenv/CImage.vcxproj (with props) Modified: trunk/reactos/sdk/lib/atl/atlcom.h trunk/rostests/apitests/atl/CMakeLists.txt trunk/rostests/apitests/atl/atl_apitest.rc trunk/rostests/apitests/atl/resource.h trunk/rostests/apitests/atl/testlist.c Modified: trunk/reactos/sdk/lib/atl/atlcom.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/atl/atlcom.h?rev=7…
============================================================================== --- trunk/reactos/sdk/lib/atl/atlcom.h [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/atl/atlcom.h [iso-8859-1] Thu Aug 18 19:27:49 2016 @@ -21,6 +21,8 @@ #pragma once +#include <cguid.h> // for GUID_NULL + namespace ATL { Added: trunk/reactos/sdk/lib/atl/atlimage.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/atl/atlimage.h?rev…
============================================================================== --- trunk/reactos/sdk/lib/atl/atlimage.h (added) +++ trunk/reactos/sdk/lib/atl/atlimage.h [iso-8859-1] Thu Aug 18 19:27:49 2016 @@ -0,0 +1,1142 @@ +// PROJECT: ReactOS ATL CImage +// LICENSE: Public Domain +// PURPOSE: Provides compatibility to Microsoft ATL +// PROGRAMMERS: Katayama Hirofumi MZ (katayama.hirofumi.mz(a)gmail.com) + +#ifndef __ATLIMAGE_H__ +#define __ATLIMAGE_H__ + +// !!!! +// TODO: The backend (gdi+) that this class relies on is not yet complete! +// Before that is finished, this class will not be a perfect replacement. +// See rostest/apitests/atl/CImage_WIP.txt for test results. +// !!!! + +// TODO: GetImporterFilterString, GetExporterFilterString, Load, Save +// TODO: make CImage thread-safe + +#pragma once + +#include <atlcore.h> + +#include <wingdi.h> +#include <cguid.h> // for GUID_NULL +#include <gdiplus.h> // GDI+ + +namespace ATL +{ + +class CImage +{ +public: + // flags for CImage::Create/CreateEx + enum + { + createAlphaChannel = 1 // enable alpha + }; + + // orientation of DIB + enum DIBOrientation + { + DIBOR_DEFAULT, // default + DIBOR_BOTTOMUP, // bottom-up DIB + DIBOR_TOPDOWN // top-down DIB + }; + + CImage() throw() + { + m_hbm = NULL; + m_hbmOld = NULL; + m_hDC = NULL; + + m_eOrientation = DIBOR_DEFAULT; + m_bHasAlphaCh = false; + m_bIsDIBSec = false; + m_rgbTransColor = CLR_INVALID; + ZeroMemory(&m_ds, sizeof(m_ds)); + + if (GetCommon().AddRef() == 1) + { + GetCommon().LoadLib(); + } + } + + ~CImage() + { + Destroy(); + ReleaseGDIPlus(); + } + + operator HBITMAP() + { + return m_hbm; + } + +public: + void Attach(HBITMAP hBitmap, DIBOrientation eOrientation = DIBOR_DEFAULT) + { + AttachInternal(hBitmap, eOrientation, -1); + } + + HBITMAP Detach() throw() + { + m_eOrientation = DIBOR_DEFAULT; + m_bHasAlphaCh = false; + m_rgbTransColor = CLR_INVALID; + ZeroMemory(&m_ds, sizeof(m_ds)); + + HBITMAP hBitmap = m_hbm; + m_hbm = NULL; + return hBitmap; + } + + HDC GetDC() const throw() + { + if (m_hDC) + return m_hDC; + + m_hDC = ::CreateCompatibleDC(NULL); + m_hbmOld = ::SelectObject(m_hDC, m_hbm); + return m_hDC; + } + + void ReleaseDC() const throw() + { + ATLASSERT(m_hDC); + + if (m_hDC == NULL) + return; + + if (m_hbmOld) + { + ::SelectObject(m_hDC, m_hbmOld); + m_hbmOld = NULL; + } + ::DeleteDC(m_hDC); + m_hDC = NULL; + } + +public: + BOOL AlphaBlend(HDC hDestDC, + int xDest, int yDest, int nDestWidth, int nDestHeight, + int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, + BYTE bSrcAlpha = 0xFF, BYTE bBlendOp = AC_SRC_OVER) const + { + ATLASSERT(IsTransparencySupported()); + + BLENDFUNCTION bf; + bf.BlendOp = bBlendOp; + bf.BlendFlags = 0; + bf.SourceConstantAlpha = bSrcAlpha; + bf.AlphaFormat = AC_SRC_ALPHA; + + GetDC(); + BOOL ret = ::AlphaBlend(hDestDC, xDest, yDest, nDestWidth, nDestHeight, + m_hDC, xSrc, ySrc, nSrcWidth, nSrcHeight, bf); + ReleaseDC(); + return ret; + } + BOOL AlphaBlend(HDC hDestDC, int xDest, int yDest, + BYTE bSrcAlpha = 0xFF, BYTE bBlendOp = AC_SRC_OVER) const + { + int width = GetWidth(); + int height = GetHeight(); + return AlphaBlend(hDestDC, xDest, yDest, width, height, 0, 0, + width, height, bSrcAlpha, bBlendOp); + } + BOOL AlphaBlend(HDC hDestDC, const POINT& pointDest, + BYTE bSrcAlpha = 0xFF, BYTE bBlendOp = AC_SRC_OVER) const + { + return AlphaBlend(hDestDC, pointDest.x, pointDest.y, bSrcAlpha, bBlendOp); + } + BOOL AlphaBlend(HDC hDestDC, const RECT& rectDest, const RECT& rectSrc, + BYTE bSrcAlpha = 0xFF, BYTE bBlendOp = AC_SRC_OVER) const + { + return AlphaBlend(hDestDC, rectDest.left, rectDest.top, + rectDest.right - rectDest.left, + rectDest.bottom - rectDest.top, + rectSrc.left, rectSrc.top, + rectSrc.right - rectSrc.left, + rectSrc.bottom - rectSrc.top, + bSrcAlpha, bBlendOp); + } + + BOOL BitBlt(HDC hDestDC, int xDest, int yDest, + int nDestWidth, int nDestHeight, + int xSrc, int ySrc, DWORD dwROP = SRCCOPY) const throw() + { + GetDC(); + BOOL ret = ::BitBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight, + m_hDC, xSrc, ySrc, dwROP); + ReleaseDC(); + return ret; + } + BOOL BitBlt(HDC hDestDC, int xDest, int yDest, + DWORD dwROP = SRCCOPY) const throw() + { + return BitBlt(hDestDC, xDest, yDest, + GetWidth(), GetHeight(), 0, 0, dwROP); + } + BOOL BitBlt(HDC hDestDC, const POINT& pointDest, + DWORD dwROP = SRCCOPY) const throw() + { + return BitBlt(hDestDC, pointDest.x, pointDest.y, dwROP); + } + BOOL BitBlt(HDC hDestDC, const RECT& rectDest, const POINT& pointSrc, + DWORD dwROP = SRCCOPY) const throw() + { + return BitBlt(hDestDC, rectDest.left, rectDest.top, + rectDest.right - rectDest.left, + rectDest.bottom - rectDest.top, + pointSrc.x, pointSrc.y, dwROP); + } + + BOOL Create(int nWidth, int nHeight, int nBPP, DWORD dwFlags = 0) throw() + { + return CreateEx(nWidth, nHeight, nBPP, BI_RGB, NULL, dwFlags); + } + + BOOL CreateEx(int nWidth, int nHeight, int nBPP, DWORD eCompression, + const DWORD* pdwBitmasks = NULL, DWORD dwFlags = 0) throw() + { + return CreateInternal(nWidth, nHeight, nBPP, eCompression, pdwBitmasks, dwFlags); + } + + void Destroy() throw() + { + if (m_hbm) + { + ::DeleteObject(Detach()); + } + } + + BOOL Draw(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight, + int xSrc, int ySrc, int nSrcWidth, int nSrcHeight) const throw() + { + ATLASSERT(IsTransparencySupported()); + if (m_bHasAlphaCh) + { + return AlphaBlend(hDestDC, xDest, yDest, nDestWidth, nDestHeight, + xSrc, ySrc, nSrcWidth, nSrcHeight); + } + else if (m_rgbTransColor != CLR_INVALID) + { + COLORREF rgb; + if ((m_rgbTransColor & 0xFF000000) == 0x01000000) + rgb = RGBFromPaletteIndex(m_rgbTransColor & 0xFF); + else + rgb = m_rgbTransColor; + return TransparentBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight, + xSrc, ySrc, nSrcWidth, nSrcHeight, rgb); + } + else + { + return StretchBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight, + xSrc, ySrc, nSrcWidth, nSrcHeight); + } + } + BOOL Draw(HDC hDestDC, const RECT& rectDest, const RECT& rectSrc) const throw() + { + return Draw(hDestDC, rectDest.left, rectDest.top, + rectDest.right - rectDest.left, + rectDest.bottom - rectDest.top, + rectSrc.left, rectSrc.top, + rectSrc.right - rectSrc.left, + rectSrc.bottom - rectSrc.top); + } + BOOL Draw(HDC hDestDC, int xDest, int yDest) const throw() + { + return Draw(hDestDC, xDest, yDest, GetWidth(), GetHeight()); + } + BOOL Draw(HDC hDestDC, const POINT& pointDest) const throw() + { + return Draw(hDestDC, pointDest.x, pointDest.y); + } + BOOL Draw(HDC hDestDC, int xDest, int yDest, + int nDestWidth, int nDestHeight) const throw() + { + return Draw(hDestDC, xDest, yDest, nDestWidth, nDestHeight, + 0, 0, GetWidth(), GetHeight()); + } + BOOL Draw(HDC hDestDC, const RECT& rectDest) const throw() + { + return Draw(hDestDC, rectDest.left, rectDest.top, + rectDest.right - rectDest.left, + rectDest.bottom - rectDest.top); + } + + void *GetBits() throw() + { + ATLASSERT(IsDIBSection()); + BYTE *pb = (BYTE *)m_bm.bmBits; + if (m_eOrientation == DIBOR_BOTTOMUP) + { + pb += m_bm.bmWidthBytes * (m_bm.bmHeight - 1); + } + return pb; + } + + int GetBPP() const throw() + { + ATLASSERT(m_hbm); + return m_bm.bmBitsPixel; + } + + void GetColorTable(UINT iFirstColor, UINT nColors, + RGBQUAD* prgbColors) const throw() + { + ATLASSERT(IsDIBSection()); + GetDC(); + ::GetDIBColorTable(m_hDC, iFirstColor, nColors, prgbColors); + ReleaseDC(); + } + + int GetHeight() const throw() + { + ATLASSERT(m_hbm); + return m_bm.bmHeight; + } + + int GetMaxColorTableEntries() const throw() + { + ATLASSERT(IsDIBSection()); + if (m_ds.dsBmih.biClrUsed && m_ds.dsBmih.biBitCount < 16) + return m_ds.dsBmih.biClrUsed; + switch (m_bm.bmBitsPixel) + { + case 1: return 2; + case 4: return 16; + case 8: return 256; + case 16: case 32: + if (m_ds.dsBmih.biCompression == BI_BITFIELDS) + return 3; + return 0; + case 24: + default: + return 0; + } + } + + int GetPitch() const throw() + { + ATLASSERT(IsDIBSection()); + if (m_eOrientation == DIBOR_BOTTOMUP) + return -m_bm.bmWidthBytes; + else + return m_bm.bmWidthBytes; + } + + COLORREF GetPixel(int x, int y) const throw() + { + GetDC(); + COLORREF ret = ::GetPixel(m_hDC, x, y); + ReleaseDC(); + return ret; + } + + void* GetPixelAddress(int x, int y) throw() + { + ATLASSERT(IsDIBSection()); + BYTE *pb = (BYTE *)GetBits(); + pb += GetPitch() * y; + pb += (GetBPP() * x) / 8; + return pb; + } + + COLORREF GetTransparentColor() const throw() + { + return m_rgbTransColor; + } + + int GetWidth() const throw() + { + ATLASSERT(m_hbm); + return m_bm.bmWidth; + } + + bool IsDIBSection() const throw() + { + ATLASSERT(m_hbm); + return m_bIsDIBSec; + } + + bool IsIndexed() const throw() + { + ATLASSERT(IsDIBSection()); + return GetBPP() <= 8; + } + + bool IsNull() const throw() + { + return m_hbm == NULL; + } + + HRESULT Load(LPCTSTR pszFileName) throw() + { + // convert the file name string into Unicode + // TODO: use a string class +#ifdef UNICODE + LPCWSTR pszNameW = pszFileName; +#else + WCHAR szPath[MAX_PATH]; + ::MultiByteToWideChar(CP_ACP, 0, pszFileName, -1, szPath, MAX_PATH); + LPCWSTR pszNameW = szPath; +#endif + + // create a GpBitmap object from file + using namespace Gdiplus; + GpBitmap *pBitmap = NULL; + GetCommon().CreateBitmapFromFile(pszNameW, &pBitmap); + ATLASSERT(pBitmap); + + // TODO & FIXME: get parameters (m_rgbTransColor etc.) + + // get bitmap handle + HBITMAP hbm = NULL; + Color color(0xFF, 0xFF, 0xFF); + Gdiplus::Status status; + status = GetCommon().CreateHBITMAPFromBitmap( + pBitmap, &hbm, color.GetValue()); + + // delete GpBitmap + GetCommon().DisposeImage(pBitmap); + + // attach it + if (status == Ok) + Attach(hbm); + return (status == Ok ? S_OK : E_FAIL); + } + HRESULT Load(IStream* pStream) throw() + { + // create GpBitmap from stream + using namespace Gdiplus; + GpBitmap *pBitmap = NULL; + GetCommon().CreateBitmapFromStream(pStream, &pBitmap); + ATLASSERT(pBitmap); + + // TODO & FIXME: get parameters (m_rgbTransColor etc.) + + // get bitmap handle + HBITMAP hbm = NULL; + Color color(0xFF, 0xFF, 0xFF); + Gdiplus::Status status; + status = GetCommon().CreateHBITMAPFromBitmap( + pBitmap, &hbm, color.GetValue()); + + // delete Bitmap + GetCommon().DisposeImage(pBitmap); + + // attach it + if (status == Ok) + Attach(hbm); + return (status == Ok ? S_OK : E_FAIL); + } + + // NOTE: LoadFromResource loads BITMAP resource only + void LoadFromResource(HINSTANCE hInstance, LPCTSTR pszResourceName) throw() + { + HANDLE hHandle = ::LoadImage(hInstance, pszResourceName, + IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION); + Attach(reinterpret_cast<HBITMAP>(hHandle)); + } + void LoadFromResource(HINSTANCE hInstance, UINT nIDResource) throw() + { + LoadFromResource(hInstance, MAKEINTRESOURCE(nIDResource)); + } + + BOOL MaskBlt(HDC hDestDC, int xDest, int yDest, + int nDestWidth, int nDestHeight, int xSrc, int ySrc, + HBITMAP hbmMask, int xMask, int yMask, + DWORD dwROP = SRCCOPY) const throw() + { + ATLASSERT(IsTransparencySupported()); + GetDC(); + BOOL ret = ::MaskBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight, + m_hDC, xSrc, ySrc, + hbmMask, xMask, yMask, dwROP); + ReleaseDC(); + return ret; + } + BOOL MaskBlt(HDC hDestDC, const RECT& rectDest, const POINT& pointSrc, + HBITMAP hbmMask, const POINT& pointMask, + DWORD dwROP = SRCCOPY) const throw() + { + return MaskBlt(hDestDC, rectDest.left, rectDest.top, + rectDest.right - rectDest.left, rectDest.bottom - rectDest.top, + pointSrc.x, pointSrc.y, hbmMask, pointMask.x, pointMask.y, dwROP); + } + BOOL MaskBlt(HDC hDestDC, int xDest, int yDest, + HBITMAP hbmMask, DWORD dwROP = SRCCOPY) const throw() + { + return MaskBlt(hDestDC, xDest, yDest, GetWidth(), GetHeight(), + 0, 0, hbmMask, 0, 0, dwROP); + } + BOOL MaskBlt(HDC hDestDC, const POINT& pointDest, + HBITMAP hbmMask, DWORD dwROP = SRCCOPY) const throw() + { + return MaskBlt(hDestDC, pointDest.x, pointDest.y, hbmMask, dwROP); + } + + BOOL PlgBlt(HDC hDestDC, const POINT* pPoints, + int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, + HBITMAP hbmMask = NULL, + int xMask = 0, int yMask = 0) const throw() + { + ATLASSERT(IsTransparencySupported()); + GetDC(); + BOOL ret = ::PlgBlt(hDestDC, pPoints, m_hDC, + xSrc, ySrc, nSrcWidth, nSrcHeight, + hbmMask, xMask, yMask); + ReleaseDC(); + return ret; + } + BOOL PlgBlt(HDC hDestDC, const POINT* pPoints, + HBITMAP hbmMask = NULL) const throw() + { + return PlgBlt(hDestDC, pPoints, 0, 0, GetWidth(), GetHeight(), + hbmMask); + } + BOOL PlgBlt(HDC hDestDC, const POINT* pPoints, const RECT& rectSrc, + HBITMAP hbmMask, const POINT& pointMask) const throw() + { + return PlgBlt(hDestDC, pPoints, rectSrc.left, rectSrc.top, + rectSrc.right - rectSrc.left, rectSrc.bottom - rectSrc.top, + hbmMask, pointMask.x, pointMask.y); + } + BOOL PlgBlt(HDC hDestDC, const POINT* pPoints, const RECT& rectSrc, + HBITMAP hbmMask = NULL) const throw() + { + POINT pointMask = {0, 0}; + return PlgBlt(hDestDC, pPoints, rectSrc, hbmMask, pointMask); + } + + void ReleaseGDIPlus() throw() + { + COMMON*& pCommon = GetCommonPtr(); + if (pCommon && pCommon->Release() == 0) + { + delete pCommon; + pCommon = NULL; + } + } + + HRESULT Save(IStream* pStream, GUID *guidFileType) const throw() + { + using namespace Gdiplus; + ATLASSERT(m_hbm); + + // TODO & FIXME: set parameters (m_rgbTransColor etc.) + CLSID clsid; + if (!GetClsidFromFileType(&clsid, guidFileType)) + return E_FAIL; + + // create a GpBitmap from HBITMAP + GpBitmap *pBitmap = NULL; + GetCommon().CreateBitmapFromHBITMAP(m_hbm, NULL, &pBitmap); + + // save to stream + Status status; + status = GetCommon().SaveImageToStream(pBitmap, pStream, &clsid, NULL); + + // destroy GpBitmap + GetCommon().DisposeImage(pBitmap); + + return (status == Ok ? S_OK : E_FAIL); + } + HRESULT Save(LPCTSTR pszFileName, + REFGUID guidFileType = GUID_NULL) const throw() + { + using namespace Gdiplus; + ATLASSERT(m_hbm); + + // TODO & FIXME: set parameters (m_rgbTransColor etc.) + + // convert the file name string into Unicode + // TODO: use a string class +#ifdef UNICODE + LPCWSTR pszNameW = pszFileName; +#else + WCHAR szPath[MAX_PATH]; + ::MultiByteToWideChar(CP_ACP, 0, pszFileName, -1, szPath, MAX_PATH); + LPCWSTR pszNameW = szPath; +#endif + + // if the file type is null, get the file type from extension + const GUID *FileType = &guidFileType; + if (IsGuidEqual(guidFileType, GUID_NULL)) + { + LPCWSTR pszExt = GetFileExtension(pszNameW); + FileType = FileTypeFromExtension(pszExt); + } + + // get CLSID from file type + CLSID clsid; + if (!GetClsidFromFileType(&clsid, FileType)) + return E_FAIL; + + // create a GpBitmap from HBITMAP + GpBitmap *pBitmap = NULL; + GetCommon().CreateBitmapFromHBITMAP(m_hbm, NULL, &pBitmap); + + // save to file + Status status; + status = GetCommon().SaveImageToFile(pBitmap, pszNameW, &clsid, NULL); + + // destroy GpBitmap + GetCommon().DisposeImage(pBitmap); + + return (status == Ok ? S_OK : E_FAIL); + } + + void SetColorTable(UINT iFirstColor, UINT nColors, + const RGBQUAD* prgbColors) throw() + { + ATLASSERT(IsDIBSection()); + GetDC(); + ::SetDIBColorTable(m_hDC, iFirstColor, nColors, prgbColors); + ReleaseDC(); + } + + void SetPixel(int x, int y, COLORREF color) throw() + { + GetDC(); + ::SetPixelV(m_hDC, x, y, color); + ReleaseDC(); + } + + void SetPixelIndexed(int x, int y, int iIndex) throw() + { + ATLASSERT(IsIndexed()); + GetDC(); + ::SetPixelV(m_hDC, x, y, PALETTEINDEX(iIndex)); + ReleaseDC(); + } + + void SetPixelRGB(int x, int y, BYTE r, BYTE g, BYTE b) throw() + { + SetPixel(x, y, RGB(r, g, b)); + } + + COLORREF SetTransparentColor(COLORREF rgbTransparent) throw() + { + ATLASSERT(m_hbm); + COLORREF rgbOldColor = m_rgbTransColor; + m_rgbTransColor = rgbTransparent; + return rgbOldColor; + } + + BOOL StretchBlt(HDC hDestDC, int xDest, int yDest, + int nDestWidth, int nDestHeight, + int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, + DWORD dwROP = SRCCOPY) const throw() + { + GetDC(); + BOOL ret = ::StretchBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight, + m_hDC, xSrc, ySrc, nSrcWidth, nSrcHeight, dwROP); + ReleaseDC(); + return ret; + } + BOOL StretchBlt(HDC hDestDC, int xDest, int yDest, + int nDestWidth, int nDestHeight, + DWORD dwROP = SRCCOPY) const throw() + { + return StretchBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight, + 0, 0, GetWidth(), GetHeight(), dwROP); + } + BOOL StretchBlt(HDC hDestDC, const RECT& rectDest, + DWORD dwROP = SRCCOPY) const throw() + { + return StretchBlt(hDestDC, rectDest.left, rectDest.top, + rectDest.right - rectDest.left, + rectDest.bottom - rectDest.top, dwROP); + } + BOOL StretchBlt(HDC hDestDC, const RECT& rectDest, + const RECT& rectSrc, DWORD dwROP = SRCCOPY) const throw() + { + return StretchBlt(hDestDC, rectDest.left, rectDest.top, + rectDest.right - rectDest.left, + rectDest.bottom - rectDest.top, + rectSrc.left, rectSrc.top, + rectSrc.right - rectSrc.left, + rectSrc.bottom - rectSrc.top, dwROP); + } + + BOOL TransparentBlt(HDC hDestDC, int xDest, int yDest, + int nDestWidth, int nDestHeight, + int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, + UINT crTransparent = CLR_INVALID) const throw() + { + ATLASSERT(IsTransparencySupported()); + GetDC(); + BOOL ret = ::TransparentBlt(hDestDC, xDest, yDest, + nDestWidth, nDestHeight, + m_hDC, xSrc, ySrc, + nSrcWidth, nSrcHeight, crTransparent); + ReleaseDC(); + return ret; + } + BOOL TransparentBlt(HDC hDestDC, int xDest, int yDest, + int nDestWidth, int nDestHeight, + UINT crTransparent = CLR_INVALID) const throw() + { + return TransparentBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight, + 0, 0, GetWidth(), GetHeight(), crTransparent); + } + BOOL TransparentBlt(HDC hDestDC, const RECT& rectDest, + UINT crTransparent = CLR_INVALID) const throw() + { + return TransparentBlt(hDestDC, rectDest.left, rectDest.top, + rectDest.right - rectDest.left, + rectDest.bottom - rectDest.top, crTransparent); + } + BOOL TransparentBlt( + HDC hDestDC, const RECT& rectDest, + const RECT& rectSrc, UINT crTransparent = CLR_INVALID) const throw() + { + return TransparentBlt(hDestDC, rectDest.left, rectDest.top, + rectDest.right - rectDest.left, rectDest.bottom - rectDest.left, + rectSrc.left, rectSrc.top, rectSrc.right - rectSrc.left, + rectSrc.bottom - rectSrc.top, crTransparent); + } + +public: + static BOOL IsTransparencySupported() throw() + { + return TRUE; + } + +#if 0 + // TODO: implement this + static HRESULT GetImporterFilterString( + CSimpleString& strImporters, + CSimpleArray<GUID>& aguidFileTypes, + LPCTSTR pszAllFilesDescription = NULL, + DWORD dwExclude = excludeDefaultLoad, + TCHAR chSeparator = _T('|')) + { + ATLASSERT(0); + return -1; + } + + // TODO: implement this + static HRESULT GetExporterFilterString( + CSimpleString& strExporters, + CSimpleArray<GUID>& aguidFileTypes, + LPCTSTR pszAllFilesDescription = NULL, + DWORD dwExclude = excludeDefaultSave, + TCHAR chSeparator = _T('|')) + { + ATLASSERT(0); + return -1; + } +#endif // 0 + +protected: + // an extension of BITMAPINFO + struct MYBITMAPINFOEX + { + BITMAPINFOHEADER bmiHeader; + RGBQUAD bmiColors[256]; + BITMAPINFO *get() + { + return reinterpret_cast<BITMAPINFO *>(this); + } + const BITMAPINFO *get() const + { + return reinterpret_cast<const BITMAPINFO *>(this); + } + }; + + // The common data of atlimage + struct COMMON + { + // abbreviations of GDI+ basic types + typedef Gdiplus::GpStatus St; + typedef Gdiplus::ImageCodecInfo ICI; + typedef Gdiplus::GpBitmap Bm; + typedef Gdiplus::EncoderParameters EncParams; + typedef Gdiplus::GpImage Im; + typedef Gdiplus::ARGB ARGB; + typedef HBITMAP HBM; + typedef Gdiplus::GdiplusStartupInput GSI; + typedef Gdiplus::GdiplusStartupOutput GSO; + + // GDI+ function types +#undef API +#undef CST +#define API WINGDIPAPI +#define CST GDIPCONST + typedef St (WINAPI *STARTUP)(ULONG_PTR *, const GSI *, GSO *); + typedef void (WINAPI *SHUTDOWN)(ULONG_PTR); + typedef St (API *GETIMAGEENCODERSSIZE)(UINT *, UINT *); + typedef St (API *GETIMAGEENCODERS)(UINT, UINT, ICI *); + typedef St (API *CREATEBITMAPFROMFILE)(CST WCHAR*, Bm **); + typedef St (API *CREATEHBITMAPFROMBITMAP)(Bm *, HBM *, ARGB); + typedef St (API *CREATEBITMAPFROMSTREAM)(IStream *, Bm **); + typedef St (API *CREATEBITMAPFROMHBITMAP)(HBM, HPALETTE, Bm **); + typedef St (API *SAVEIMAGETOSTREAM)(Im *, IStream *, CST CLSID *, + CST EncParams *); + typedef St (API *SAVEIMAGETOFILE)(Im *, CST WCHAR *, CST CLSID *, + CST EncParams *); + typedef St (API *DISPOSEIMAGE)(Im*); +#undef API +#undef CST + + // members + int count; + HINSTANCE hinstGdiPlus; + ULONG_PTR gdiplusToken; + + // GDI+ functions + STARTUP Startup; + SHUTDOWN Shutdown; + GETIMAGEENCODERSSIZE GetImageEncodersSize; + GETIMAGEENCODERS GetImageEncoders; + CREATEBITMAPFROMFILE CreateBitmapFromFile; + CREATEHBITMAPFROMBITMAP CreateHBITMAPFromBitmap; + CREATEBITMAPFROMSTREAM CreateBitmapFromStream; + CREATEBITMAPFROMHBITMAP CreateBitmapFromHBITMAP; + SAVEIMAGETOSTREAM SaveImageToStream; + SAVEIMAGETOFILE SaveImageToFile; + DISPOSEIMAGE DisposeImage; + + COMMON() + { + count = 0; + hinstGdiPlus = NULL; + Startup = NULL; + Shutdown = NULL; + GetImageEncodersSize = NULL; + GetImageEncoders = NULL; + CreateBitmapFromFile = NULL; + CreateHBITMAPFromBitmap = NULL; + CreateBitmapFromStream = NULL; + CreateBitmapFromHBITMAP = NULL; + SaveImageToStream = NULL; + SaveImageToFile = NULL; + DisposeImage = NULL; + } + ~COMMON() + { + FreeLib(); + } + + ULONG AddRef() + { + return ++count; + } + ULONG Release() + { + return --count; + } + + // get procedure address of the DLL + template <typename TYPE> + TYPE AddrOf(const char *name) + { + FARPROC proc = ::GetProcAddress(hinstGdiPlus, name); + return reinterpret_cast<TYPE>(proc); + } + + HINSTANCE LoadLib() + { + if (hinstGdiPlus) + return hinstGdiPlus; + + hinstGdiPlus = ::LoadLibraryA("gdiplus.dll"); + + // get procedure addresses from the DLL + Startup = AddrOf<STARTUP>("GdiplusStartup"); + Shutdown = AddrOf<SHUTDOWN>("GdiplusShutdown"); + GetImageEncodersSize = + AddrOf<GETIMAGEENCODERSSIZE>("GdipGetImageEncodersSize"); + GetImageEncoders = AddrOf<GETIMAGEENCODERS>("GdipGetImageEncoders"); + CreateBitmapFromFile = + AddrOf<CREATEBITMAPFROMFILE>("GdipCreateBitmapFromFile"); + CreateHBITMAPFromBitmap = + AddrOf<CREATEHBITMAPFROMBITMAP>("GdipCreateHBITMAPFromBitmap"); + CreateBitmapFromStream = + AddrOf<CREATEBITMAPFROMSTREAM>("GdipCreateBitmapFromStream"); + CreateBitmapFromHBITMAP = + AddrOf<CREATEBITMAPFROMHBITMAP>("GdipCreateBitmapFromHBITMAP"); + SaveImageToStream = + AddrOf<SAVEIMAGETOSTREAM>("GdipSaveImageToStream"); + SaveImageToFile = AddrOf<SAVEIMAGETOFILE>("GdipSaveImageToFile"); + DisposeImage = AddrOf<DISPOSEIMAGE>("GdipDisposeImage"); + + if (hinstGdiPlus && Startup) + { + Gdiplus::GdiplusStartupInput gdiplusStartupInput; + Startup(&gdiplusToken, &gdiplusStartupInput, NULL); + } + + return hinstGdiPlus; + } + void FreeLib() + { + if (hinstGdiPlus) + { + Shutdown(gdiplusToken); + + Startup = NULL; + Shutdown = NULL; + GetImageEncodersSize = NULL; + GetImageEncoders = NULL; + CreateBitmapFromFile = NULL; + CreateHBITMAPFromBitmap = NULL; + CreateBitmapFromStream = NULL; + CreateBitmapFromHBITMAP = NULL; + SaveImageToStream = NULL; + SaveImageToFile = NULL; + DisposeImage = NULL; + ::FreeLibrary(hinstGdiPlus); + hinstGdiPlus = NULL; + } + } + }; // struct COMMON + + static COMMON*& GetCommonPtr() + { + static COMMON *s_pCommon = NULL; + return s_pCommon; + } + + static COMMON& GetCommon() + { + COMMON*& pCommon = GetCommonPtr(); + if (pCommon == NULL) + pCommon = new COMMON; + return *pCommon; + } + +protected: + HBITMAP m_hbm; + mutable HGDIOBJ m_hbmOld; + mutable HDC m_hDC; + DIBOrientation m_eOrientation; + bool m_bHasAlphaCh; + bool m_bIsDIBSec; + COLORREF m_rgbTransColor; + union + { + BITMAP m_bm; + DIBSECTION m_ds; + }; + + LPCWSTR GetFileExtension(LPCWSTR pszFileName) const + { + LPCWSTR pch = wcsrchr(pszFileName, L'\\'); + if (pch == NULL) + pch = wcsrchr(pszFileName, L'/'); + pch = (pch ? wcsrchr(pch, L'.') : wcsrchr(pszFileName, L'.')); + return (pch ? pch : (pszFileName + ::lstrlenW(pszFileName))); + } + + COLORREF RGBFromPaletteIndex(int iIndex) const + { + RGBQUAD table[256]; + GetColorTable(0, 256, table); + RGBQUAD& quad = table[iIndex]; + return RGB(quad.rgbRed, quad.rgbGreen, quad.rgbBlue); + } + + struct EXTENSION_ENTRY + { + LPCWSTR pszExt; + GUID guid; + }; + + const GUID *FileTypeFromExtension(LPCWSTR pszExt) const + { + static const EXTENSION_ENTRY table[] = + { + {L".jpg", Gdiplus::ImageFormatJPEG}, + {L".png", Gdiplus::ImageFormatPNG}, + {L".bmp", Gdiplus::ImageFormatBMP}, + {L".gif", Gdiplus::ImageFormatGIF}, + {L".tif", Gdiplus::ImageFormatTIFF}, + {L".jpeg", Gdiplus::ImageFormatJPEG}, + {L".jpe", Gdiplus::ImageFormatJPEG}, + {L".jfif", Gdiplus::ImageFormatJPEG}, + {L".dib", Gdiplus::ImageFormatBMP}, + {L".rle", Gdiplus::ImageFormatBMP}, + {L".tiff", Gdiplus::ImageFormatTIFF} + }; + const size_t count = _countof(table); + for (size_t i = 0; i < count; ++i) + { + if (::lstrcmpiW(table[i].pszExt, pszExt) == 0) + return &table[i].guid; + } + return NULL; + } + + struct FORMAT_ENTRY + { + GUID guid; + LPCWSTR mime; + }; + + bool GetClsidFromFileType(CLSID *clsid, const GUID *guid) const + { + static const FORMAT_ENTRY table[] = + { + {Gdiplus::ImageFormatJPEG, L"image/jpeg"}, + {Gdiplus::ImageFormatPNG, L"image/png"}, + {Gdiplus::ImageFormatBMP, L"image/bmp"}, + {Gdiplus::ImageFormatGIF, L"image/gif"}, + {Gdiplus::ImageFormatTIFF, L"image/tiff"} + }; + const size_t count = _countof(table); + for (size_t i = 0; i < count; ++i) + { + if (IsGuidEqual(table[i].guid, *guid)) + { + int num = GetEncoderClsid(table[i].mime, clsid); + if (num >= 0) + { + return true; + } + } + } + return false; + } + + int GetEncoderClsid(LPCWSTR mime, CLSID *clsid) const + { + UINT count = 0, total_size = 0; + GetCommon().GetImageEncodersSize(&count, &total_size); + if (total_size == 0) + return -1; // failure + + Gdiplus::ImageCodecInfo *pInfo; + BYTE *pb = new BYTE[total_size]; + ATLASSERT(pb); + pInfo = reinterpret_cast<Gdiplus::ImageCodecInfo *>(pb); + if (pInfo == NULL) + return -1; // failure + + GetCommon().GetImageEncoders(count, total_size, pInfo); + + for (UINT iInfo = 0; iInfo < count; ++iInfo) + { + if (::lstrcmpiW(pInfo[iInfo].MimeType, mime) == 0) + { + *clsid = pInfo[iInfo].Clsid; + delete[] pb; + return iInfo; // success + } + } + + delete[] pb; + return -1; // failure + } + + bool IsGuidEqual(const GUID& guid1, const GUID& guid2) const + { + RPC_STATUS status; + if (::UuidEqual(const_cast<GUID *>(&guid1), + const_cast<GUID *>(&guid2), &status)) + { + if (status == RPC_S_OK) + return true; + } + return false; + } + + void AttachInternal(HBITMAP hBitmap, DIBOrientation eOrientation, + LONG iTransColor) + { + Destroy(); + + const int size = sizeof(DIBSECTION); + m_bIsDIBSec = (::GetObject(hBitmap, size, &m_ds) == size); + + bool bOK = (::GetObject(hBitmap, sizeof(BITMAP), &m_bm) != 0); + + if (bOK) + { + m_hbm = hBitmap; + m_eOrientation = eOrientation; + m_bHasAlphaCh = (m_bm.bmBitsPixel == 32); + m_rgbTransColor = CLR_INVALID; + } + } + + BOOL CreateInternal(int nWidth, int nHeight, int nBPP, + DWORD eCompression, const DWORD* pdwBitmasks = NULL, + DWORD dwFlags = 0) throw() + { + ATLASSERT(nWidth != 0); + ATLASSERT(nHeight != 0); + + // initialize BITMAPINFO extension + MYBITMAPINFOEX bi; + ZeroMemory(&bi, sizeof(bi)); + bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bi.bmiHeader.biWidth = nWidth; + bi.bmiHeader.biHeight = nHeight; + bi.bmiHeader.biPlanes = 1; + bi.bmiHeader.biBitCount = nBPP; + bi.bmiHeader.biCompression = eCompression; + + // is there alpha channel? + bool bHasAlphaCh; + bHasAlphaCh = (nBPP == 32 && (dwFlags & createAlphaChannel)); + + // get orientation + DIBOrientation eOrientation; + eOrientation = ((nHeight > 0) ? DIBOR_BOTTOMUP : DIBOR_TOPDOWN); + + // does it have bit fields? + if (eCompression == BI_BITFIELDS) + { + if (nBPP == 16 || nBPP == 32) + { + // store the mask data + LPDWORD pdwMask = reinterpret_cast<LPDWORD>(bi.bmiColors); + pdwMask[0] = pdwBitmasks[0]; + pdwMask[1] = pdwBitmasks[1]; + pdwMask[2] = pdwBitmasks[2]; + } + else + { + return FALSE; + } + } + else + { + ATLASSERT(pdwBitmasks == NULL); + if (pdwBitmasks) + return FALSE; + } + + // create a DIB section + HDC hDC = ::CreateCompatibleDC(NULL); + ATLASSERT(hDC); + LPVOID pvBits; + HBITMAP hbm = ::CreateDIBSection(hDC, bi.get(), DIB_RGB_COLORS, + &pvBits, NULL, 0); + ATLASSERT(hbm); + ::DeleteDC(hDC); + + // attach it + AttachInternal(hbm, eOrientation, -1); + m_bHasAlphaCh = bHasAlphaCh; + + return hbm != NULL; + } + +private: + // NOTE: CImage is not copyable + CImage(const CImage&); + CImage& operator=(const CImage&); +}; + +} + +#endif + +#ifndef _ATL_NO_AUTOMATIC_NAMESPACE +using namespace ATL; +#endif //!_ATL_NO_AUTOMATIC_NAMESPACE Propchange: trunk/reactos/sdk/lib/atl/atlimage.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/apitests/atl/CImage.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/CImage.cpp?r…
============================================================================== --- trunk/rostests/apitests/atl/CImage.cpp (added) +++ trunk/rostests/apitests/atl/CImage.cpp [iso-8859-1] Thu Aug 18 19:27:49 2016 @@ -0,0 +1,278 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory + * PURPOSE: Test for CImage + * PROGRAMMER: Katayama Hirofumi MZ (katayama.hirofumi.mz(a)gmail.com) + */ + +#include <atlimage.h> +#include "resource.h" + +#ifdef __REACTOS__ + #include <apitest.h> +#else + #include <stdlib.h> + #include <stdio.h> + #include <stdarg.h> + const char *g_file = NULL; + int g_line = 0; + int g_tests_executed = 0; + int g_tests_failed = 0; + void ok_func(BOOL value, const char *fmt, ...) + { + va_list va; + va_start(va, fmt); + if (!value) + { + printf("%s (%d): ", g_file, g_line); + vprintf(fmt, va); + g_tests_failed++; + } + g_tests_executed++; + va_end(va); + } + #undef ok + #define ok g_file = __FILE__; g_line = __LINE__; ok_func + #define START_TEST(x) int main(void) +#endif + + +const TCHAR* szFiles[] = { + TEXT("ant.png"), + TEXT("ant.tif"), + TEXT("ant.gif"), + TEXT("ant.jpg"), + TEXT("ant.bmp"), +}; + +static TCHAR szTempPath[MAX_PATH]; +TCHAR* file_name(const TCHAR* file) +{ + static TCHAR buffer[MAX_PATH]; + lstrcpy(buffer, szTempPath); + lstrcat(buffer, TEXT("\\")); + lstrcat(buffer, file); + return buffer; +} + +static void write_bitmap(HINSTANCE hInst, int id, TCHAR* file) +{ + HRSRC rsrc; + + rsrc = FindResource(hInst, MAKEINTRESOURCE(id), MAKEINTRESOURCE(RT_BITMAP)); + ok(rsrc != NULL, "Expected to find an image resource\n"); + if (rsrc) + { + void *rsrc_data; + HANDLE hfile; + BOOL ret; + HGLOBAL glob = LoadResource(hInst, rsrc); + DWORD rsrc_size = SizeofResource(hInst, rsrc); + + rsrc_data = LockResource(glob); + + hfile = CreateFile(file, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); + ok(hfile != INVALID_HANDLE_VALUE, "Unable to open temp file: %lu\n", GetLastError()); + if (hfile != INVALID_HANDLE_VALUE) + { + BITMAPFILEHEADER bfh = { 0 }; + DWORD dwWritten; + + bfh.bfType = 'MB'; + bfh.bfSize = rsrc_size + sizeof(BITMAPFILEHEADER); + bfh.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER); + bfh.bfReserved1 = bfh.bfReserved2 = 0; + ret = WriteFile(hfile, &bfh, sizeof(bfh), &dwWritten, NULL); + ok(ret, "Unable to write temp file: %lu\n", GetLastError()); + ret = WriteFile(hfile, rsrc_data, rsrc_size, &dwWritten, NULL); + ok(ret, "Unable to write temp file: %lu\n", GetLastError()); + CloseHandle(hfile); + } + UnlockResource(rsrc_data); + } +} + +typedef Gdiplus::GpStatus (WINAPI *STARTUP)(ULONG_PTR *, const Gdiplus::GdiplusStartupInput *, Gdiplus::GdiplusStartupOutput *); +typedef void (WINAPI *SHUTDOWN)(ULONG_PTR); +typedef Gdiplus::GpStatus (WINGDIPAPI *CREATEBITMAPFROMFILE)(GDIPCONST WCHAR*, Gdiplus::GpBitmap **); +typedef Gdiplus::GpStatus (WINGDIPAPI *GETPIXELFORMAT)(Gdiplus::GpImage *image, Gdiplus::PixelFormat *format); +typedef Gdiplus::GpStatus (WINGDIPAPI *DISPOSEIMAGE)(Gdiplus::GpImage *); + +static HINSTANCE hinstGdiPlus; +static ULONG_PTR gdiplusToken; + +static STARTUP Startup; +static SHUTDOWN Shutdown; +static CREATEBITMAPFROMFILE CreateBitmapFromFile; +static GETPIXELFORMAT GetImagePixelFormat; +static DISPOSEIMAGE DisposeImage; + +template <typename TYPE> +TYPE AddrOf(const char *name) +{ + FARPROC proc = ::GetProcAddress(hinstGdiPlus, name); + return reinterpret_cast<TYPE>(proc); +} + +static void init_gdip() +{ + hinstGdiPlus = ::LoadLibraryA("gdiplus.dll"); + Startup = AddrOf<STARTUP>("GdiplusStartup"); + Shutdown = AddrOf<SHUTDOWN>("GdiplusShutdown"); + CreateBitmapFromFile = AddrOf<CREATEBITMAPFROMFILE>("GdipCreateBitmapFromFile"); + GetImagePixelFormat = AddrOf<GETPIXELFORMAT>("GdipGetImagePixelFormat"); + DisposeImage = AddrOf<DISPOSEIMAGE>("GdipDisposeImage"); +} + + +static void determine_file_bpp(TCHAR* tfile, Gdiplus::PixelFormat expect_pf) +{ + using namespace Gdiplus; + GpBitmap *pBitmap = NULL; + +#ifdef UNICODE + WCHAR* file = tfile; +#else + WCHAR file[MAX_PATH]; + ::MultiByteToWideChar(CP_ACP, 0, tfile, -1, file, MAX_PATH); +#endif + + if (Startup == NULL) + init_gdip(); + + Gdiplus::GdiplusStartupInput gdiplusStartupInput; + Startup(&gdiplusToken, &gdiplusStartupInput, NULL); + + + Gdiplus::GpStatus status = CreateBitmapFromFile(file, &pBitmap); + ok(status == Gdiplus::Ok, "Expected status to be %i, was: %i\n", (int)Gdiplus::Ok, (int)status); + ok(pBitmap != NULL, "Expected a valid bitmap\n"); + if (pBitmap) + { + PixelFormat pf; + GetImagePixelFormat(pBitmap, &pf); + ok(pf == expect_pf, "Expected PixelFormat to be 0x%x, was: 0x%x\n", (int)expect_pf, (int)pf); + + DisposeImage(pBitmap); + } + Shutdown(gdiplusToken); +} + + +START_TEST(CImage) +{ + HRESULT hr; + TCHAR* file; + BOOL bOK; + int width, height, bpp; + size_t n; + CImage image1, image2; + COLORREF color; + HDC hDC; + +#if 0 + width = image1.GetWidth(); + height = image1.GetHeight(); + bpp = image1.GetBPP(); +#endif + + HINSTANCE hInst = GetModuleHandle(NULL); + GetTempPath(MAX_PATH, szTempPath); + + image1.LoadFromResource(hInst, IDB_ANT); + ok(!image1.IsNull(), "Expected image1 is not null\n"); + + width = image1.GetWidth(); + ok(width == 48, "Expected width to be 48, was: %d\n", width); + height = image1.GetHeight(); + ok(height == 48, "Expected height to be 48, was: %d\n", height); + bpp = image1.GetBPP(); + ok(bpp == 8, "Expected bpp to be 8, was: %d\n", bpp); + + + image2.LoadFromResource(hInst, IDB_CROSS); + ok(!image2.IsNull(), "Expected image2 is not null\n"); + image2.SetTransparentColor(RGB(255, 255, 255)); + + width = image2.GetWidth(); + ok(width == 32, "Expected width to be 32, was: %d\n", width); + height = image2.GetHeight(); + ok(height == 32, "Expected height to be 32, was: %d\n", height); + bpp = image2.GetBPP(); + ok(bpp == 8, "Expected bpp to be 8, was: %d\n", bpp); + + color = image1.GetPixel(5, 5); + ok(color == RGB(166, 202, 240), "Expected color to be 166, 202, 240; was: %i, %i, %i\n", GetRValue(color), GetGValue(color), GetBValue(color)); + + hDC = image1.GetDC(); + bOK = image2.Draw(hDC, 0, 0); + image1.ReleaseDC(); + ok(bOK != FALSE, "Expected bDraw to be TRUE, was: %d\n", bOK); + image2.Destroy(); + + color = image1.GetPixel(5, 5); + ok(color == RGB(255, 0,0), "Expected color to be 255, 0, 0; was: %i, %i, %i\n", GetRValue(color), GetGValue(color), GetBValue(color)); + + file = file_name(TEXT("ant.bmp")); + write_bitmap(hInst, IDB_ANT, file); + + init_gdip(); + + determine_file_bpp(file, PixelFormat8bppIndexed); + + hr = image2.Load(file); + ok(hr == S_OK, "Expected hr to be S_OK, was: %08lx\n", hr); + ok(!image2.IsNull(), "Expected image1 is not null\n"); + bOK = DeleteFile(file); + ok(bOK, "Expected bOK to be TRUE, was: %d\n", bOK); + + width = image2.GetWidth(); + ok(width == 48, "Expected width to be 48, was: %d\n", width); + height = image2.GetHeight(); + ok(height == 48, "Expected height to be 48, was: %d\n", height); + bpp = image2.GetBPP(); + ok(bpp == 8, "Expected bpp to be 8, was: %d\n", bpp); + + for (n = 0; n < _countof(szFiles); ++n) + { + file = file_name(szFiles[n]); + image2.Destroy(); + + if (n == 0) + hr = image1.Save(file, Gdiplus::ImageFormatPNG); + else + hr = image1.Save(file); + ok(hr == S_OK, "Expected hr to be S_OK, was: %08lx (for %i)\n", hr, n); + + bOK = (GetFileAttributes(file) != 0xFFFFFFFF); + ok(bOK, "Expected bOK to be TRUE, was: %d (for %i)\n", bOK, n); + + hr = image2.Load(file); + ok(hr == S_OK, "Expected hr to be S_OK, was: %08lx (for %i)\n", hr, n); + + width = image2.GetWidth(); + ok(width == 48, "Expected width to be 48, was: %d (for %i)\n", width, n); + height = image2.GetHeight(); + ok(height == 48, "Expected height to be 48, was: %d (for %i)\n", height, n); + bpp = image2.GetBPP(); + if (n == 3) + { + ok(bpp == 24, "Expected bpp to be 24, was: %d (for %i)\n", bpp, n); + determine_file_bpp(file, PixelFormat24bppRGB); + } + else + { + ok(bpp == 8, "Expected bpp to be 8, was: %d (for %i)\n", bpp, n); + determine_file_bpp(file, PixelFormat8bppIndexed); + } + color = image1.GetPixel(5, 5); + ok(color == RGB(255, 0,0), "Expected color to be 255, 0, 0; was: %i, %i, %i (for %i)\n", GetRValue(color), GetGValue(color), GetBValue(color), n); + + bOK = DeleteFile(file); + ok(bOK, "Expected bOK to be TRUE, was: %d (for %i)\n", bOK, n); + } + +#ifndef __REACTOS__ + printf("CImage: %i tests executed (0 marked as todo, %i failures), 0 skipped.\n", g_tests_executed, g_tests_failed); +#endif +} Propchange: trunk/rostests/apitests/atl/CImage.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/apitests/atl/CImage_WIP.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/CImage_WIP.t…
============================================================================== --- trunk/rostests/apitests/atl/CImage_WIP.txt (added) +++ trunk/rostests/apitests/atl/CImage_WIP.txt [iso-8859-1] Thu Aug 18 19:27:49 2016 @@ -0,0 +1,86 @@ +Test files: + +atl_apitest: CImage class from reactos +CImage.exe : CImage class from microsoft + +================================================================================================================ +Windows Server 2003 SP2: +================================================================================================================ +>atl_apitest.exe CImage +R:\src\trunk\reactos\modules\rostests\apitests\atl\CImage.cpp(234): Test failed: Expected bpp to be 8, was: 32 +R:\src\trunk\reactos\modules\rostests\apitests\atl\CImage.cpp(265): Test failed: Expected bpp to be 8, was: 32 (for 0) +R:\src\trunk\reactos\modules\rostests\apitests\atl\CImage.cpp(265): Test failed: Expected bpp to be 8, was: 32 (for 1) +R:\src\trunk\reactos\modules\rostests\apitests\atl\CImage.cpp(265): Test failed: Expected bpp to be 8, was: 32 (for 2) +R:\src\trunk\reactos\modules\rostests\apitests\atl\CImage.cpp(260): Test failed: Expected bpp to be 24, was: 32 (for 3) +R:\src\trunk\reactos\modules\rostests\apitests\atl\CImage.cpp(265): Test failed: Expected bpp to be 8, was: 32 (for 4) + +CImage: 79 tests executed (0 marked as todo, 6 failures), 0 skipped. +================================================================================================================ +>CImage.exe +CImage: 79 tests executed (0 marked as todo, 0 failures), 0 skipped. +================================================================================================================ +================================================================================================================ +Windows 10: +================================================================================================================ +>atl_apitest.exe CImage +R:\src\trunk\reactos\modules\rostests\apitests\atl\CImage.cpp(234): Test failed: Expected bpp to be 8, was: 32 +R:\src\trunk\reactos\modules\rostests\apitests\atl\CImage.cpp(265): Test failed: Expected bpp to be 8, was: 32 (for 0) +R:\src\trunk\reactos\modules\rostests\apitests\atl\CImage.cpp(265): Test failed: Expected bpp to be 8, was: 32 (for 1) +R:\src\trunk\reactos\modules\rostests\apitests\atl\CImage.cpp(265): Test failed: Expected bpp to be 8, was: 32 (for 2) +R:\src\trunk\reactos\modules\rostests\apitests\atl\CImage.cpp(260): Test failed: Expected bpp to be 24, was: 32 (for 3) +R:\src\trunk\reactos\modules\rostests\apitests\atl\CImage.cpp(265): Test failed: Expected bpp to be 8, was: 32 (for 4) + +CImage: 79 tests executed (0 marked as todo, 6 failures), 0 skipped. +================================================================================================================ +>CImage.exe +CImage: 79 tests executed (0 marked as todo, 0 failures), 0 skipped. +================================================================================================================ +================================================================================================================ +ReactOS: +================================================================================================================ +>atl_apitest.exe CImage +CImage.cpp:234: Test failed: Expected bpp to be 8, was: 32 +CImage.cpp:265: Test failed: Expected bpp to be 8, was: 32 (for 0) +CImage.cpp:245: Test failed: Expected hr to be S_OK, was: 80004005 (for 1) +CImage.cpp:251: Test failed: Expected hr to be S_OK, was: 80004005 (for 1) +CImage.cpp:254: Test failed: Expected width to be 48, was: 0 (for 1) +CImage.cpp:256: Test failed: Expected height to be 48, was: 0 (for 1) +CImage.cpp:265: Test failed: Expected bpp to be 8, was: 0 (for 1) +CImage.cpp:148: Test failed: Expected status to be 0, was: 1 +CImage.cpp:149: Test failed: Expected a valid bitmap +CImage.cpp:245: Test failed: Expected hr to be S_OK, was: 80004005 (for 2) +CImage.cpp:251: Test failed: Expected hr to be S_OK, was: 80004005 (for 2) +CImage.cpp:254: Test failed: Expected width to be 48, was: 0 (for 2) +CImage.cpp:256: Test failed: Expected height to be 48, was: 0 (for 2) +CImage.cpp:265: Test failed: Expected bpp to be 8, was: 0 (for 2) +CImage.cpp:148: Test failed: Expected status to be 0, was: 1 +CImage.cpp:149: Test failed: Expected a valid bitmap +CImage.cpp:260: Test failed: Expected bpp to be 24, was: 32 (for 3) +CImage.cpp:154: Test failed: Expected PixelFormat to be 0x21808, was: 0x30803 +CImage.cpp:265: Test failed: Expected bpp to be 8, was: 32 (for 4) +CImage.cpp:154: Test failed: Expected PixelFormat to be 0x30803, was: 0x21808 + +CImage: 77 tests executed (0 marked as todo, 20 failures), 0 skipped. +================================================================================================================ +>CImage.exe +../CImage.cpp (245): Expected hr to be S_OK, was: 80004005 (for 1) +../CImage.cpp (251): Expected hr to be S_OK, was: 80004005 (for 1) +../CImage.cpp (254): Expected width to be 48, was: 0 (for 1) +../CImage.cpp (256): Expected height to be 48, was: 0 (for 1) +../CImage.cpp (265): Expected bpp to be 8, was: 0 (for 1) +../CImage.cpp (148): Expected status to be 0, was: 1 +../CImage.cpp (149): Expected a valid bitmap +../CImage.cpp (245): Expected hr to be S_OK, was: 80004005 (for 2) +../CImage.cpp (251): Expected hr to be S_OK, was: 80004005 (for 2) +../CImage.cpp (254): Expected width to be 48, was: 0 (for 2) +../CImage.cpp (256): Expected height to be 48, was: 0 (for 2) +../CImage.cpp (265): Expected bpp to be 8, was: 0 (for 2) +../CImage.cpp (148): Expected status to be 0, was: 1 +../CImage.cpp (149): Expected a valid bitmap +../CImage.cpp (260): Expected bpp to be 24, was: 8 (for 3) +../CImage.cpp (154): Expected PixelFormat to be 0x21808, was: 0x30803 +../CImage.cpp (265): Expected bpp to be 8, was: 24 (for 4) +../CImage.cpp (154): Expected PixelFormat to be 0x30803, was: 0x21808 +CImage: 77 tests executed (0 marked as todo, 18 failures), 0 skipped. +================================================================================================================ + Propchange: trunk/rostests/apitests/atl/CImage_WIP.txt ------------------------------------------------------------------------------ svn:eol-style = CRLF Modified: trunk/rostests/apitests/atl/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/CMakeLists.t…
============================================================================== --- trunk/rostests/apitests/atl/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/apitests/atl/CMakeLists.txt [iso-8859-1] Thu Aug 18 19:27:49 2016 @@ -1,4 +1,5 @@ +add_definitions(-DINITGUID) set_cpp(WITH_RUNTIME WITH_EXCEPTIONS) include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) @@ -7,6 +8,7 @@ atltypes.cpp CComBSTR.cpp CComHeapPtr.cpp + CImage.cpp CRegKey.cpp CString.cpp testlist.c @@ -14,5 +16,5 @@ target_link_libraries(atl_apitest wine uuid) set_module_type(atl_apitest win32cui) -add_importlibs(atl_apitest ole32 oleaut32 advapi32 user32 msvcrt kernel32) +add_importlibs(atl_apitest rpcrt4 ole32 oleaut32 msimg32 gdi32 advapi32 user32 msvcrt kernel32) add_cd_file(TARGET atl_apitest DESTINATION reactos/bin FOR all) Added: trunk/rostests/apitests/atl/ant.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/ant.bmp?rev=…
============================================================================== Binary file - no diff available. Propchange: trunk/rostests/apitests/atl/ant.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Modified: trunk/rostests/apitests/atl/atl_apitest.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/atl_apitest.…
============================================================================== --- trunk/rostests/apitests/atl/atl_apitest.rc [iso-8859-1] (original) +++ trunk/rostests/apitests/atl/atl_apitest.rc [iso-8859-1] Thu Aug 18 19:27:49 2016 @@ -9,3 +9,5 @@ IDS_TEST2 "I am a happy BSTR" END +IDB_ANT BITMAP "ant.bmp" +IDB_CROSS BITMAP "cross.bmp" Added: trunk/rostests/apitests/atl/cross.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/cross.bmp?re…
============================================================================== Binary file - no diff available. Propchange: trunk/rostests/apitests/atl/cross.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/rostests/apitests/atl/devenv/CImage.sln URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/devenv/CImag…
============================================================================== --- trunk/rostests/apitests/atl/devenv/CImage.sln (added) +++ trunk/rostests/apitests/atl/devenv/CImage.sln [iso-8859-1] Thu Aug 18 19:27:49 2016 @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.24720.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CImage", "CImage.vcxproj", "{AE520E17-2DAE-40FF-B082-F32A7A935FB2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Debug|x64.ActiveCfg = Debug|x64 + {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Debug|x64.Build.0 = Debug|x64 + {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Debug|x86.ActiveCfg = Debug|Win32 + {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Debug|x86.Build.0 = Debug|Win32 + {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Release|x64.ActiveCfg = Release|x64 + {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Release|x64.Build.0 = Release|x64 + {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Release|x86.ActiveCfg = Release|Win32 + {AE520E17-2DAE-40FF-B082-F32A7A935FB2}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Propchange: trunk/rostests/apitests/atl/devenv/CImage.sln ------------------------------------------------------------------------------ svn:eol-style = CRLF Added: trunk/rostests/apitests/atl/devenv/CImage.vcxproj URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/devenv/CImag…
============================================================================== --- trunk/rostests/apitests/atl/devenv/CImage.vcxproj (added) +++ trunk/rostests/apitests/atl/devenv/CImage.vcxproj [iso-8859-1] Thu Aug 18 19:27:49 2016 @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="
http://schemas.microsoft.com/developer/msbuild/2003
"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{AE520E17-2DAE-40FF-B082-F32A7A935FB2}</ProjectGuid> + <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + <Keyword>AtlProj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v120_xp</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="Shared"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <IgnoreImportLibrary>true</IgnoreImportLibrary> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <IgnoreImportLibrary>true</IgnoreImportLibrary> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <IgnoreImportLibrary>true</IgnoreImportLibrary> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <IgnoreImportLibrary>true</IgnoreImportLibrary> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <ResourceCompile> + <Culture>0x0409</Culture> + <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <RegisterOutput>true</RegisterOutput> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <ResourceCompile> + <Culture>0x0409</Culture> + <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <RegisterOutput>true</RegisterOutput> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <ResourceCompile> + <Culture>0x0409</Culture> + <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <RegisterOutput>true</RegisterOutput> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <PreprocessorDefinitions>_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <ResourceCompile> + <Culture>0x0409</Culture> + <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <RegisterOutput>true</RegisterOutput> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="../CImage.cpp"> + <RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MultiThreaded</RuntimeLibrary> + <RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MultiThreaded</RuntimeLibrary> + <RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">MultiThreadedDebug</RuntimeLibrary> + <RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">MultiThreadedDebug</RuntimeLibrary> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="../atl_apitest.rc" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> Propchange: trunk/rostests/apitests/atl/devenv/CImage.vcxproj ------------------------------------------------------------------------------ svn:eol-style = CRLF Modified: trunk/rostests/apitests/atl/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/resource.h?r…
============================================================================== --- trunk/rostests/apitests/atl/resource.h [iso-8859-1] (original) +++ trunk/rostests/apitests/atl/resource.h [iso-8859-1] Thu Aug 18 19:27:49 2016 @@ -1,3 +1,6 @@ #define IDS_TEST1 2000 #define IDS_TEST2 2001 + +#define IDB_ANT 1 +#define IDB_CROSS 2 Modified: trunk/rostests/apitests/atl/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/testlist.c?r…
============================================================================== --- trunk/rostests/apitests/atl/testlist.c [iso-8859-1] (original) +++ trunk/rostests/apitests/atl/testlist.c [iso-8859-1] Thu Aug 18 19:27:49 2016 @@ -4,6 +4,7 @@ extern void func_atltypes(void); extern void func_CComBSTR(void); extern void func_CComHeapPtr(void); +extern void func_CImage(void); extern void func_CRegKey(void); extern void func_CString(void); @@ -12,6 +13,7 @@ { "atltypes", func_atltypes }, { "CComBSTR", func_CComBSTR }, { "CComHeapPtr", func_CComHeapPtr }, + { "CImage", func_CImage }, { "CRegKey", func_CRegKey }, { "CString", func_CString }, { 0, 0 }
8 years, 4 months
1
0
0
0
[akhaldi] 72331: [KERNEL32_WINETEST] Come on Jérôme! commit the awesomeness so we can remove this skip ;)
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Aug 18 19:12:59 2016 New Revision: 72331 URL:
http://svn.reactos.org/svn/reactos?rev=72331&view=rev
Log: [KERNEL32_WINETEST] Come on Jérôme! commit the awesomeness so we can remove this skip ;) Modified: trunk/rostests/winetests/kernel32/virtual.c Modified: trunk/rostests/winetests/kernel32/virtual.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/virtua…
============================================================================== --- trunk/rostests/winetests/kernel32/virtual.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/virtual.c [iso-8859-1] Thu Aug 18 19:12:59 2016 @@ -4109,7 +4109,14 @@ } if (!strcmp(argv[2], "sharedmemro")) { - test_shared_memory_ro(TRUE, strtol(argv[3], NULL, 16)); + if(!winetest_interactive) + { + skip("CORE-8541: Skipping test_shared_memory_ro(TRUE, strtol(argv[3], NULL, 16))\n"); + } + else + { + test_shared_memory_ro(TRUE, strtol(argv[3], NULL, 16)); + } return; } while (1)
8 years, 4 months
1
0
0
0
[apriyadarshi] 72330: Minor changes for ATAPI Srb Functions
by apriyadarshi@svn.reactos.org
Author: apriyadarshi Date: Thu Aug 18 18:03:26 2016 New Revision: 72330 URL:
http://svn.reactos.org/svn/reactos?rev=72330&view=rev
Log: Minor changes for ATAPI Srb Functions Modified: branches/GSoC_2016/AHCI/drivers/storage/storahci/storahci.c Modified: branches/GSoC_2016/AHCI/drivers/storage/storahci/storahci.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/AHCI/drivers/storage/…
============================================================================== --- branches/GSoC_2016/AHCI/drivers/storage/storahci/storahci.c [iso-8859-1] (original) +++ branches/GSoC_2016/AHCI/drivers/storage/storahci/storahci.c [iso-8859-1] Thu Aug 18 18:03:26 2016 @@ -401,7 +401,6 @@ AhciDebugPrint("\tDET == %x Unsupported\n", ssts.DET); return FALSE; } - }// -- AhciStartPort(); /** @@ -1242,12 +1241,34 @@ __in PAHCI_SRB_EXTENSION SrbExtension ) { + PAHCI_COMMAND_TABLE cmdTable; UNREFERENCED_PARAMETER(PortExtension); - UNREFERENCED_PARAMETER(SrbExtension); AhciDebugPrint("AhciATAPI_CFIS()\n"); - return 2; + cmdTable = (PAHCI_COMMAND_TABLE)SrbExtension; + + NT_ASSERT(SrbExtension->CommandReg == IDE_COMMAND_ATAPI_PACKET); + + AhciZeroMemory((PCHAR)cmdTable->CFIS, sizeof(cmdTable->CFIS)); + + cmdTable->CFIS[AHCI_ATA_CFIS_FisType] = FIS_TYPE_REG_H2D; // FIS Type + cmdTable->CFIS[AHCI_ATA_CFIS_PMPort_C] = (1 << 7); // PM Port & C + cmdTable->CFIS[AHCI_ATA_CFIS_CommandReg] = SrbExtension->CommandReg; + + cmdTable->CFIS[AHCI_ATA_CFIS_FeaturesLow] = SrbExtension->FeaturesLow; + cmdTable->CFIS[AHCI_ATA_CFIS_LBA0] = SrbExtension->LBA0; + cmdTable->CFIS[AHCI_ATA_CFIS_LBA1] = SrbExtension->LBA1; + cmdTable->CFIS[AHCI_ATA_CFIS_LBA2] = SrbExtension->LBA2; + cmdTable->CFIS[AHCI_ATA_CFIS_Device] = SrbExtension->Device; + cmdTable->CFIS[AHCI_ATA_CFIS_LBA3] = SrbExtension->LBA3; + cmdTable->CFIS[AHCI_ATA_CFIS_LBA4] = SrbExtension->LBA4; + cmdTable->CFIS[AHCI_ATA_CFIS_LBA5] = SrbExtension->LBA5; + cmdTable->CFIS[AHCI_ATA_CFIS_FeaturesHigh] = SrbExtension->FeaturesHigh; + cmdTable->CFIS[AHCI_ATA_CFIS_SectorCountLow] = SrbExtension->SectorCountLow; + cmdTable->CFIS[AHCI_ATA_CFIS_SectorCountHigh] = SrbExtension->SectorCountHigh; + + return 5; }// -- AhciATAPI_CFIS(); /** @@ -1566,8 +1587,46 @@ }// -- AhciProcessIO(); /** + * @name AtapiInquiryCompletion + * @implemented + * + * AtapiInquiryCompletion routine should be called after device signals + * for device inquiry request is completed (through interrupt) -- ATAPI Device only + * + * @param PortExtension + * @param Srb + * + */ +VOID +AtapiInquiryCompletion ( + __in PAHCI_PORT_EXTENSION PortExtension, + __in PSCSI_REQUEST_BLOCK Srb + ) +{ + BOOLEAN status; + PAHCI_ADAPTER_EXTENSION AdapterExtension; + + AhciDebugPrint("AtapiInquiryCompletion()\n"); + + NT_ASSERT(Srb != NULL); + NT_ASSERT(PortExtension != NULL); + + AdapterExtension = PortExtension->AdapterExtension; + + // send queue depth + status = StorPortSetDeviceQueueDepth(PortExtension->AdapterExtension, + Srb->PathId, + Srb->TargetId, + Srb->Lun, + AHCI_Global_Port_CAP_NCS(AdapterExtension->CAP)); + + NT_ASSERT(status == TRUE); + return; +}// -- AtapiInquiryCompletion(); + +/** * @name InquiryCompletion - * @not_implemented + * @implemented * * InquiryCompletion routine should be called after device signals * for device inquiry request is completed (through interrupt) @@ -1719,33 +1778,130 @@ return; }// -- InquiryCompletion(); -/** - * @name DeviceRequestSense - * @implemented - * - * Handle SCSIOP_MODE_SENSE OperationCode + /** + * @name AhciATAPICommand + * @implemented + * + * Handles ATAPI Requests commands * * @param AdapterExtension * @param Srb * @param Cdb * * @return - * return STOR status for DeviceRequestSense - */ -UCHAR DeviceRequestSense ( + * return STOR status for AhciATAPICommand + */ +UCHAR +AhciATAPICommand ( __in PAHCI_ADAPTER_EXTENSION AdapterExtension, __in PSCSI_REQUEST_BLOCK Srb, __in PCDB Cdb ) { + ULONG SrbFlags, DataBufferLength; + PAHCI_SRB_EXTENSION SrbExtension; + PAHCI_PORT_EXTENSION PortExtension; + + AhciDebugPrint("AhciATAPICommand()\n"); + + SrbFlags = Srb->SrbFlags; + SrbExtension = GetSrbExtension(Srb); + DataBufferLength = Srb->DataTransferLength; + PortExtension = &AdapterExtension->PortExtension[Srb->PathId]; + + NT_ASSERT(PortExtension->DeviceParams.DeviceType == AHCI_DEVICE_TYPE_ATAPI); + + NT_ASSERT(SrbExtension != NULL); + + SrbExtension->AtaFunction = ATA_FUNCTION_ATAPI_COMMAND; + SrbExtension->Flags = 0; + + if (SrbFlags & SRB_FLAGS_DATA_IN) + { + SrbExtension->Flags |= ATA_FLAGS_DATA_IN; + } + + if (SrbFlags & SRB_FLAGS_DATA_OUT) + { + SrbExtension->Flags |= ATA_FLAGS_DATA_OUT; + } + + SrbExtension->FeaturesLow = 0; + + SrbExtension->CompletionRoutine = NULL; + + NT_ASSERT(Cdb != NULL); + switch(Cdb->CDB10.OperationCode) + { + case SCSIOP_INQUIRY: + SrbExtension->Flags |= ATA_FLAGS_DATA_IN; + SrbExtension->CompletionRoutine = AtapiInquiryCompletion; + break; + case SCSIOP_READ: + SrbExtension->Flags |= ATA_FLAGS_USE_DMA; + SrbExtension->FeaturesLow = 0x5; + break; + case SCSIOP_WRITE: + SrbExtension->Flags |= ATA_FLAGS_USE_DMA; + SrbExtension->FeaturesLow = 0x1; + break; + } + + SrbExtension->CommandReg = IDE_COMMAND_ATAPI_PACKET; + + SrbExtension->LBA0 = 0; + SrbExtension->LBA1 = (UCHAR)(DataBufferLength >> 0); + SrbExtension->LBA2 = (UCHAR)(DataBufferLength >> 8); + SrbExtension->Device = 0; + SrbExtension->LBA3 = 0; + SrbExtension->LBA4 = 0; + SrbExtension->LBA5 = 0; + SrbExtension->FeaturesHigh = 0; + SrbExtension->SectorCountLow = 0; + SrbExtension->SectorCountHigh = 0; + + if ((SrbExtension->Flags & ATA_FLAGS_DATA_IN) || (SrbExtension->Flags & ATA_FLAGS_DATA_OUT)) + { + SrbExtension->pSgl = (PLOCAL_SCATTER_GATHER_LIST)StorPortGetScatterGatherList(AdapterExtension, Srb); + } + + return SRB_STATUS_PENDING; +}// -- AhciATAPICommand(); + +/** + * @name DeviceRequestSense + * @implemented + * + * Handle SCSIOP_MODE_SENSE OperationCode + * + * @param AdapterExtension + * @param Srb + * @param Cdb + * + * @return + * return STOR status for DeviceRequestSense + */ +UCHAR +DeviceRequestSense ( + __in PAHCI_ADAPTER_EXTENSION AdapterExtension, + __in PSCSI_REQUEST_BLOCK Srb, + __in PCDB Cdb + ) +{ PMODE_PARAMETER_HEADER ModeHeader; + PAHCI_PORT_EXTENSION PortExtension; AhciDebugPrint("DeviceRequestSense()\n"); - - UNREFERENCED_PARAMETER(AdapterExtension); NT_ASSERT(IsPortValid(AdapterExtension, Srb->PathId)); NT_ASSERT(Cdb->CDB10.OperationCode == SCSIOP_MODE_SENSE); + + PortExtension = &AdapterExtension->PortExtension[Srb->PathId]; + + if (PortExtension->DeviceParams.DeviceType == AHCI_DEVICE_TYPE_ATAPI) + { + return AhciATAPICommand(AdapterExtension, Srb, Cdb); + } ModeHeader = (PMODE_PARAMETER_HEADER)Srb->DataBuffer; @@ -1778,9 +1934,10 @@ * @param Cdb * * @return - * return STOR status for DeviceReportLuns - */ -UCHAR DeviceRequestReadWrite ( + * return STOR status for DeviceRequestReadWrite + */ +UCHAR +DeviceRequestReadWrite ( __in PAHCI_ADAPTER_EXTENSION AdapterExtension, __in PSCSI_REQUEST_BLOCK Srb, __in PCDB Cdb @@ -1799,6 +1956,11 @@ SrbExtension = GetSrbExtension(Srb); PortExtension = &AdapterExtension->PortExtension[Srb->PathId]; + + if (PortExtension->DeviceParams.DeviceType == AHCI_DEVICE_TYPE_ATAPI) + { + return AhciATAPICommand(AdapterExtension, Srb, Cdb); + } DataTransferLength = Srb->DataTransferLength; BytesPerSector = PortExtension->DeviceParams.BytesPerLogicalSector; @@ -1882,9 +2044,10 @@ * @param Cdb * * @return - * return STOR status for DeviceReportLuns - */ -UCHAR DeviceRequestCapacity ( + * return STOR status for DeviceRequestCapacity + */ +UCHAR +DeviceRequestCapacity ( __in PAHCI_ADAPTER_EXTENSION AdapterExtension, __in PSCSI_REQUEST_BLOCK Srb, __in PCDB Cdb @@ -1902,7 +2065,13 @@ NT_ASSERT(Srb->DataBuffer != NULL); NT_ASSERT(IsPortValid(AdapterExtension, Srb->PathId)); + PortExtension = &AdapterExtension->PortExtension[Srb->PathId]; + + if (PortExtension->DeviceParams.DeviceType == AHCI_DEVICE_TYPE_ATAPI) + { + return AhciATAPICommand(AdapterExtension, Srb, Cdb); + } if (Cdb->CDB10.OperationCode == SCSIOP_READ_CAPACITY) { @@ -1945,7 +2114,8 @@ * @return * return STOR status for DeviceRequestComplete */ -UCHAR DeviceRequestComplete ( +UCHAR +DeviceRequestComplete ( __in PAHCI_ADAPTER_EXTENSION AdapterExtension, __in PSCSI_REQUEST_BLOCK Srb, __in PCDB Cdb @@ -1974,21 +2144,29 @@ * @return * return STOR status for DeviceReportLuns */ -UCHAR DeviceReportLuns ( +UCHAR +DeviceReportLuns ( __in PAHCI_ADAPTER_EXTENSION AdapterExtension, __in PSCSI_REQUEST_BLOCK Srb, __in PCDB Cdb ) { PLUN_LIST LunList; + PAHCI_PORT_EXTENSION PortExtension; AhciDebugPrint("DeviceReportLuns()\n"); - UNREFERENCED_PARAMETER(AdapterExtension); UNREFERENCED_PARAMETER(Cdb); + + PortExtension = &AdapterExtension->PortExtension[Srb->PathId]; NT_ASSERT(Srb->DataTransferLength >= sizeof(LUN_LIST)); NT_ASSERT(Cdb->CDB10.OperationCode == SCSIOP_REPORT_LUNS); + + if (PortExtension->DeviceParams.DeviceType == AHCI_DEVICE_TYPE_ATAPI) + { + return AhciATAPICommand(AdapterExtension, Srb, Cdb); + } LunList = (PLUN_LIST)Srb->DataBuffer; @@ -2040,6 +2218,11 @@ SrbExtension = GetSrbExtension(Srb); PortExtension = &AdapterExtension->PortExtension[Srb->PathId]; + + if (PortExtension->DeviceParams.DeviceType == AHCI_DEVICE_TYPE_ATAPI) + { + return AhciATAPICommand(AdapterExtension, Srb, Cdb); + } if (Srb->Lun != 0) {
8 years, 4 months
1
0
0
0
[dchapyshev] 72329: [KERNEL32] - Update Russian translation
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Thu Aug 18 17:23:11 2016 New Revision: 72329 URL:
http://svn.reactos.org/svn/reactos?rev=72329&view=rev
Log: [KERNEL32] - Update Russian translation Modified: trunk/reactos/dll/win32/kernel32/winnls/lang/ru-RU.rc Modified: trunk/reactos/dll/win32/kernel32/winnls/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/winnls/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/winnls/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/winnls/lang/ru-RU.rc [iso-8859-1] Thu Aug 18 17:23:11 2016 @@ -226,156 +226,156 @@ 84+NLSRC_OFFSET "ФÑанÑиÑ" 86+NLSRC_OFFSET "ÐамбиÑ" 87+NLSRC_OFFSET "Ðабон" - 88+NLSRC_OFFSET "Georgia" - 89+NLSRC_OFFSET "Ghana" - 90+NLSRC_OFFSET "Gibraltar" - 91+NLSRC_OFFSET "Grenada" - 93+NLSRC_OFFSET "Greenland" - 94+NLSRC_OFFSET "Germany" - 98+NLSRC_OFFSET "Greece" - 99+NLSRC_OFFSET "Guatemala" - 100+NLSRC_OFFSET "Guinea" - 101+NLSRC_OFFSET "Guyana" - 103+NLSRC_OFFSET "Haiti" - 104+NLSRC_OFFSET "Hong Kong S.A.R." - 106+NLSRC_OFFSET "Honduras" - 108+NLSRC_OFFSET "Croatia" - 109+NLSRC_OFFSET "Hungary" - 110+NLSRC_OFFSET "Iceland" - 111+NLSRC_OFFSET "Indonesia" - 113+NLSRC_OFFSET "India" - 114+NLSRC_OFFSET "British Indian Ocean Territory" - 116+NLSRC_OFFSET "Iran" - 117+NLSRC_OFFSET "Israel" - 118+NLSRC_OFFSET "Italy" - 119+NLSRC_OFFSET "Côte d'Ivoire" - 121+NLSRC_OFFSET "Iraq" - 122+NLSRC_OFFSET "Japan" - 124+NLSRC_OFFSET "Jamaica" - 125+NLSRC_OFFSET "Jan Mayen" - 126+NLSRC_OFFSET "Jordan" - 127+NLSRC_OFFSET "Johnston Atoll" - 129+NLSRC_OFFSET "Kenya" - 130+NLSRC_OFFSET "Kyrgyzstan" - 131+NLSRC_OFFSET "North Korea" - 133+NLSRC_OFFSET "Kiribati" + 88+NLSRC_OFFSET "ÐжоÑджиÑ" + 89+NLSRC_OFFSET "Ðана" + 90+NLSRC_OFFSET "ÐибÑалÑаÑ" + 91+NLSRC_OFFSET "ÐÑенада" + 93+NLSRC_OFFSET "ÐÑенландиÑ" + 94+NLSRC_OFFSET "ÐеÑманиÑ" + 98+NLSRC_OFFSET "ÐÑеÑиÑ" + 99+NLSRC_OFFSET "ÐваÑемала" + 100+NLSRC_OFFSET "ÐвинеÑ" + 101+NLSRC_OFFSET "Ðайана" + 103+NLSRC_OFFSET "ÐаиÑи" + 104+NLSRC_OFFSET "Ðонконг S.A.R." + 106+NLSRC_OFFSET "ÐондÑÑаÑ" + 108+NLSRC_OFFSET "ХоÑваÑиÑ" + 109+NLSRC_OFFSET "ÐенгÑиÑ" + 110+NLSRC_OFFSET "ÐÑландиÑ" + 111+NLSRC_OFFSET "ÐндонезиÑ" + 113+NLSRC_OFFSET "ÐндиÑ" + 114+NLSRC_OFFSET "ÐÑиÑанÑÐºÐ°Ñ ÑеÑÑиÑоÑÐ¸Ñ Ð² ÐндийÑком океане" + 116+NLSRC_OFFSET "ÐÑан" + 117+NLSRC_OFFSET "ÐзÑаилÑ" + 118+NLSRC_OFFSET "ÐÑалиÑ" + 119+NLSRC_OFFSET "ÐоÑ-д'ÐвÑаÑ" + 121+NLSRC_OFFSET "ÐÑак" + 122+NLSRC_OFFSET "ЯпониÑ" + 124+NLSRC_OFFSET "Ямайка" + 125+NLSRC_OFFSET "Ян Ðейен" + 126+NLSRC_OFFSET "ÐоÑданиÑ" + 127+NLSRC_OFFSET "ÐжонÑÑонÑкий аÑолл" + 129+NLSRC_OFFSET "ÐениÑ" + 130+NLSRC_OFFSET "ÐÑÑгÑзÑÑан" + 131+NLSRC_OFFSET "СевеÑÐ½Ð°Ñ ÐоÑеÑ" + 133+NLSRC_OFFSET "ÐиÑибаÑи" 134+NLSRC_OFFSET "ÐоÑеÑ" 136+NLSRC_OFFSET "ÐÑвейÑ" 137+NLSRC_OFFSET "ÐÐ°Ð·Ð°Ñ ÑÑан" - 138+NLSRC_OFFSET "Laos" - 139+NLSRC_OFFSET "Lebanon" - 140+NLSRC_OFFSET "Latvia" - 141+NLSRC_OFFSET "Lithuania" - 142+NLSRC_OFFSET "Liberia" - 143+NLSRC_OFFSET "Slovakia" - 145+NLSRC_OFFSET "Liechtenstein" - 146+NLSRC_OFFSET "Lesotho" - 147+NLSRC_OFFSET "Luxembourg" - 148+NLSRC_OFFSET "Libya" - 149+NLSRC_OFFSET "Madagascar" - 151+NLSRC_OFFSET "Macao S.A.R." - 152+NLSRC_OFFSET "Moldova" - 154+NLSRC_OFFSET "Mongolia" - 156+NLSRC_OFFSET "Malawi" - 157+NLSRC_OFFSET "Mali" - 158+NLSRC_OFFSET "Monaco" - 159+NLSRC_OFFSET "Morocco" - 160+NLSRC_OFFSET "Mauritius" - 162+NLSRC_OFFSET "Mauritania" - 163+NLSRC_OFFSET "Malta" - 164+NLSRC_OFFSET "Oman" - 165+NLSRC_OFFSET "Maldives" - 166+NLSRC_OFFSET "Mexico" - 167+NLSRC_OFFSET "Malaysia" - 168+NLSRC_OFFSET "Mozambique" - 173+NLSRC_OFFSET "Niger" - 174+NLSRC_OFFSET "Vanuatu" - 175+NLSRC_OFFSET "Nigeria" - 176+NLSRC_OFFSET "Netherlands" - 177+NLSRC_OFFSET "Norway" - 178+NLSRC_OFFSET "Nepal" - 180+NLSRC_OFFSET "Nauru" - 181+NLSRC_OFFSET "Suriname" - 182+NLSRC_OFFSET "Nicaragua" - 183+NLSRC_OFFSET "New Zealand" - 184+NLSRC_OFFSET "Palestinian Authority" - 185+NLSRC_OFFSET "Paraguay" - 187+NLSRC_OFFSET "Peru" - 190+NLSRC_OFFSET "Pakistan" - 191+NLSRC_OFFSET "Poland" - 192+NLSRC_OFFSET "Panama" - 193+NLSRC_OFFSET "Portugal" - 194+NLSRC_OFFSET "Papua New Guinea" - 195+NLSRC_OFFSET "Palau" - 196+NLSRC_OFFSET "Guinea-Bissau" - 197+NLSRC_OFFSET "Qatar" - 198+NLSRC_OFFSET "Reunion" - 199+NLSRC_OFFSET "Marshall Islands" - 200+NLSRC_OFFSET "Romania" - 201+NLSRC_OFFSET "Philippines" - 202+NLSRC_OFFSET "Puerto Rico" + 138+NLSRC_OFFSET "ÐаоÑ" + 139+NLSRC_OFFSET "Ðиван" + 140+NLSRC_OFFSET "ÐаÑвиÑ" + 141+NLSRC_OFFSET "ÐиÑва" + 142+NLSRC_OFFSET "ÐибеÑиÑ" + 143+NLSRC_OFFSET "СловакиÑ" + 145+NLSRC_OFFSET "ÐÐ¸Ñ ÑенÑÑейн" + 146+NLSRC_OFFSET "ÐеÑоÑо" + 147+NLSRC_OFFSET "ÐÑкÑембÑÑг" + 148+NLSRC_OFFSET "ÐивиÑ" + 149+NLSRC_OFFSET "ÐадагаÑкаÑ" + 151+NLSRC_OFFSET "Ðакао S.A.R." + 152+NLSRC_OFFSET "Ðолдова" + 154+NLSRC_OFFSET "ÐонголиÑ" + 156+NLSRC_OFFSET "Ðалави" + 157+NLSRC_OFFSET "Ðали" + 158+NLSRC_OFFSET "Ðонако" + 159+NLSRC_OFFSET "ÐаÑокко" + 160+NLSRC_OFFSET "ÐавÑикий" + 162+NLSRC_OFFSET "ÐавÑиÑаниÑ" + 163+NLSRC_OFFSET "ÐалÑÑа" + 164+NLSRC_OFFSET "Ðман" + 165+NLSRC_OFFSET "ÐалÑдивÑ" + 166+NLSRC_OFFSET "ÐекÑика" + 167+NLSRC_OFFSET "ÐалайзиÑ" + 168+NLSRC_OFFSET "Ðозамбик" + 173+NLSRC_OFFSET "ÐигеÑ" + 174+NLSRC_OFFSET "ÐанÑаÑÑ" + 175+NLSRC_OFFSET "ÐигеÑиÑ" + 176+NLSRC_OFFSET "ÐидеÑландÑ" + 177+NLSRC_OFFSET "ÐоÑвегиÑ" + 178+NLSRC_OFFSET "Ðепал" + 180+NLSRC_OFFSET "ÐаÑÑÑ" + 181+NLSRC_OFFSET "СÑÑинам" + 182+NLSRC_OFFSET "ÐикаÑагÑа" + 183+NLSRC_OFFSET "ÐÐ¾Ð²Ð°Ñ ÐеландиÑ" + 184+NLSRC_OFFSET "ÐалеÑÑинÑÐºÐ°Ñ ÐвÑономиÑ" + 185+NLSRC_OFFSET "ÐаÑагвай" + 187+NLSRC_OFFSET "ÐеÑÑ" + 190+NLSRC_OFFSET "ÐакиÑÑан" + 191+NLSRC_OFFSET "ÐолÑÑа" + 192+NLSRC_OFFSET "Ðанама" + 193+NLSRC_OFFSET "ÐоÑÑÑгалиÑ" + 194+NLSRC_OFFSET "ÐапÑа - ÐÐ¾Ð²Ð°Ñ ÐвинеÑ" + 195+NLSRC_OFFSET "ÐалаÑ" + 196+NLSRC_OFFSET "ÐвинеÑ-ÐиÑаÑ" + 197+NLSRC_OFFSET "ÐаÑаÑ" + 198+NLSRC_OFFSET "ÐоÑÑоединение" + 199+NLSRC_OFFSET "ÐаÑÑÐ°Ð»Ð»Ð¾Ð²Ñ ÐÑÑÑова" + 200+NLSRC_OFFSET "Ð ÑмÑниÑ" + 201+NLSRC_OFFSET "ФилиппинÑ" + 202+NLSRC_OFFSET "ÐÑÑÑÑо-Рико" 203+NLSRC_OFFSET "РоÑÑиÑ" - 204+NLSRC_OFFSET "Rwanda" - 205+NLSRC_OFFSET "Saudi Arabia" - 206+NLSRC_OFFSET "St. Pierre and Miquelon" - 207+NLSRC_OFFSET "St. Kitts and Nevis" - 208+NLSRC_OFFSET "Seychelles" - 209+NLSRC_OFFSET "South Africa" - 210+NLSRC_OFFSET "Senegal" - 212+NLSRC_OFFSET "Slovenia" - 213+NLSRC_OFFSET "Sierra Leone" - 214+NLSRC_OFFSET "San Marino" - 215+NLSRC_OFFSET "Singapore" - 216+NLSRC_OFFSET "Somalia" - 217+NLSRC_OFFSET "Spain" - 218+NLSRC_OFFSET "St. Lucia" - 219+NLSRC_OFFSET "Sudan" - 220+NLSRC_OFFSET "Svalbard" - 221+NLSRC_OFFSET "Sweden" - 222+NLSRC_OFFSET "Syria" - 223+NLSRC_OFFSET "Switzerland" - 224+NLSRC_OFFSET "United Arab Emirates" - 225+NLSRC_OFFSET "Trinidad and Tobago" - 227+NLSRC_OFFSET "Thailand" - 228+NLSRC_OFFSET "Tajikistan" - 231+NLSRC_OFFSET "Tonga" - 232+NLSRC_OFFSET "Togo" - 233+NLSRC_OFFSET "São Tomé and PrÃncipe" - 234+NLSRC_OFFSET "Tunisia" - 235+NLSRC_OFFSET "Turkey" - 236+NLSRC_OFFSET "Tuvalu" - 237+NLSRC_OFFSET "Taiwan" - 238+NLSRC_OFFSET "Turkmenistan" - 239+NLSRC_OFFSET "Tanzania" - 240+NLSRC_OFFSET "Uganda" + 204+NLSRC_OFFSET "Ð Ñанда" + 205+NLSRC_OFFSET "СаÑдовÑÐºÐ°Ñ ÐÑавиÑ" + 206+NLSRC_OFFSET "Св. ÐÑÐµÑ Ð¸ Ðиклон" + 207+NLSRC_OFFSET "СенÑ-ÐиÑÑ Ð¸ ÐевиÑ" + 208+NLSRC_OFFSET "СейÑелÑÑкие оÑÑÑова" + 209+NLSRC_OFFSET "Ð®Ð¶Ð½Ð°Ñ ÐÑÑика" + 210+NLSRC_OFFSET "Сенегал" + 212+NLSRC_OFFSET "СловениÑ" + 213+NLSRC_OFFSET "СÑеÑÑа-Ðеоне" + 214+NLSRC_OFFSET "Сан-ÐаÑино" + 215+NLSRC_OFFSET "СингапÑÑ" + 216+NLSRC_OFFSET "Сомали" + 217+NLSRC_OFFSET "ÐÑпаниÑ" + 218+NLSRC_OFFSET "СенÑ-ÐÑÑиÑ" + 219+NLSRC_OFFSET "СÑдан" + 220+NLSRC_OFFSET "ШпиÑбеÑген" + 221+NLSRC_OFFSET "ШвеÑиÑ" + 222+NLSRC_OFFSET "СиÑиÑ" + 223+NLSRC_OFFSET "ШвейÑаÑиÑ" + 224+NLSRC_OFFSET "ÐбÑединеннÑе ÐÑабÑкие ÐмиÑаÑÑ" + 225+NLSRC_OFFSET "ТÑинидад и Тобаго" + 227+NLSRC_OFFSET "Таиланд" + 228+NLSRC_OFFSET "ТаджикиÑÑан" + 231+NLSRC_OFFSET "Тонга" + 232+NLSRC_OFFSET "Того" + 233+NLSRC_OFFSET "Сан-Томе и ÐÑинÑипи" + 234+NLSRC_OFFSET "ТÑниÑ" + 235+NLSRC_OFFSET "ТÑÑÑиÑ" + 236+NLSRC_OFFSET "ТÑвалÑ" + 237+NLSRC_OFFSET "ТайванÑ" + 238+NLSRC_OFFSET "ТÑÑкмениÑÑан" + 239+NLSRC_OFFSET "ТанзаниÑ" + 240+NLSRC_OFFSET "Уганда" 241+NLSRC_OFFSET "УкÑаина" 242+NLSRC_OFFSET "Соединенное ÐоÑолевÑÑво" 244+NLSRC_OFFSET "СоединеннÑе ШÑаÑÑ" - 245+NLSRC_OFFSET "Burkina Faso" - 246+NLSRC_OFFSET "Uruguay" + 245+NLSRC_OFFSET "ÐÑÑкина-ФаÑо" + 246+NLSRC_OFFSET "УÑÑгвай" 247+NLSRC_OFFSET "УзбекиÑÑан" - 248+NLSRC_OFFSET "St. Vincent and the Grenadines" - 249+NLSRC_OFFSET "Bolivarian Republic of Venezuela" - 251+NLSRC_OFFSET "Vietnam" - 252+NLSRC_OFFSET "Virgin Islands" - 253+NLSRC_OFFSET "Vatican City" - 254+NLSRC_OFFSET "Namibia" - 257+NLSRC_OFFSET "Western Sahara (disputed)" - 258+NLSRC_OFFSET "Wake Island" - 259+NLSRC_OFFSET "Samoa" - 260+NLSRC_OFFSET "Swaziland" - 261+NLSRC_OFFSET "Yemen" - 263+NLSRC_OFFSET "Zambia" - 264+NLSRC_OFFSET "Zimbabwe" - 269+NLSRC_OFFSET "Serbia and Montenegro (Former)" - 270+NLSRC_OFFSET "Montenegro" - 271+NLSRC_OFFSET "Serbia" - 273+NLSRC_OFFSET "Curaçao" - 276+NLSRC_OFFSET "South Sudan" - 300+NLSRC_OFFSET "Anguilla" - 301+NLSRC_OFFSET "Antarctica" - 302+NLSRC_OFFSET "Aruba" - 303+NLSRC_OFFSET "Ascension Island" + 248+NLSRC_OFFSET "СенÑ-ÐинÑÐµÐ½Ñ Ð¸ ÐÑенадинÑ" + 249+NLSRC_OFFSET "ÐоливаÑианÑÐºÐ°Ñ Ð ÐµÑпÑблика ÐенеÑÑÑла" + 251+NLSRC_OFFSET "ÐÑеÑнам" + 252+NLSRC_OFFSET "ÐиÑгинÑкие оÑÑÑова" + 253+NLSRC_OFFSET "ÐаÑикан" + 254+NLSRC_OFFSET "ÐамибиÑ" + 257+NLSRC_OFFSET "ÐÐ°Ð¿Ð°Ð´Ð½Ð°Ñ Ð¡Ð°Ñ Ð°Ñа (оÑпаÑиваеÑÑÑ)" + 258+NLSRC_OFFSET "ÐÑÑÑов УÑйк" + 259+NLSRC_OFFSET "Самоа" + 260+NLSRC_OFFSET "Свазиленд" + 261+NLSRC_OFFSET "Ðемен" + 263+NLSRC_OFFSET "ÐамбиÑ" + 264+NLSRC_OFFSET "Ðимбабве" + 269+NLSRC_OFFSET "СеÑÐ±Ð¸Ñ Ð¸ ЧеÑногоÑÐ¸Ñ (бÑвÑаÑ)" + 270+NLSRC_OFFSET "ЧеÑногоÑиÑ" + 271+NLSRC_OFFSET "СеÑбиÑ" + 273+NLSRC_OFFSET "ÐÑÑаÑао" + 276+NLSRC_OFFSET "ЮжнÑй СÑдан" + 300+NLSRC_OFFSET "ÐнгилÑÑ" + 301+NLSRC_OFFSET "ÐнÑаÑкÑида" + 302+NLSRC_OFFSET "ÐÑÑба" + 303+NLSRC_OFFSET "ÐÑÑÑов ÐознеÑениÑ" 304+NLSRC_OFFSET "о-ва ÐÑÐ¼Ð¾Ñ Ð¸ ÐаÑÑÑе" 305+NLSRC_OFFSET "о. ÐÑйкеÑ" 306+NLSRC_OFFSET "о. ÐÑвеÑ" @@ -421,12 +421,12 @@ 351+NLSRC_OFFSET "ÐÑиÑанÑкие ÐиÑгинÑкие о-ва" 352+NLSRC_OFFSET "Ð£Ð¾Ð»Ð»Ð¸Ñ Ð¸ ФÑÑÑна" 15126+NLSRC_OFFSET "Man, Isle of" - 19618+NLSRC_OFFSET "Macedonia, Former Yugoslav Republic of" - 21242+NLSRC_OFFSET "Midway Islands" - 30967+NLSRC_OFFSET "Sint Maarten (Dutch part)" - 31706+NLSRC_OFFSET "Saint Martin (French part)" - (7299303+NLSRC_OFFSET)&0xffff "Democratic Republic of Timor-Leste" - (10028789+NLSRC_OFFSET)&0xffff "à land Islands" - (161832015+NLSRC_OFFSET)&0xffff "Saint-Barthélemy" + 19618+NLSRC_OFFSET "ÐакедониÑ, бÑвÑÐ°Ñ ÑгоÑлавÑÐºÐ°Ñ ÑеÑпÑблика" + 21242+NLSRC_OFFSET "ÐÑолл ÐидÑÑй" + 30967+NLSRC_OFFSET "СинÑ-ÐаÑÑен (голландÑÐºÐ°Ñ ÑаÑÑÑ)" + 31706+NLSRC_OFFSET "Сен-ÐаÑÑен (ÑÑанÑÑзÑÐºÐ°Ñ ÑаÑÑÑ)" + (7299303+NLSRC_OFFSET)&0xffff "ÐемокÑаÑиÑеÑÐºÐ°Ñ Ð ÐµÑпÑблика ТимоÑ-ÐеÑÑе" + (10028789+NLSRC_OFFSET)&0xffff "ÐландÑкие оÑÑÑова" + (161832015+NLSRC_OFFSET)&0xffff "Сен-ÐаÑÑелеми" (161832256+NLSRC_OFFSET)&0xffff "U.S. Minor Outlying Islands" END
8 years, 4 months
1
0
0
0
← Newer
1
...
17
18
19
20
21
22
23
...
47
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Results per page:
10
25
50
100
200