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
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
June 2009
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
21 participants
496 discussions
Start a n
N
ew thread
[sginsberg] 41428: - Replace "VOLATILE" with "volatile"
by sginsberg@svn.reactos.org
Author: sginsberg Date: Wed Jun 17 02:20:27 2009 New Revision: 41428 URL:
http://svn.reactos.org/svn/reactos?rev=41428&view=rev
Log: - Replace "VOLATILE" with "volatile" Modified: trunk/reactos/include/ddk/wdm.h trunk/reactos/include/ddk/winddk.h Modified: trunk/reactos/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/wdm.h?rev=4142…
============================================================================== --- trunk/reactos/include/ddk/wdm.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/wdm.h [iso-8859-1] Wed Jun 17 02:20:27 2009 @@ -467,7 +467,7 @@ /* * PVOID * InterlockedExchangePointer( - * IN OUT PVOID VOLATILE *Target, + * IN OUT PVOID volatile *Target, * IN PVOID Value) */ #define InterlockedExchangePointer(Target, Value) \ Modified: trunk/reactos/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/winddk.h?rev=4…
============================================================================== --- trunk/reactos/include/ddk/winddk.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/winddk.h [iso-8859-1] Wed Jun 17 02:20:27 2009 @@ -48,7 +48,6 @@ #define UNALLIGNED #define CONST const -#define VOLATILE volatile #define RESTRICTED_POINTER @@ -1213,8 +1212,8 @@ } KSPIN_LOCK_QUEUE_NUMBER, *PKSPIN_LOCK_QUEUE_NUMBER; typedef struct _KSPIN_LOCK_QUEUE { - struct _KSPIN_LOCK_QUEUE *VOLATILE Next; - PKSPIN_LOCK VOLATILE Lock; + struct _KSPIN_LOCK_QUEUE *volatile Next; + PKSPIN_LOCK volatile Lock; } KSPIN_LOCK_QUEUE, *PKSPIN_LOCK_QUEUE; typedef struct _KLOCK_QUEUE_HANDLE {
15 years, 5 months
1
0
0
0
[cwittich] 41427: attempt to convert most of this mess into something which at least look like C code
by cwittich@svn.reactos.org
Author: cwittich Date: Wed Jun 17 01:12:47 2009 New Revision: 41427 URL:
http://svn.reactos.org/svn/reactos?rev=41427&view=rev
Log: attempt to convert most of this mess into something which at least look like C code Modified: trunk/reactos/base/applications/paint/dib.c trunk/reactos/base/applications/paint/drawing.c trunk/reactos/base/applications/paint/history.c trunk/reactos/base/applications/paint/main.c trunk/reactos/base/applications/paint/mouse.c trunk/reactos/base/applications/paint/palette.c trunk/reactos/base/applications/paint/selection.c trunk/reactos/base/applications/paint/toolsettings.c trunk/reactos/base/applications/paint/winproc.c Modified: trunk/reactos/base/applications/paint/dib.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/paint/di…
============================================================================== --- trunk/reactos/base/applications/paint/dib.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/paint/dib.c [iso-8859-1] Wed Jun 17 01:12:47 2009 @@ -46,10 +46,15 @@ void SaveDIBToFile(HBITMAP hbm, LPTSTR name, HDC hdc) { BITMAP bm; - GetObject(hbm, sizeof(BITMAP), &bm); + HANDLE hFile; BITMAPFILEHEADER bf; BITMAPINFOHEADER bi; - int imgDataSize = bm.bmWidthBytes*bm.bmHeight; + int imgDataSize; + int bytesWritten; + + GetObject(hbm, sizeof(BITMAP), &bm); + + imgDataSize = bm.bmWidthBytes*bm.bmHeight; bf.bfType = 0x4d42; bf.bfSize = imgDataSize+52; bf.bfReserved1 = 0; @@ -68,12 +73,11 @@ bi.biClrImportant = 0; int *buffer = HeapAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, imgDataSize); GetDIBits(hdc, hbm, 0, bm.bmHeight, buffer, (LPBITMAPINFO)&bi, DIB_RGB_COLORS); - HANDLE f = CreateFile(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_SEQUENTIAL_SCAN, NULL); - int bytesWritten; - WriteFile(f, &bf, 14, (LPDWORD)&bytesWritten, NULL); - WriteFile(f, &bi, 40, (LPDWORD)&bytesWritten, NULL); - WriteFile(f, buffer, imgDataSize, (LPDWORD)&bytesWritten, NULL); - CloseHandle(f); + hFile = CreateFile(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_SEQUENTIAL_SCAN, NULL); + WriteFile(hFile, &bf, 14, (LPDWORD)&bytesWritten, NULL); + WriteFile(hFile, &bi, 40, (LPDWORD)&bytesWritten, NULL); + WriteFile(hFile, buffer, imgDataSize, (LPDWORD)&bytesWritten, NULL); + CloseHandle(hFile); HeapFree(GetProcessHeap(), 0, buffer); } Modified: trunk/reactos/base/applications/paint/drawing.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/paint/dr…
============================================================================== --- trunk/reactos/base/applications/paint/drawing.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/paint/drawing.c [iso-8859-1] Wed Jun 17 01:12:47 2009 @@ -22,12 +22,13 @@ void Rect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, BOOL filled) { + HBRUSH oldBrush; + LOGBRUSH logbrush; HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg)); - LOGBRUSH logbrush; if (filled) logbrush.lbStyle = BS_SOLID; else logbrush.lbStyle = BS_HOLLOW; logbrush.lbColor = bg; logbrush.lbHatch = 0; - HBRUSH oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); + oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); Rectangle(hdc, x1, y1, x2, y2); DeleteObject(SelectObject(hdc, oldBrush)); DeleteObject(SelectObject(hdc, oldPen)); @@ -35,12 +36,13 @@ void Ellp(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, BOOL filled) { + HBRUSH oldBrush; + LOGBRUSH logbrush; HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg)); - LOGBRUSH logbrush; if (filled) logbrush.lbStyle = BS_SOLID; else logbrush.lbStyle = BS_HOLLOW; logbrush.lbColor = bg; logbrush.lbHatch = 0; - HBRUSH oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); + oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); Ellipse(hdc, x1, y1, x2, y2); DeleteObject(SelectObject(hdc, oldBrush)); DeleteObject(SelectObject(hdc, oldPen)); @@ -48,12 +50,13 @@ void RRect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, BOOL filled) { + LOGBRUSH logbrush; + HBRUSH oldBrush; HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg)); - LOGBRUSH logbrush; if (filled) logbrush.lbStyle = BS_SOLID; else logbrush.lbStyle = BS_HOLLOW; logbrush.lbColor = bg; logbrush.lbHatch = 0; - HBRUSH oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); + oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); RoundRect(hdc, x1, y1, x2, y2, 16, 16); DeleteObject(SelectObject(hdc, oldBrush)); DeleteObject(SelectObject(hdc, oldPen)); @@ -68,9 +71,10 @@ void Erase(HDC hdc, short x1, short y1, short x2, short y2, int color, int radius) { - HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, color)); + short a; + HPEN oldPen; HBRUSH oldBrush = SelectObject(hdc, CreateSolidBrush(color)); - short a; + oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, color)); for (a=0; a<=100; a++) Rectangle(hdc, (x1*(100-a)+x2*a)/100-radius+1, (y1*(100-a)+y2*a)/100-radius+1, (x1*(100-a)+x2*a)/100+radius+1, (y1*(100-a)+y2*a)/100+radius+1); DeleteObject(SelectObject(hdc, oldBrush)); @@ -165,12 +169,13 @@ void RectSel(HDC hdc, short x1, short y1, short x2, short y2) { + HBRUSH oldBrush; + LOGBRUSH logbrush; HPEN oldPen = SelectObject(hdc, CreatePen(PS_DOT, 1, 0x00000000)); - LOGBRUSH logbrush; logbrush.lbStyle = BS_HOLLOW; logbrush.lbColor = 0; logbrush.lbHatch = 0; - HBRUSH oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); + oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); Rectangle(hdc, x1, y1, x2, y2); DeleteObject(SelectObject(hdc, oldBrush)); DeleteObject(SelectObject(hdc, oldPen)); @@ -178,12 +183,13 @@ void SelectionFrame(HDC hdc, int x1, int y1, int x2, int y2) { + HBRUSH oldBrush; + LOGBRUSH logbrush; HPEN oldPen = SelectObject(hdc, CreatePen(PS_DOT, 1, 0x00000000)); - LOGBRUSH logbrush; logbrush.lbStyle = BS_HOLLOW; logbrush.lbColor = 0; logbrush.lbHatch = 0; - HBRUSH oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); + oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); Rectangle(hdc, x1, y1, x2, y2); DeleteObject(SelectObject(hdc, oldBrush)); DeleteObject(SelectObject(hdc, oldPen)); Modified: trunk/reactos/base/applications/paint/history.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/paint/hi…
============================================================================== --- trunk/reactos/base/applications/paint/history.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/paint/history.c [iso-8859-1] Wed Jun 17 01:12:47 2009 @@ -93,6 +93,10 @@ void cropReversible(int x, int y)//FIXME: This function is broken { + HBITMAP oldBitmap; + HPEN oldPen; + HBRUSH oldBrush; + SelectObject(hDrawingDC, hBms[currInd]); DeleteObject(hBms[(currInd+1)%4]); hBms[(currInd+1)%4] = CreateDIBWithProperties(x, y); @@ -100,9 +104,9 @@ if (undoSteps<3) undoSteps++; redoSteps = 0; - HBITMAP oldBitmap = SelectObject(hSelDC, hBms[currInd]); - HPEN oldPen = SelectObject(hSelDC, CreatePen(PS_SOLID, 1, bgColor)); - HBRUSH oldBrush = SelectObject(hSelDC, CreateSolidBrush(bgColor)); + oldBitmap = SelectObject(hSelDC, hBms[currInd]); + oldPen = SelectObject(hSelDC, CreatePen(PS_SOLID, 1, bgColor)); + oldBrush = SelectObject(hSelDC, CreateSolidBrush(bgColor)); Rectangle(hSelDC, 0, 0, x, y); DeleteObject(SelectObject(hSelDC, oldBrush)); DeleteObject(SelectObject(hSelDC, oldPen)); Modified: trunk/reactos/base/applications/paint/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/paint/ma…
============================================================================== --- trunk/reactos/base/applications/paint/main.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/paint/main.c [iso-8859-1] Wed Jun 17 01:12:47 2009 @@ -104,15 +104,39 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument, int nFunsterStil) { - hProgInstance = hThisInstance; HWND hwnd; /* This is the handle for our window */ MSG messages; /* Here messages to the application are saved */ - - // Necessary + WNDCLASSEX wclScroll; + WNDCLASSEX wincl; + WNDCLASSEX wclPal; + WNDCLASSEX wclSettings; + WNDCLASSEX wclSelection; + TCHAR progtitle[1000]; + TCHAR resstr[100]; + HMENU menu; + HWND hToolbar; + HIMAGELIST hImageList; + HANDLE haccel; + HBITMAP tempBm; + int i; + TCHAR tooltips[16][30]; + TCHAR *c; + TCHAR sfnFilename[1000]; + TCHAR sfnFiletitle[256]; + TCHAR sfnFilter[1000]; + TCHAR ofnFilename[1000]; + TCHAR ofnFiletitle[256]; + TCHAR ofnFilter[1000]; + int custColors[16] = + {0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, + 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff}; + + hProgInstance = hThisInstance; + + /* Necessary */ InitCommonControls(); - //initializing and registering the window class used for the main window - WNDCLASSEX wincl; + /* initializing and registering the window class used for the main window */ wincl.hInstance = hThisInstance; wincl.lpszClassName = _T("WindowsApp"); wincl.lpfnWndProc = WindowProcedure; @@ -127,9 +151,7 @@ wincl.hbrBackground = GetSysColorBrush(COLOR_BTNFACE); RegisterClassEx (&wincl); - // initializing and registering the window class used for the scroll box - - WNDCLASSEX wclScroll; + /* initializing and registering the window class used for the scroll box */ wclScroll.hInstance = hThisInstance; wclScroll.lpszClassName = _T("Scrollbox"); wclScroll.lpfnWndProc = WindowProcedure; @@ -144,9 +166,7 @@ wclScroll.hbrBackground = GetSysColorBrush(COLOR_APPWORKSPACE); RegisterClassEx (&wclScroll); - // initializing and registering the window class used for the palette window - - WNDCLASSEX wclPal; + /* initializing and registering the window class used for the palette window */ wclPal.hInstance = hThisInstance; wclPal.lpszClassName = _T("Palette"); wclPal.lpfnWndProc = PalWinProc; @@ -161,9 +181,7 @@ wclPal.hbrBackground = GetSysColorBrush(COLOR_BTNFACE); RegisterClassEx (&wclPal); - // initializing and registering the window class for the settings window - - WNDCLASSEX wclSettings; + /* initializing and registering the window class for the settings window */ wclSettings.hInstance = hThisInstance; wclSettings.lpszClassName = _T("ToolSettings"); wclSettings.lpfnWndProc = SettingsWinProc; @@ -178,9 +196,7 @@ wclSettings.hbrBackground = GetSysColorBrush(COLOR_BTNFACE); RegisterClassEx (&wclSettings); - // initializing and registering the window class for the selection frame - - WNDCLASSEX wclSelection; + /* initializing and registering the window class for the selection frame */ wclSelection.hInstance = hThisInstance; wclSelection.lpszClassName = _T("Selection"); wclSelection.lpfnWndProc = SelectionWinProc; @@ -196,24 +212,21 @@ RegisterClassEx (&wclSelection); LoadString(hThisInstance, IDS_DEFAULTFILENAME, filename, SIZEOF(filename)); - TCHAR progtitle[1000]; - TCHAR resstr[100]; LoadString(hThisInstance, IDS_WINDOWTITLE, resstr, SIZEOF(resstr)); _stprintf(progtitle, resstr, filename); - // create main window + /* create main window */ hwnd = CreateWindowEx (0, _T("WindowsApp"), progtitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 544, 375, HWND_DESKTOP, NULL, hThisInstance, NULL); hMainWnd = hwnd; - // loading and setting the window menu from resource - HMENU menu; + /* loading and setting the window menu from resource */ menu = LoadMenu(hThisInstance, MAKEINTRESOURCE(ID_MENU)); SetMenu(hwnd, menu); - HANDLE haccel = LoadAccelerators(hThisInstance, MAKEINTRESOURCE(800)); - - // preloading the draw transparent/nontransparent icons for later use + haccel = LoadAccelerators(hThisInstance, MAKEINTRESOURCE(800)); + + /* preloading the draw transparent/nontransparent icons for later use */ hNontranspIcon = LoadImage(hThisInstance, MAKEINTRESOURCE(IDI_NONTRANSPARENT), IMAGE_ICON, 40, 30, LR_DEFAULTCOLOR); hTranspIcon = LoadImage(hThisInstance, MAKEINTRESOURCE(IDI_TRANSPARENT), IMAGE_ICON, 40, 30, LR_DEFAULTCOLOR); @@ -225,19 +238,17 @@ CreateWindowEx (0, _T("STATIC"), _T(""), WS_CHILD | WS_VISIBLE | SS_ETCHEDHORZ, 0, 0, 5000, 2, hwnd, NULL, hThisInstance, NULL); - // creating the 16 bitmap radio buttons and setting the bitmap - - - // FIXME: Unintentionally there is a line above the tool bar. To prevent cropping of the buttons height has been increased from 200 to 205 - HWND hToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE | CCS_NOPARENTALIGN | CCS_VERT | CCS_NORESIZE | TBSTYLE_TOOLTIPS, 3, 3, 50, 205, hwnd, NULL, hThisInstance, NULL); - HIMAGELIST hImageList = ImageList_Create(16, 16, ILC_COLOR24 | ILC_MASK, 16, 0); + /* creating the 16 bitmap radio buttons and setting the bitmap */ + + + /* FIXME: Unintentionally there is a line above the tool bar. To prevent cropping of the buttons height has been increased from 200 to 205 */ + hToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE | CCS_NOPARENTALIGN | CCS_VERT | CCS_NORESIZE | TBSTYLE_TOOLTIPS, 3, 3, 50, 205, hwnd, NULL, hThisInstance, NULL); + hImageList = ImageList_Create(16, 16, ILC_COLOR24 | ILC_MASK, 16, 0); SendMessage(hToolbar, TB_SETIMAGELIST, 0, (LPARAM)hImageList); - HBITMAP tempBm = LoadImage(hThisInstance, MAKEINTRESOURCE(IDB_TOOLBARICONS), IMAGE_BITMAP, 256, 16, 0); + tempBm = LoadImage(hThisInstance, MAKEINTRESOURCE(IDB_TOOLBARICONS), IMAGE_BITMAP, 256, 16, 0); ImageList_AddMasked(hImageList, tempBm, 0xff00ff); DeleteObject(tempBm); SendMessage(hToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); - int i; - TCHAR tooltips[16][30]; for (i=0; i<16; i++) { int wrapnow = 0; @@ -246,35 +257,35 @@ TBBUTTON tbbutton = { i, ID_FREESEL + i, TBSTATE_ENABLED | wrapnow, TBSTYLE_CHECKGROUP, {0}, 0, (INT_PTR)tooltips[i] }; SendMessage(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&tbbutton); } - // SendMessage(hToolbar, TB_SETROWS, MAKEWPARAM(8, FALSE), (LPARAM)NULL); + /* SendMessage(hToolbar, TB_SETROWS, MAKEWPARAM(8, FALSE), (LPARAM)NULL); */ SendMessage(hToolbar, TB_CHECKBUTTON, ID_PEN, MAKELONG(TRUE, 0)); SendMessage(hToolbar, TB_SETMAXTEXTROWS, 0, 0); SendMessage(hToolbar, TB_SETBUTTONSIZE, 0, MAKELONG(25, 25)); - // SendMessage(hToolbar, TB_AUTOSIZE, 0, 0); - - - - - // creating the tool settings child window + /* SendMessage(hToolbar, TB_AUTOSIZE, 0, 0); */ + + + + + /* creating the tool settings child window */ hToolSettings = CreateWindowEx(0, _T("ToolSettings"), _T(""), WS_CHILD | WS_VISIBLE, 7, 210, 42, 140, hwnd, NULL, hThisInstance, NULL); - // creating the palette child window + /* creating the palette child window */ hPalWin = CreateWindowEx(0, _T("Palette"), _T(""), WS_CHILD | WS_VISIBLE, 56, 9, 255, 32, hwnd, NULL, hThisInstance, NULL); - // creating the scroll box + /* creating the scroll box */ hScrollbox = CreateWindowEx (WS_EX_CLIENTEDGE, _T("Scrollbox"), _T(""), WS_CHILD | WS_GROUP | WS_HSCROLL | WS_VSCROLL | WS_VISIBLE, 56, 49, 472, 248, hwnd, NULL, hThisInstance, NULL); - // creating the status bar + /* creating the status bar */ hStatusBar = CreateWindowEx (0, STATUSCLASSNAME, _T(""), SBARS_SIZEGRIP | WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hwnd, NULL, hThisInstance, NULL); SendMessage(hStatusBar, SB_SETMINHEIGHT, 21, 0); hScrlClient = CreateWindowEx(0, _T("Scrollbox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 500, 500, hScrollbox, NULL, hThisInstance, NULL); - // create selection window (initially hidden) + /* create selection window (initially hidden) */ hSelection = CreateWindowEx(WS_EX_TRANSPARENT, _T("Selection"), _T(""), WS_CHILD | BS_OWNERDRAW, 350, 0, 100, 100, hScrlClient, NULL, hThisInstance, NULL); - // creating the window inside the scroll box, on which the image in hDrawingDC's bitmap is drawn + /* creating the window inside the scroll box, on which the image in hDrawingDC's bitmap is drawn */ hImageArea = CreateWindowEx (0, _T("Scrollbox"), _T(""), WS_CHILD | WS_VISIBLE, 3, 3, imgXRes, imgYRes, hScrlClient, NULL, hThisInstance, NULL); hDrawingDC = CreateCompatibleDC(GetDC(hImageArea)); @@ -286,10 +297,7 @@ SelectObject(hDrawingDC, hBms[0]); Rectangle(hDrawingDC, 0-1, 0-1, imgXRes+1, imgYRes+1); - // initializing the CHOOSECOLOR structure for use with ChooseColor - int custColors[16] = - {0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, - 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff}; + /* initializing the CHOOSECOLOR structure for use with ChooseColor */ choosecolor.lStructSize = sizeof(CHOOSECOLOR); choosecolor.hwndOwner = hwnd; choosecolor.hInstance = NULL; @@ -300,13 +308,8 @@ choosecolor.lpfnHook = NULL; choosecolor.lpTemplateName = NULL; - TCHAR *c; - - // initializing the OPENFILENAME structure for use with GetOpenFileName and GetSaveFileName - TCHAR ofnFilename[1000]; + /* initializing the OPENFILENAME structure for use with GetOpenFileName and GetSaveFileName */ CopyMemory(ofnFilename, filename, sizeof(filename)); - TCHAR ofnFiletitle[256]; - TCHAR ofnFilter[1000]; LoadString(hThisInstance, IDS_OPENFILTER, ofnFilter, SIZEOF(ofnFilter)); for (c = ofnFilter; *c; c++) if (*c == '\1') *c = '\0'; ZeroMemory(&ofn, sizeof(OPENFILENAME)); @@ -320,10 +323,7 @@ ofn.nMaxFileTitle = SIZEOF(ofnFiletitle); ofn.Flags = OFN_HIDEREADONLY; - TCHAR sfnFilename[1000]; CopyMemory(sfnFilename, filename, sizeof(filename)); - TCHAR sfnFiletitle[256]; - TCHAR sfnFilter[1000]; LoadString(hThisInstance, IDS_SAVEFILTER, sfnFilter, SIZEOF(sfnFilter)); for (c = sfnFilter; *c; c++) if (*c == '\1') *c = '\0'; ZeroMemory(&sfn, sizeof(OPENFILENAME)); @@ -338,7 +338,7 @@ sfn.Flags = OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY; - // by moving the window, the things in WM_SIZE are done + /* by moving the window, the things in WM_SIZE are done */ MoveWindow(hwnd, 100, 100, 600, 450, TRUE); /* Make the window visible on the screen */ Modified: trunk/reactos/base/applications/paint/mouse.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/paint/mo…
============================================================================== --- trunk/reactos/base/applications/paint/mouse.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/paint/mouse.c [iso-8859-1] Wed Jun 17 01:12:47 2009 @@ -59,9 +59,11 @@ { case 2: { + short tempX; + short tempY; resetToU1(); - short tempX = max(0, min(x, imgXRes)); - short tempY = max(0, min(y, imgYRes)); + tempX = max(0, min(x, imgXRes)); + tempY = max(0, min(y, imgYRes)); rectSel_dest[0] = rectSel_src[0] = min(startX, tempX); rectSel_dest[1] = rectSel_src[1] = min(startY, tempY); rectSel_dest[2] = rectSel_src[2] = max(startX, tempX)-min(startX, tempX); Modified: trunk/reactos/base/applications/paint/palette.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/paint/pa…
============================================================================== --- trunk/reactos/base/applications/paint/palette.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/paint/palette.c [iso-8859-1] Wed Jun 17 01:12:47 2009 @@ -19,14 +19,16 @@ { case WM_PAINT: { - DefWindowProc (hwnd, message, wParam, lParam); - HDC hdc = GetDC(hwnd); - HPEN oldPen; - HBRUSH oldBrush; int i; long rectang[4] = {0, 0, 31, 32}; int a; int b; + HDC hdc = GetDC(hwnd); + HPEN oldPen; + HBRUSH oldBrush; + + DefWindowProc (hwnd, message, wParam, lParam); + for (b=2; b<30; b++) for (a=2; a<29; a++) if ((a+b)%2==1) SetPixel(hdc, a, b, GetSysColor(COLOR_BTNHILIGHT)); DrawEdge(hdc, (LPRECT)&rectang, EDGE_RAISED, BF_TOPLEFT); DrawEdge(hdc, (LPRECT)&rectang, BDR_SUNKENOUTER, BF_TOPLEFT|BF_BOTTOMRIGHT); Modified: trunk/reactos/base/applications/paint/selection.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/paint/se…
============================================================================== --- trunk/reactos/base/applications/paint/selection.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/paint/selection.c [iso-8859-1] Wed Jun 17 01:12:47 2009 @@ -28,8 +28,8 @@ { if (!moving) { + HDC hdc=GetDC(hwnd); DefWindowProc (hwnd, message, wParam, lParam); - HDC hdc=GetDC(hwnd); SelectionFrame(hdc, 1, 1, rectSel_dest[2]*zoom/1000+5, rectSel_dest[3]*zoom/1000+5); ReleaseDC(hwnd, hdc); } Modified: trunk/reactos/base/applications/paint/toolsettings.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/paint/to…
============================================================================== --- trunk/reactos/base/applications/paint/toolsettings.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/paint/toolsettings.c [iso-8859-1] Wed Jun 17 01:12:47 2009 @@ -20,13 +20,13 @@ { case WM_PAINT: { + HDC hdc = GetDC(hwnd); + int rectang[4] = {0, 0, 42, 66}; + int rectang2[4] = {0, 70, 42, 136}; + DefWindowProc (hwnd, message, wParam, lParam); - HDC hdc = GetDC(hwnd); - - int rectang[4] = {0, 0, 42, 66}; DrawEdge(hdc, (LPRECT)&rectang, BDR_SUNKENOUTER, BF_RECT | BF_MIDDLE); - int rectang2[4] = {0, 70, 42, 136}; if (activeTool>=13) DrawEdge(hdc, (LPRECT)&rectang2, BDR_SUNKENOUTER, BF_RECT | BF_MIDDLE); else @@ -64,11 +64,11 @@ break; case 8: { + int i; HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0)); SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT)); Rectangle(hdc, brushStyle%3*13+2, brushStyle/3*15+2, brushStyle%3*13+15, brushStyle/3*15+17); DeleteObject(SelectObject(hdc, oldPen)); - int i; for (i=0; i<12; i++) if (i==brushStyle) Brush(hdc, i%3*13+7, i/3*15+8, i%3*13+7, i/3*15+8, GetSysColor(COLOR_HIGHLIGHTTEXT), i); Modified: trunk/reactos/base/applications/paint/winproc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/paint/wi…
============================================================================== --- trunk/reactos/base/applications/paint/winproc.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/paint/winproc.c [iso-8859-1] Wed Jun 17 01:12:47 2009 @@ -64,9 +64,9 @@ { TCHAR programname[20]; TCHAR saveprompttext[100]; + TCHAR temptext[500]; LoadString(hProgInstance, IDS_PROGRAMNAME, programname, SIZEOF(programname)); LoadString(hProgInstance, IDS_SAVEPROMPTTEXT, saveprompttext, SIZEOF(saveprompttext)); - TCHAR temptext[500]; _stprintf(temptext, saveprompttext, filename); switch (MessageBox(hwnd, temptext, programname, MB_YESNOCANCEL | MB_ICONQUESTION)) { @@ -157,11 +157,12 @@ if ((hwnd==hImageArea)||(hwnd==hScrollbox)) { long clientRectScrollbox[4]; + long clientRectImageArea[4]; + SCROLLINFO horzScroll; + SCROLLINFO vertScroll; GetClientRect(hScrollbox, (LPRECT)&clientRectScrollbox); - long clientRectImageArea[4]; GetClientRect(hImageArea, (LPRECT)&clientRectImageArea); MoveWindow(hScrlClient, 0, 0, max(clientRectImageArea[2]+6, clientRectScrollbox[2]), max(clientRectImageArea[3]+6, clientRectScrollbox[3]), TRUE); - SCROLLINFO horzScroll; horzScroll.cbSize = sizeof(SCROLLINFO); horzScroll.fMask = SIF_PAGE | SIF_RANGE; horzScroll.nMax = 10000; @@ -171,7 +172,6 @@ horzScroll.nTrackPos = 0; SetScrollInfo(hScrollbox, SB_HORZ, &horzScroll, TRUE); GetClientRect(hScrollbox, (LPRECT)clientRectScrollbox); - SCROLLINFO vertScroll; vertScroll.cbSize = sizeof(SCROLLINFO); vertScroll.fMask = SIF_PAGE | SIF_RANGE; vertScroll.nMax = 10000; @@ -388,10 +388,10 @@ HBITMAP bmNew = (HBITMAP)LoadDIBFromFile(ofn.lpstrFile); if (bmNew!=NULL) { + TCHAR tempstr[1000]; + TCHAR resstr[100]; insertReversible(bmNew); updateCanvasAndScrollbars(); - TCHAR tempstr[1000]; - TCHAR resstr[100]; CopyMemory(filename, ofn.lpstrFileTitle, sizeof(filename)); CopyMemory(filepathname, ofn.lpstrFileTitle, sizeof(filepathname)); LoadString(hProgInstance, IDS_WINDOWTITLE, resstr, SIZEOF(resstr)); @@ -411,9 +411,9 @@ case IDM_FILESAVEAS: if (GetSaveFileName(&sfn)!=0) { - SaveDIBToFile(hBms[currInd], sfn.lpstrFile, hDrawingDC); TCHAR tempstr[1000]; TCHAR resstr[100]; + SaveDIBToFile(hBms[currInd], sfn.lpstrFile, hDrawingDC); CopyMemory(filename, sfn.lpstrFileTitle, sizeof(filename)); CopyMemory(filepathname, sfn.lpstrFileTitle, sizeof(filepathname)); LoadString(hProgInstance, IDS_WINDOWTITLE, resstr, SIZEOF(resstr)); @@ -484,9 +484,10 @@ break; case IDM_IMAGEINVERTCOLORS: { + RECT tempRect; newReversible(); - int tempRect[4] = {0, 0, imgXRes, imgYRes}; - InvertRect(hDrawingDC, (LPRECT)tempRect); + SetRect(&tempRect, 0, 0, imgXRes, imgYRes); + InvertRect(hDrawingDC, &tempRect); SendMessage(hImageArea, WM_PAINT, 0, 0); } break;
15 years, 5 months
1
0
0
0
[dchapyshev] 41426: - Stub-implement NhGetInterfaceNameFromDeviceGuid and SetIpForwardEntryToStack. Fixes taskmgr (from windows) crash on network page
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Tue Jun 16 23:10:29 2009 New Revision: 41426 URL:
http://svn.reactos.org/svn/reactos?rev=41426&view=rev
Log: - Stub-implement NhGetInterfaceNameFromDeviceGuid and SetIpForwardEntryToStack. Fixes taskmgr (from windows) crash on network page Modified: trunk/reactos/dll/win32/iphlpapi/iphlpapi.spec trunk/reactos/dll/win32/iphlpapi/iphlpapi_main.c Modified: trunk/reactos/dll/win32/iphlpapi/iphlpapi.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/iphlpap…
============================================================================== --- trunk/reactos/dll/win32/iphlpapi/iphlpapi.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/iphlpapi/iphlpapi.spec [iso-8859-1] Tue Jun 16 23:10:29 2009 @@ -110,7 +110,7 @@ @ stub NTPTimeToNTFileTime @ stub NTTimeToNTPTime @ stub NhGetGuidFromInterfaceName -@ stub NhGetInterfaceNameFromDeviceGuid +@ stdcall NhGetInterfaceNameFromDeviceGuid(long long long long long) @ stub NhGetInterfaceNameFromGuid @ stub NhpAllocateAndGetInterfaceInfoFromStack @ stub NhpGetInterfaceIndexFromStack @@ -125,7 +125,7 @@ @ stdcall SetIfEntry( ptr ) @ stub SetIfEntryToStack @ stdcall SetIpForwardEntry( ptr ) -@ stub SetIpForwardEntryToStack +@ stdcall SetIpForwardEntryToStack( ptr ) @ stub SetIpMultihopRouteEntryToStack @ stdcall SetIpNetEntry( ptr ) @ stub SetIpNetEntryToStack Modified: trunk/reactos/dll/win32/iphlpapi/iphlpapi_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/iphlpap…
============================================================================== --- trunk/reactos/dll/win32/iphlpapi/iphlpapi_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/iphlpapi/iphlpapi_main.c [iso-8859-1] Tue Jun 16 23:10:29 2009 @@ -2252,4 +2252,20 @@ return ERROR_NOT_SUPPORTED; } - +DWORD WINAPI +SetIpForwardEntryToStack(PMIB_IPFORWARDROW pRoute) +{ + FIXME("SetIpForwardEntryToStack() stub\n"); + return 0L; +} + +DWORD WINAPI +NhGetInterfaceNameFromDeviceGuid(DWORD dwUnknown1, + DWORD dwUnknown2, + DWORD dwUnknown3, + DWORD dwUnknown4, + DWORD dwUnknown5) +{ + FIXME("NhGetInterfaceNameFromDeviceGuid() stub\n"); + return 0L; +}
15 years, 5 months
1
0
0
0
[dchapyshev] 41425: - Revert last wine sync for imagelist See issue #4304 for more details.
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Tue Jun 16 23:05:42 2009 New Revision: 41425 URL:
http://svn.reactos.org/svn/reactos?rev=41425&view=rev
Log: - Revert last wine sync for imagelist See issue #4304 for more details. Modified: trunk/reactos/dll/win32/comctl32/imagelist.c Modified: trunk/reactos/dll/win32/comctl32/imagelist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/imageli…
============================================================================== --- trunk/reactos/dll/win32/comctl32/imagelist.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/imagelist.c [iso-8859-1] Tue Jun 16 23:05:42 2009 @@ -155,7 +155,7 @@ * This function CANNOT be used to reduce the number of images. */ static void -IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT cy) +IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cy) { HDC hdcBitmap; HBITMAP hbmNewBitmap, hbmNull; @@ -166,15 +166,14 @@ && (himl->cy >= cy)) return; - if (cx == 0) cx = himl->cx; nNewCount = himl->cCurImage + nImageCount + himl->cGrow; - imagelist_get_bitmap_size(himl, nNewCount, cx, &sz); + imagelist_get_bitmap_size(himl, nNewCount, himl->cx, &sz); TRACE("Create expanded bitmaps : himl=%p x=%d y=%d count=%d\n", himl, sz.cx, cy, nNewCount); hdcBitmap = CreateCompatibleDC (0); - hbmNewBitmap = ImageList_CreateImage(hdcBitmap, himl, nNewCount, cx); + hbmNewBitmap = ImageList_CreateImage(hdcBitmap, himl, nNewCount, himl->cx); if (hbmNewBitmap == 0) ERR("creating new image bitmap (x=%d y=%d)!\n", sz.cx, cy); @@ -248,7 +247,7 @@ nImageCount = bmp.bmWidth / himl->cx; - IMAGELIST_InternalExpandBitmaps (himl, nImageCount, bmp.bmWidth, bmp.bmHeight); + IMAGELIST_InternalExpandBitmaps (himl, nImageCount, bmp.bmHeight); hdcBitmap = CreateCompatibleDC(0); @@ -350,7 +349,7 @@ else nImageCount = 0; - IMAGELIST_InternalExpandBitmaps (himl, nImageCount, bmp.bmWidth, bmp.bmHeight); + IMAGELIST_InternalExpandBitmaps (himl, nImageCount, bmp.bmHeight); nIndex = himl->cCurImage; himl->cCurImage += nImageCount; @@ -2304,7 +2303,7 @@ if (nIndex == -1) { if (himl->cCurImage + 1 > himl->cMaxImage) - IMAGELIST_InternalExpandBitmaps (himl, 1, 0, 0); + IMAGELIST_InternalExpandBitmaps (himl, 1, 0); nIndex = himl->cCurImage; himl->cCurImage++;
15 years, 5 months
1
0
0
0
[dchapyshev] 41424: - Add Symbol font from Wine
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Tue Jun 16 19:41:29 2009 New Revision: 41424 URL:
http://svn.reactos.org/svn/reactos?rev=41424&view=rev
Log: - Add Symbol font from Wine Added: trunk/reactos/media/fonts/symbol.ttf (with props) Modified: trunk/reactos/boot/bootdata/packages/reactos.dff trunk/reactos/media/fonts/fonts.rbuild Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] Tue Jun 16 19:41:29 2009 @@ -551,6 +551,7 @@ media\fonts\LiberationSerif-Regular.ttf 3 media\fonts\Marlett.ttf 3 +media\fonts\symbol.ttf 3 media\fonts\tahoma.ttf 3 media\fonts\tahomabd.ttf 3 Modified: trunk/reactos/media/fonts/fonts.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/fonts.rbuild?r…
============================================================================== --- trunk/reactos/media/fonts/fonts.rbuild [iso-8859-1] (original) +++ trunk/reactos/media/fonts/fonts.rbuild [iso-8859-1] Tue Jun 16 19:41:29 2009 @@ -30,6 +30,7 @@ <installfile installbase="fonts">LiberationSerif-Italic.ttf</installfile> <installfile installbase="fonts">LiberationSerif-Regular.ttf</installfile> <installfile installbase="fonts">Marlett.ttf</installfile> + <installfile installbase="fonts">symbol.ttf</installfile> <installfile installbase="fonts">tahoma.ttf</installfile> <installfile installbase="fonts">tahomabd.ttf</installfile> </group> Added: trunk/reactos/media/fonts/symbol.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/symbol.ttf?rev…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/media/fonts/symbol.ttf ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream
15 years, 5 months
1
0
0
0
[dchapyshev] 41423: - Add ntlanman.dll (not implemented)
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Tue Jun 16 19:38:45 2009 New Revision: 41423 URL:
http://svn.reactos.org/svn/reactos?rev=41423&view=rev
Log: - Add ntlanman.dll (not implemented) Added: trunk/reactos/dll/win32/ntlanman/ (with props) trunk/reactos/dll/win32/ntlanman/ntlanman.c (with props) trunk/reactos/dll/win32/ntlanman/ntlanman.rbuild (with props) trunk/reactos/dll/win32/ntlanman/ntlanman.rc (with props) trunk/reactos/dll/win32/ntlanman/ntlanman.spec (with props) Modified: trunk/reactos/baseaddress.rbuild trunk/reactos/boot/bootdata/packages/reactos.dff trunk/reactos/dll/win32/win32.rbuild Modified: trunk/reactos/baseaddress.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/baseaddress.rbuild?rev=414…
============================================================================== --- trunk/reactos/baseaddress.rbuild [iso-8859-1] (original) +++ trunk/reactos/baseaddress.rbuild [iso-8859-1] Tue Jun 16 19:38:45 2009 @@ -41,6 +41,7 @@ <property name="BASEADDRESS_COMMCTRL" value="0x5d090000" /> <property name="BASEADDRESS_DPLAYX" value="0x5e080000" /> <property name="BASEADDRESS_INPUT" value ="0x5e400000" /> + <property name="BASEADDRESS_NTLANMAN" value="0x5f380000" /> <property name="BASEADDRESS_DINPUT" value="0x5f580000" /> <property name="BASEADDRESS_NETID" value="0x5f660000" /> <property name="BASEADDRESS_NTPRINT" value="0x5f6a0000" /> Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] Tue Jun 16 19:38:45 2009 @@ -356,6 +356,7 @@ dll\win32\netshell\netshell.dll 1 dll\win32\newdev\newdev.dll 1 dll\win32\ntdsapi\ntdsapi.dll 1 +dll\win32\ntlanman\ntlanman.dll 1 dll\win32\ntmarta\ntmarta.dll 1 dll\win32\ntprint\ntprint.dll 1 dll\win32\objsel\objsel.dll 1 Propchange: trunk/reactos/dll/win32/ntlanman/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Tue Jun 16 19:38:45 2009 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/dll/win32/ntlanman/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/dll/win32/ntlanman/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/dll/win32/ntlanman/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/dll/win32/ntlanman/ntlanman.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ntlanman/ntlanma…
============================================================================== --- trunk/reactos/dll/win32/ntlanman/ntlanman.c (added) +++ trunk/reactos/dll/win32/ntlanman/ntlanman.c [iso-8859-1] Tue Jun 16 19:38:45 2009 @@ -1,0 +1,197 @@ +/* + * PROJECT: LAN Manager + * FILE: dll\win32\ntlanman\ntlanman.c + * PURPOSE: Main file + * PROGRAMMERS: Dmitry Chapyshev (dmitry(a)reactos.org) + */ + +#include <windows.h> +#include <npapi.h> + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(ntlanman); + +DWORD +WINAPI +NPGetConnection(LPWSTR lpLocalName, + LPWSTR lpRemoteName, + LPDWORD lpBufferSize) +{ + UNIMPLEMENTED; + return 0; +} + +DWORD +WINAPI +NPGetCaps(DWORD nIndex) +{ + UNIMPLEMENTED; + return 0; +} + +DWORD +WINAPI +NPGetUser(LPWSTR lpName, + LPWSTR lpUserName, + LPDWORD lpBufferSize) +{ + UNIMPLEMENTED; + return 0; +} + +DWORD +WINAPI +NPAddConnection(LPNETRESOURCE lpNetResource, + LPWSTR lpPassword, + LPWSTR lpUserName) +{ + UNIMPLEMENTED; + return 0; +} + +DWORD +WINAPI +NPCancelConnection(LPWSTR lpName, + BOOL fForce) +{ + UNIMPLEMENTED; + return 0; +} + +DWORD +WINAPI +NPPropertyDialog(HWND hwndParent, + DWORD iButtonDlg, + DWORD nPropSel, + LPWSTR lpFileName, + DWORD nType) +{ + UNIMPLEMENTED; + return 0; +} + +DWORD +WINAPI +NPGetDirectoryType(LPWSTR lpName, + LPINT lpType, + BOOL bFlushCache) +{ + UNIMPLEMENTED; + return 0; +} + +DWORD +WINAPI +NPDirectoryNotify(HWND hwnd, + LPWSTR lpDir, + DWORD dwOper) +{ + UNIMPLEMENTED; + return 0; +} + +DWORD +WINAPI +NPGetPropertyText(DWORD iButton, + DWORD nPropSel, + LPWSTR lpName, + LPWSTR lpButtonName, + DWORD nButtonNameLen, + DWORD nType) +{ + UNIMPLEMENTED; + return 0; +} + +DWORD +WINAPI +NPOpenEnum(DWORD dwScope, + DWORD dwType, + DWORD dwUsage, + LPNETRESOURCE lpNetResource, + LPHANDLE lphEnum) +{ + UNIMPLEMENTED; + return 0; +} + +DWORD +WINAPI +NPEnumResource(HANDLE hEnum, + LPDWORD lpcCount, + LPVOID lpBuffer, + LPDWORD lpBufferSize) +{ + UNIMPLEMENTED; + return 0; +} + +DWORD +WINAPI +NPCloseEnum(HANDLE hEnum) +{ + UNIMPLEMENTED; + return 0; +} + +DWORD +WINAPI +NPFormatNetworkName(LPWSTR lpRemoteName, + LPWSTR lpFormattedName, + LPDWORD lpnLength, + DWORD dwFlags, + DWORD dwAveCharPerLine) +{ + UNIMPLEMENTED; + return 0; +} + +DWORD +WINAPI +NPAddConnection3(HWND hwndOwner, + LPNETRESOURCE lpNetResource, + LPWSTR lpPassword, + LPWSTR lpUserName, + DWORD dwFlags) +{ + UNIMPLEMENTED; + return 0; +} + +DWORD +WINAPI +NPGetUniversalName(LPCWSTR lpLocalPath, + DWORD dwInfoLevel, + LPVOID lpBuffer, + LPDWORD lpBufferSize) +{ + UNIMPLEMENTED; + return 0; +} + +DWORD +WINAPI +NPGetResourceParent(LPNETRESOURCE lpNetResource, + LPVOID lpBuffer, + LPDWORD lpcbBuffer) +{ + UNIMPLEMENTED; + return 0; +} + + +BOOL +WINAPI +DllMain(IN HINSTANCE hinstDLL, + IN DWORD dwReason, + IN LPVOID lpvReserved) +{ + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + break; + } + + return TRUE; +} Propchange: trunk/reactos/dll/win32/ntlanman/ntlanman.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/ntlanman/ntlanman.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ntlanman/ntlanma…
============================================================================== --- trunk/reactos/dll/win32/ntlanman/ntlanman.rbuild (added) +++ trunk/reactos/dll/win32/ntlanman/ntlanman.rbuild [iso-8859-1] Tue Jun 16 19:38:45 2009 @@ -1,0 +1,12 @@ +<?xml version="1.0"?> +<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> +<module name="ntlanman" type="win32dll" baseaddress="${BASEADDRESS_NTLANMAN}" installbase="system32" installname="ntlanman.dll" unicode="yes"> + <importlibrary definition="ntlanman.spec" /> + <include base="ntlanman">.</include> + <library>kernel32</library> + <library>netapi32</library> + <library>ntdll</library> + <library>wine</library> + <file>ntlanman.c</file> + <file>ntlanman.rc</file> +</module> Propchange: trunk/reactos/dll/win32/ntlanman/ntlanman.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/ntlanman/ntlanman.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ntlanman/ntlanma…
============================================================================== --- trunk/reactos/dll/win32/ntlanman/ntlanman.rc (added) +++ trunk/reactos/dll/win32/ntlanman/ntlanman.rc [iso-8859-1] Tue Jun 16 19:38:45 2009 @@ -1,0 +1,7 @@ +#include <windows.h> + +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "LAN Manager\0" +#define REACTOS_STR_INTERNAL_NAME "ntlanman\0" +#define REACTOS_STR_ORIGINAL_FILENAME "ntlanman.dll\0" +#include <reactos/version.rc> Propchange: trunk/reactos/dll/win32/ntlanman/ntlanman.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/ntlanman/ntlanman.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ntlanman/ntlanma…
============================================================================== --- trunk/reactos/dll/win32/ntlanman/ntlanman.spec (added) +++ trunk/reactos/dll/win32/ntlanman/ntlanman.spec [iso-8859-1] Tue Jun 16 19:38:45 2009 @@ -1,0 +1,43 @@ +1 stub -noname Ordinal1 +2 stub -noname Ordinal2 +3 stub -noname Ordinal3 +4 stub -noname Ordinal4 +5 stub -noname Ordinal5 +6 stub -noname Ordinal6 +7 stub -noname Ordinal7 +8 stub -noname Ordinal8 +9 stub -noname Ordinal9 +10 stub -noname Ordinal10 +11 stub -noname Ordinal11 +12 stdcall NPGetConnection(wstr wstr ptr) +13 stdcall NPGetCaps(long) +14 stdcall DllMain(ptr long ptr) +15 stub I_SystemFocusDialog +16 stdcall NPGetUser(wstr wstr ptr) +17 stdcall NPAddConnection(ptr wstr wstr) +18 stdcall NPCancelConnection(wstr long) +19 stub IsDfsPathEx +20 stub NPAddConnection3ForCSCAgent +21 stub NPCancelConnectionForCSCAgent +22 stub ServerBrowseDialogA0 +23 stub ShareAsDialogA0 +24 stub ShareCreate +25 stub ShareManage +26 stub ShareStop +27 stub StopShareDialogA0 +28 stub -noname Ordinal28 +29 stdcall NPPropertyDialog(ptr long long wstr long) +30 stdcall NPGetDirectoryType(wstr ptr long) +31 stdcall NPDirectoryNotify(ptr wstr long) +32 stdcall NPGetPropertyText(long long wstr wstr long long) +33 stdcall NPOpenEnum(long long long ptr ptr) +34 stdcall NPEnumResource(ptr ptr ptr ptr) +35 stdcall NPCloseEnum(ptr) +36 stdcall NPFormatNetworkName(wstr wstr ptr long long) +37 stub -noname Ordinal37 +38 stdcall NPAddConnection3(ptr ptr wstr wstr long) +39 stub -noname Ordinal39 +40 stdcall NPGetUniversalName(wstr long ptr ptr) +41 stdcall NPGetResourceParent(ptr ptr ptr) +42 stub -noname Ordinal42 +43 stub -noname Ordinal43 Propchange: trunk/reactos/dll/win32/ntlanman/ntlanman.spec ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/win32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/win32.rbuild?rev…
============================================================================== --- trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] Tue Jun 16 19:38:45 2009 @@ -328,6 +328,9 @@ <directory name="ntdsapi"> <xi:include href="ntdsapi/ntdsapi.rbuild" /> </directory> +<directory name="ntlanman"> + <xi:include href="ntlanman/ntlanman.rbuild" /> +</directory> <directory name="ntmarta"> <xi:include href="ntmarta/ntmarta.rbuild" /> </directory>
15 years, 5 months
1
0
0
0
[janderwald] 41422: - SetupDiOpenClassRegKeyExW should ERROR_INVALID_CLASS when it fails - TODO: NtOpenKey should fail when acessMask == 0 and a registry path is passed
by janderwald@svn.reactos.org
Author: janderwald Date: Tue Jun 16 12:04:08 2009 New Revision: 41422 URL:
http://svn.reactos.org/svn/reactos?rev=41422&view=rev
Log: - SetupDiOpenClassRegKeyExW should ERROR_INVALID_CLASS when it fails - TODO: NtOpenKey should fail when acessMask == 0 and a registry path is passed Modified: trunk/reactos/dll/win32/setupapi/devinst.c Modified: trunk/reactos/dll/win32/setupapi/devinst.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/devinst…
============================================================================== --- trunk/reactos/dll/win32/setupapi/devinst.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/setupapi/devinst.c [iso-8859-1] Tue Jun 16 12:04:08 2009 @@ -3573,7 +3573,7 @@ samDesired, &hClassesKey))) { - SetLastError(l); + SetLastError(ERROR_INVALID_CLASS); hClassesKey = INVALID_HANDLE_VALUE; } if (MachineName != NULL)
15 years, 5 months
1
0
0
0
[hyperion] 41421: modified dll/win32/srclient/srclient_main.c What the hell, Arch Blackmann? <windef.h>, <winbase.h> and <winnls.h> are not meant to be included directly. Include <windows.h> instead modified drivers/video/font/ftfd/rosglue.c Move standard C includes before Windows includes, so the required types are defined beforehand modified include/crt/_mingw.h Re-add Visual C++ support va_list is not a built-in type, it does not belong in _mingw.h Do not include intrin.h (screw you, Arch) Re
by hyperion@svn.reactos.org
Author: hyperion Date: Tue Jun 16 04:24:26 2009 New Revision: 41421 URL:
http://svn.reactos.org/svn/reactos?rev=41421&view=rev
Log: modified dll/win32/srclient/srclient_main.c What the hell, Arch Blackmann? <windef.h>, <winbase.h> and <winnls.h> are not meant to be included directly. Include <windows.h> instead modified drivers/video/font/ftfd/rosglue.c Move standard C includes before Windows includes, so the required types are defined beforehand modified include/crt/_mingw.h Re-add Visual C++ support va_list is not a built-in type, it does not belong in _mingw.h Do not include intrin.h (screw you, Arch) Removed definition of _USE_32BIT_TIME_T ("ROS HACK!") modified include/crt/conio.h modified include/crt/stdio.h modified include/crt/wchar.h Pull in va_list from stdarg.h modified include/crt/mingw32/intrin.h modified include/crt/mingw32/intrin_arm.h modified include/crt/mingw32/intrin_x86.h intrin.h defines size_t and uintptr_t The _real_, ultimate magic incantation for inline functions is extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) Fix __addfsbyte, __addfsword added include/crt/msc added include/crt/msc/intrin.h Ported our intrin.h to Visual C++ modified ReactOS-arm.rbuild modified ReactOS-i386.rbuild ROS HACK!s belong in the project definition modified ReactOS-generic.rbuild Compiler-specific include directories Added: trunk/reactos/include/crt/msc/ (with props) trunk/reactos/include/crt/msc/intrin.h (with props) Modified: trunk/reactos/ReactOS-arm.rbuild trunk/reactos/ReactOS-generic.rbuild trunk/reactos/ReactOS-i386.rbuild trunk/reactos/dll/win32/srclient/srclient_main.c trunk/reactos/drivers/video/font/ftfd/rosglue.c trunk/reactos/include/crt/_mingw.h trunk/reactos/include/crt/conio.h trunk/reactos/include/crt/mingw32/intrin.h trunk/reactos/include/crt/mingw32/intrin_arm.h trunk/reactos/include/crt/mingw32/intrin_x86.h trunk/reactos/include/crt/stdio.h trunk/reactos/include/crt/wchar.h Modified: trunk/reactos/ReactOS-arm.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ReactOS-arm.rbuild?rev=414…
============================================================================== --- trunk/reactos/ReactOS-arm.rbuild [iso-8859-1] (original) +++ trunk/reactos/ReactOS-arm.rbuild [iso-8859-1] Tue Jun 16 04:24:26 2009 @@ -23,7 +23,7 @@ <define name="KDBG">1</define> <property name="DBG_OR_KDBG" value="true" /> </if> - + <include>.</include> <include>include</include> <include root="intermediate">include</include> @@ -71,11 +71,11 @@ <compilerflag>-fno-strict-aliasing</compilerflag> <linkerflag>--strip-debug</linkerflag> <linkerflag>-static</linkerflag> - + <directory name="media"> <directory name="nls"> <xi:include href="media/nls/nls.rbuild" /> - </directory> + </directory> </directory> <directory name="lib"> <directory name="drivers"> @@ -180,13 +180,15 @@ <directory name="dll"> <directory name="ntdll"> <xi:include href="dll/ntdll/ntdll.rbuild" /> - </directory> + </directory> </directory> <directory name="base"> <directory name="system"> <directory name="smss"> <xi:include href="base/system/smss/smss.rbuild" /> - </directory> - </directory> + </directory> + </directory> </directory> + + <define name="_USE_32BIT_TIME_T" /> </project> Modified: trunk/reactos/ReactOS-generic.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ReactOS-generic.rbuild?rev…
============================================================================== --- trunk/reactos/ReactOS-generic.rbuild [iso-8859-1] (original) +++ trunk/reactos/ReactOS-generic.rbuild [iso-8859-1] Tue Jun 16 04:24:26 2009 @@ -67,7 +67,8 @@ <include>include/dxsdk</include> <include root="intermediate">include/dxsdk</include> <include>include/crt</include> - <include>include/crt/mingw32</include> + <include compilerset="gcc">include/crt/mingw32</include> + <include compilerset="msc">include/crt/msc</include> <include>include/ddk</include> <include>include/GL</include> <include>include/ndk</include> Modified: trunk/reactos/ReactOS-i386.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ReactOS-i386.rbuild?rev=41…
============================================================================== --- trunk/reactos/ReactOS-i386.rbuild [iso-8859-1] (original) +++ trunk/reactos/ReactOS-i386.rbuild [iso-8859-1] Tue Jun 16 04:24:26 2009 @@ -79,4 +79,5 @@ <linkerflag>-disable-stdcall-fixup</linkerflag> </group> + <define name="_USE_32BIT_TIME_T" /> </project> Modified: trunk/reactos/dll/win32/srclient/srclient_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/srclient/srclien…
============================================================================== --- trunk/reactos/dll/win32/srclient/srclient_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/srclient/srclient_main.c [iso-8859-1] Tue Jun 16 04:24:26 2009 @@ -16,9 +16,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include <windef.h> -#include <winbase.h> -#include <winnls.h> +#include <windows.h> #include <srrestoreptapi.h> #define NDEBUG Modified: trunk/reactos/drivers/video/font/ftfd/rosglue.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/font/ftfd/ro…
============================================================================== --- trunk/reactos/drivers/video/font/ftfd/rosglue.c [iso-8859-1] (original) +++ trunk/reactos/drivers/video/font/ftfd/rosglue.c [iso-8859-1] Tue Jun 16 04:24:26 2009 @@ -8,11 +8,11 @@ * NOTES: */ +#include <stdarg.h> +#include <stdio.h> #include <windef.h> #include <wingdi.h> #include <winddi.h> -#include <stdarg.h> -#include <stdio.h> #define NDEBUG #include <debug.h> Modified: trunk/reactos/include/crt/_mingw.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/_mingw.h?rev=4…
============================================================================== --- trunk/reactos/include/crt/_mingw.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/_mingw.h [iso-8859-1] Tue Jun 16 04:24:26 2009 @@ -8,13 +8,6 @@ #define _INC_MINGW #define _INTEGRAL_MAX_BITS 64 - -// ROS HACK! -#ifndef _WIN64 - #ifndef _USE_32BIT_TIME_T - #define _USE_32BIT_TIME_T - #endif -#endif #ifndef MINGW64 #define MINGW64 @@ -48,15 +41,19 @@ #define __MINGW_GNUC_PREREQ(major, minor) 0 #endif -#if !defined (_MSC_VER) -#define __MINGW_MSC_PREREQ(major, minor) 0 +#if defined (_MSC_VER) +#define __MINGW_MSC_PREREQ(major, minor) ((major * 100 + minor * 10) >= _MSC_VER) +#else +#define __MINGW_MSC_PREREQ(major, minor) 0 #endif #define USE___UUIDOF 0 #ifdef __cplusplus # define __CRT_INLINE inline -#else +#elif defined(_MSC_VER) +# define __CRT_INLINE __inline +#elif defined(__GNUC__) # if ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L) # define __CRT_INLINE extern inline __attribute__((__always_inline__,__gnu_inline__)) # else @@ -79,8 +76,10 @@ #else # ifdef __GNUC__ # define __unaligned __attribute((packed)) +# elif defined(_MSC_VER) && !defined(_M_IA64) && !defined(_M_AMD64) +# define __unaligned # else -# define __UNUSED_PARAM(x) x +# define __unaligned # endif #endif @@ -98,6 +97,9 @@ #if __MINGW_GNUC_PREREQ (3, 0) #define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__)) #define __MINGW_ATTRIB_PURE __attribute__ ((__pure__)) +#elif __MINGW_MSC_PREREQ(14, 0) +#define __MINGW_ATTRIB_MALLOC __declspec(noalias) __declspec(restrict) +#define __MINGW_ATTRIB_PURE #else #define __MINGW_ATTRIB_MALLOC #define __MINGW_ATTRIB_PURE @@ -119,7 +121,7 @@ #else #define __MINGW_ATTRIB_DEPRECATED #endif - + #if __MINGW_GNUC_PREREQ (3, 3) #define __MINGW_NOTHROW __attribute__ ((__nothrow__)) #elif __MINGW_MSC_PREREQ(12, 0) && defined (__cplusplus) @@ -172,33 +174,11 @@ #define USE_MINGW_SETJMP_TWO_ARGS #endif -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef __GNUC_VA_LIST -#define __GNUC_VA_LIST - typedef __builtin_va_list __gnuc_va_list; -#endif - -#ifndef _VA_LIST_DEFINED -#define _VA_LIST_DEFINED - typedef __gnuc_va_list va_list; -#endif - /* Diable deprecation for now! */ #define _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE_CORE #ifdef __WINESRC__ #define _CRT_NONSTDC_NO_DEPRECATE -#endif - -#if (defined(_MSC_VER) && __STDC__)// || !defined(__WINESRC__) -#define NO_OLDNAMES -#endif - -#ifdef __cplusplus -} #endif #define __crt_typefix(ctype) @@ -207,26 +187,5 @@ #define _CRT_UNUSED(x) (void)x #endif -/* These are here for intrin.h */ -#ifndef _SIZE_T_DEFINED -#define _SIZE_T_DEFINED -#ifdef _WIN64 - typedef unsigned __int64 size_t; -#else - typedef unsigned int size_t; -#endif -#endif - -#ifndef _UINTPTR_T_DEFINED -#define _UINTPTR_T_DEFINED -#ifdef _WIN64 - typedef unsigned __int64 uintptr_t; -#else - typedef unsigned int uintptr_t; -#endif -#endif - -#include <mingw32/intrin.h> - #endif /* !_INC_MINGW */ Modified: trunk/reactos/include/crt/conio.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/conio.h?rev=41…
============================================================================== --- trunk/reactos/include/crt/conio.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/conio.h [iso-8859-1] Tue Jun 16 04:24:26 2009 @@ -7,6 +7,9 @@ #define _INC_CONIO #include <crtdefs.h> + +#define __need___va_list +#include <stdarg.h> #ifdef __cplusplus extern "C" { Modified: trunk/reactos/include/crt/mingw32/intrin.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/mingw32/intrin…
============================================================================== --- trunk/reactos/include/crt/mingw32/intrin.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/mingw32/intrin.h [iso-8859-1] Tue Jun 16 04:24:26 2009 @@ -30,8 +30,24 @@ #ifndef RC_INVOKED -#ifndef __GNUC__ -#error Unsupported compiler +#define __INTRIN_INLINE extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) + +#ifndef _SIZE_T_DEFINED +#define _SIZE_T_DEFINED +#ifdef _WIN64 + typedef unsigned __int64 size_t; +#else + typedef unsigned int size_t; +#endif +#endif + +#ifndef _UINTPTR_T_DEFINED +#define _UINTPTR_T_DEFINED +#ifdef _WIN64 + typedef unsigned __int64 uintptr_t; +#else + typedef unsigned int uintptr_t; +#endif #endif /* Modified: trunk/reactos/include/crt/mingw32/intrin_arm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/mingw32/intrin…
============================================================================== --- trunk/reactos/include/crt/mingw32/intrin_arm.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/mingw32/intrin_arm.h [iso-8859-1] Tue Jun 16 04:24:26 2009 @@ -34,10 +34,10 @@ #define _ReadWriteBarrier() __sync_synchronize() -static __inline__ __attribute__((always_inline)) long _InterlockedCompareExchange(volatile long * const dest, const long exch, const long comp) +__INTRIN_INLINE long _InterlockedCompareExchange(volatile long * const dest, const long exch, const long comp) { long a, b; - + __asm__ __volatile__ ( "0:\n\t" "ldr %1, [%2]\n\t" "cmp %1, %4\n\t" @@ -50,11 +50,11 @@ : "=&r" (a), "=&r" (b) : "r" (dest), "r" (exch), "r" (comp) : "cc", "memory"); - + return a; } -static __inline__ __attribute__((always_inline)) long long _InterlockedCompareExchange64(volatile long long * const dest, const long long exch, const long long comp) +__INTRIN_INLINE long long _InterlockedCompareExchange64(volatile long long * const dest, const long long exch, const long long comp) { // // FIXME @@ -65,16 +65,16 @@ return result; } -static __inline__ __attribute__((always_inline)) void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand) +__INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand) { return (void*)_InterlockedCompareExchange((volatile long* const)Destination, (const long)Exchange, (const long)Comperand); } -static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd(volatile long * const dest, const long add) +__INTRIN_INLINE long _InterlockedExchangeAdd(volatile long * const dest, const long add) { long a, b, c; - + __asm__ __volatile__ ( "0:\n\t" "ldr %0, [%3]\n\t" "add %1, %0, %4\n\t" @@ -85,201 +85,201 @@ : "=&r" (a), "=&r" (b), "=&r" (c) : "r" (dest), "r" (add) : "cc", "memory"); - + return a; } -static __inline__ __attribute__((always_inline)) long _InterlockedExchange(volatile long * const dest, const long exch) +__INTRIN_INLINE long _InterlockedExchange(volatile long * const dest, const long exch) { long a; - + __asm__ __volatile__ ( "swp %0, %2, [%1]" : "=&r" (a) : "r" (dest), "r" (exch)); - + return a; } -static __inline__ __attribute__((always_inline)) void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value) +__INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value) { return _InterlockedExchange(Target, Value); } -static __inline__ __attribute__((always_inline)) char _InterlockedAnd8(volatile char * const value, const char mask) +__INTRIN_INLINE char _InterlockedAnd8(volatile char * const value, const char mask) { char x; char y; - - y = *value; - + + y = *value; + do { x = y; y = _InterlockedCompareExchange8(value, x & mask, x); } while(y != x); - - return y; -} - -static __inline__ __attribute__((always_inline)) short _InterlockedAnd16(volatile short * const value, const short mask) + + return y; +} + +__INTRIN_INLINE short _InterlockedAnd16(volatile short * const value, const short mask) { short x; short y; - - y = *value; - + + y = *value; + do { x = y; y = _InterlockedCompareExchange16(value, x & mask, x); } while(y != x); - - return y; -} - -static __inline__ __attribute__((always_inline)) long _InterlockedAnd(volatile long * const value, const long mask) + + return y; +} + +__INTRIN_INLINE long _InterlockedAnd(volatile long * const value, const long mask) { long x; long y; - - y = *value; - + + y = *value; + do { x = y; y = _InterlockedCompareExchange(value, x & mask, x); } while(y != x); - - return y; -} - -static __inline__ __attribute__((always_inline)) char _InterlockedOr8(volatile char * const value, const char mask) + + return y; +} + +__INTRIN_INLINE char _InterlockedOr8(volatile char * const value, const char mask) { char x; char y; - - y = *value; - + + y = *value; + do { x = y; y = _InterlockedCompareExchange8(value, x | mask, x); } while(y != x); - - return y; -} - -static __inline__ __attribute__((always_inline)) short _InterlockedOr16(volatile short * const value, const short mask) + + return y; +} + +__INTRIN_INLINE short _InterlockedOr16(volatile short * const value, const short mask) { short x; short y; - - y = *value; - + + y = *value; + do { x = y; y = _InterlockedCompareExchange16(value, x | mask, x); } while(y != x); - - return y; -} - -static __inline__ __attribute__((always_inline)) long _InterlockedOr(volatile long * const value, const long mask) + + return y; +} + +__INTRIN_INLINE long _InterlockedOr(volatile long * const value, const long mask) { long x; long y; - - y = *value; - + + y = *value; + do { x = y; y = _InterlockedCompareExchange(value, x | mask, x); } while(y != x); - - return y; -} - -static __inline__ __attribute__((always_inline)) char _InterlockedXor8(volatile char * const value, const char mask) + + return y; +} + +__INTRIN_INLINE char _InterlockedXor8(volatile char * const value, const char mask) { char x; char y; - - y = *value; - + + y = *value; + do { x = y; y = _InterlockedCompareExchange8(value, x ^ mask, x); } while(y != x); - - return y; -} - -static __inline__ __attribute__((always_inline)) short _InterlockedXor16(volatile short * const value, const short mask) + + return y; +} + +__INTRIN_INLINE short _InterlockedXor16(volatile short * const value, const short mask) { short x; short y; - - y = *value; - + + y = *value; + do { x = y; y = _InterlockedCompareExchange16(value, x ^ mask, x); } while(y != x); - - return y; -} - -static __inline__ __attribute__((always_inline)) long _InterlockedXor(volatile long * const value, const long mask) + + return y; +} + +__INTRIN_INLINE long _InterlockedXor(volatile long * const value, const long mask) { long x; long y; - - y = *value; - + + y = *value; + do { x = y; y = _InterlockedCompareExchange(value, x ^ mask, x); } while(y != x); - - return y; -} - -static __inline__ __attribute__((always_inline)) long _InterlockedDecrement(volatile long * const lpAddend) + + return y; +} + +__INTRIN_INLINE long _InterlockedDecrement(volatile long * const lpAddend) { return _InterlockedExchangeAdd(lpAddend, -1) - 1; } -static __inline__ __attribute__((always_inline)) long _InterlockedIncrement(volatile long * const lpAddend) +__INTRIN_INLINE long _InterlockedIncrement(volatile long * const lpAddend) { return _InterlockedExchangeAdd(lpAddend, 1) + 1; } -static __inline__ __attribute__((always_inline)) long _InterlockedDecrement16(volatile short * const lpAddend) +__INTRIN_INLINE long _InterlockedDecrement16(volatile short * const lpAddend) { return _InterlockedExchangeAdd16(lpAddend, -1) - 1; } -static __inline__ __attribute__((always_inline)) long _InterlockedIncrement16(volatile short * const lpAddend) +__INTRIN_INLINE long _InterlockedIncrement16(volatile short * const lpAddend) { return _InterlockedExchangeAdd16(lpAddend, 1) + 1; } -static __inline__ __attribute__((always_inline)) void _disable(void) +__INTRIN_INLINE void _disable(void) { __asm__ __volatile__ ( @@ -289,7 +289,7 @@ ); } -static __inline__ __attribute__((always_inline)) void _enable(void) +__INTRIN_INLINE void _enable(void) { __asm__ __volatile__ ( @@ -300,7 +300,7 @@ } #ifndef __MSVCRT__ -static __inline__ __attribute__((always_inline)) unsigned long _rotl(const unsigned long value, const unsigned char shift) +__INTRIN_INLINE unsigned long _rotl(const unsigned long value, const unsigned char shift) { return (((value) << ((int)(shift))) | ((value) >> (32 - (int)(shift)))); } Modified: trunk/reactos/include/crt/mingw32/intrin_x86.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/mingw32/intrin…
============================================================================== --- trunk/reactos/include/crt/mingw32/intrin_x86.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/mingw32/intrin_x86.h [iso-8859-1] Tue Jun 16 04:24:26 2009 @@ -80,7 +80,7 @@ #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 #define _ReadWriteBarrier() __sync_synchronize() #else -static void __inline__ __attribute__((always_inline)) _MemoryBarrier(void) +__INTRIN_INLINE void _MemoryBarrier(void) { __asm__ __volatile__("" : : : "memory"); } @@ -93,27 +93,27 @@ #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 -static __inline__ __attribute__((always_inline)) char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand) +__INTRIN_INLINE char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand) { return __sync_val_compare_and_swap(Destination, Comperand, Exchange); } -static __inline__ __attribute__((always_inline)) short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand) +__INTRIN_INLINE short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand) { return __sync_val_compare_and_swap(Destination, Comperand, Exchange); } -static __inline__ __attribute__((always_inline)) long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand) +__INTRIN_INLINE long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand) { return __sync_val_compare_and_swap(Destination, Comperand, Exchange); } -static __inline__ __attribute__((always_inline)) void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand) +__INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand) { return __sync_val_compare_and_swap(Destination, Comperand, Exchange); } -static __inline__ __attribute__((always_inline)) long _InterlockedExchange(volatile long * const Target, const long Value) +__INTRIN_INLINE long _InterlockedExchange(volatile long * const Target, const long Value) { /* NOTE: __sync_lock_test_and_set would be an acquire barrier, so we force a full barrier */ __sync_synchronize(); @@ -121,7 +121,7 @@ } #if defined(_M_AMD64) -static __inline__ __attribute__((always_inline)) long long _InterlockedExchange64(volatile long long * const Target, const long long Value) +__INTRIN_INLINE long long _InterlockedExchange64(volatile long long * const Target, const long long Value) { /* NOTE: __sync_lock_test_and_set would be an acquire barrier, so we force a full barrier */ __sync_synchronize(); @@ -129,148 +129,148 @@ } #endif -static __inline__ __attribute__((always_inline)) void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value) +__INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value) { /* NOTE: ditto */ __sync_synchronize(); return __sync_lock_test_and_set(Target, Value); } -static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value) +__INTRIN_INLINE long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value) { return __sync_fetch_and_add(Addend, Value); } -static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd(volatile long * const Addend, const long Value) +__INTRIN_INLINE long _InterlockedExchangeAdd(volatile long * const Addend, const long Value) { return __sync_fetch_and_add(Addend, Value); } #if defined(_M_AMD64) -static __inline__ __attribute__((always_inline)) long long _InterlockedExchangeAdd64(volatile long long * const Addend, const long long Value) +__INTRIN_INLINE long long _InterlockedExchangeAdd64(volatile long long * const Addend, const long long Value) { return __sync_fetch_and_add(Addend, Value); } #endif -static __inline__ __attribute__((always_inline)) char _InterlockedAnd8(volatile char * const value, const char mask) +__INTRIN_INLINE char _InterlockedAnd8(volatile char * const value, const char mask) { return __sync_fetch_and_and(value, mask); } -static __inline__ __attribute__((always_inline)) short _InterlockedAnd16(volatile short * const value, const short mask) +__INTRIN_INLINE short _InterlockedAnd16(volatile short * const value, const short mask) { return __sync_fetch_and_and(value, mask); } -static __inline__ __attribute__((always_inline)) long _InterlockedAnd(volatile long * const value, const long mask) +__INTRIN_INLINE long _InterlockedAnd(volatile long * const value, const long mask) { return __sync_fetch_and_and(value, mask); } #if defined(_M_AMD64) -static __inline__ __attribute__((always_inline)) long _InterlockedAnd64(volatile long long * const value, const long long mask) +__INTRIN_INLINE long _InterlockedAnd64(volatile long long * const value, const long long mask) { return __sync_fetch_and_and(value, mask); } #endif -static __inline__ __attribute__((always_inline)) char _InterlockedOr8(volatile char * const value, const char mask) +__INTRIN_INLINE char _InterlockedOr8(volatile char * const value, const char mask) { return __sync_fetch_and_or(value, mask); } -static __inline__ __attribute__((always_inline)) short _InterlockedOr16(volatile short * const value, const short mask) +__INTRIN_INLINE short _InterlockedOr16(volatile short * const value, const short mask) { return __sync_fetch_and_or(value, mask); } -static __inline__ __attribute__((always_inline)) long _InterlockedOr(volatile long * const value, const long mask) +__INTRIN_INLINE long _InterlockedOr(volatile long * const value, const long mask) { return __sync_fetch_and_or(value, mask); } #if defined(_M_AMD64) -static __inline__ __attribute__((always_inline)) long _InterlockedOr64(volatile long long * const value, const long long mask) +__INTRIN_INLINE long _InterlockedOr64(volatile long long * const value, const long long mask) { return __sync_fetch_and_or(value, mask); } #endif -static __inline__ __attribute__((always_inline)) char _InterlockedXor8(volatile char * const value, const char mask) +__INTRIN_INLINE char _InterlockedXor8(volatile char * const value, const char mask) { return __sync_fetch_and_xor(value, mask); } -static __inline__ __attribute__((always_inline)) short _InterlockedXor16(volatile short * const value, const short mask) +__INTRIN_INLINE short _InterlockedXor16(volatile short * const value, const short mask) { return __sync_fetch_and_xor(value, mask); } -static __inline__ __attribute__((always_inline)) long _InterlockedXor(volatile long * const value, const long mask) +__INTRIN_INLINE long _InterlockedXor(volatile long * const value, const long mask) { return __sync_fetch_and_xor(value, mask); } #else -static __inline__ __attribute__((always_inline)) char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand) +__INTRIN_INLINE char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand) { char retval = Comperand; __asm__("lock; cmpxchgb %b[Exchange], %[Destination]" : [retval] "+a" (retval) : [Destination] "m" (*Destination), [Exchange] "q" (Exchange) : "memory"); return retval; } -static __inline__ __attribute__((always_inline)) short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand) +__INTRIN_INLINE short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand) { short retval = Comperand; __asm__("lock; cmpxchgw %w[Exchange], %[Destination]" : [retval] "+a" (retval) : [Destination] "m" (*Destination), [Exchange] "q" (Exchange): "memory"); return retval; } -static __inline__ __attribute__((always_inline)) long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand) +__INTRIN_INLINE long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand) { long retval = Comperand; __asm__("lock; cmpxchgl %k[Exchange], %[Destination]" : [retval] "+a" (retval) : [Destination] "m" (*Destination), [Exchange] "q" (Exchange): "memory"); return retval; } -static __inline__ __attribute__((always_inline)) void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand) +__INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand) { void * retval = (void *)Comperand; __asm__("lock; cmpxchgl %k[Exchange], %[Destination]" : [retval] "=a" (retval) : "[retval]" (retval), [Destination] "m" (*Destination), [Exchange] "q" (Exchange) : "memory"); return retval; } -static __inline__ __attribute__((always_inline)) long _InterlockedExchange(volatile long * const Target, const long Value) +__INTRIN_INLINE long _InterlockedExchange(volatile long * const Target, const long Value) { long retval = Value; __asm__("xchgl %[retval], %[Target]" : [retval] "+r" (retval) : [Target] "m" (*Target) : "memory"); return retval; } -static __inline__ __attribute__((always_inline)) void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value) +__INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value) { void * retval = Value; __asm__("xchgl %[retval], %[Target]" : [retval] "+r" (retval) : [Target] "m" (*Target) : "memory"); return retval; } -static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value) +__INTRIN_INLINE long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value) { long retval = Value; __asm__("lock; xaddw %[retval], %[Addend]" : [retval] "+r" (retval) : [Addend] "m" (*Addend) : "memory"); return retval; } -static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd(volatile long * const Addend, const long Value) +__INTRIN_INLINE long _InterlockedExchangeAdd(volatile long * const Addend, const long Value) { long retval = Value; __asm__("lock; xaddl %[retval], %[Addend]" : [retval] "+r" (retval) : [Addend] "m" (*Addend) : "memory"); return retval; } -static __inline__ __attribute__((always_inline)) char _InterlockedAnd8(volatile char * const value, const char mask) +__INTRIN_INLINE char _InterlockedAnd8(volatile char * const value, const char mask) { char x; char y; @@ -287,7 +287,7 @@ return y; } -static __inline__ __attribute__((always_inline)) short _InterlockedAnd16(volatile short * const value, const short mask) +__INTRIN_INLINE short _InterlockedAnd16(volatile short * const value, const short mask) { short x; short y; @@ -304,7 +304,7 @@ return y; } -static __inline__ __attribute__((always_inline)) long _InterlockedAnd(volatile long * const value, const long mask) +__INTRIN_INLINE long _InterlockedAnd(volatile long * const value, const long mask) { long x; long y; @@ -321,7 +321,7 @@ return y; } -static __inline__ __attribute__((always_inline)) char _InterlockedOr8(volatile char * const value, const char mask) +__INTRIN_INLINE char _InterlockedOr8(volatile char * const value, const char mask) { char x; char y; @@ -338,7 +338,7 @@ return y; } -static __inline__ __attribute__((always_inline)) short _InterlockedOr16(volatile short * const value, const short mask) +__INTRIN_INLINE short _InterlockedOr16(volatile short * const value, const short mask) { short x; short y; @@ -355,7 +355,7 @@ return y; } -static __inline__ __attribute__((always_inline)) long _InterlockedOr(volatile long * const value, const long mask) +__INTRIN_INLINE long _InterlockedOr(volatile long * const value, const long mask) { long x; long y; @@ -372,7 +372,7 @@ return y; } -static __inline__ __attribute__((always_inline)) char _InterlockedXor8(volatile char * const value, const char mask) +__INTRIN_INLINE char _InterlockedXor8(volatile char * const value, const char mask) { char x; char y; @@ -389,7 +389,7 @@ return y; } -static __inline__ __attribute__((always_inline)) short _InterlockedXor16(volatile short * const value, const short mask) +__INTRIN_INLINE short _InterlockedXor16(volatile short * const value, const short mask) { short x; short y; @@ -406,7 +406,7 @@ return y; } -static __inline__ __attribute__((always_inline)) long _InterlockedXor(volatile long * const value, const long mask) +__INTRIN_INLINE long _InterlockedXor(volatile long * const value, const long mask) { long x; long y; @@ -427,14 +427,14 @@ #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 && defined(__x86_64__) -static __inline__ __attribute__((always_inline)) long long _InterlockedCompareExchange64(volatile long long * const Destination, const long long Exchange, const long long Comperand) +__INTRIN_INLINE long long _InterlockedCompareExchange64(volatile long long * const Destination, const long long Exchange, const long long Comperand) { return __sync_val_compare_and_swap(Destination, Comperand, Exchange); } #else -static __inline__ __attribute__((always_inline)) long long _InterlockedCompareExchange64(volatile long long * const Destination, const long long Exchange, const long long Comperand) +__INTRIN_INLINE long long _InterlockedCompareExchange64(volatile long long * const Destination, const long long Exchange, const long long Comperand) { long long retval = Comperand; @@ -453,7 +453,7 @@ #endif -static __inline__ __attribute__((always_inline)) long _InterlockedAddLargeStatistic(volatile long long * const Addend, const long Value) +__INTRIN_INLINE long _InterlockedAddLargeStatistic(volatile long long * const Addend, const long Value) { __asm__ ( @@ -469,39 +469,39 @@ return Value; } -static __inline__ __attribute__((always_inline)) long _InterlockedDecrement(volatile long * const lpAddend) +__INTRIN_INLINE long _InterlockedDecrement(volatile long * const lpAddend) { return _InterlockedExchangeAdd(lpAddend, -1) - 1; } -static __inline__ __attribute__((always_inline)) long _InterlockedIncrement(volatile long * const lpAddend) +__INTRIN_INLINE long _InterlockedIncrement(volatile long * const lpAddend) { return _InterlockedExchangeAdd(lpAddend, 1) + 1; } -static __inline__ __attribute__((always_inline)) long _InterlockedDecrement16(volatile short * const lpAddend) +__INTRIN_INLINE long _InterlockedDecrement16(volatile short * const lpAddend) { return _InterlockedExchangeAdd16(lpAddend, -1) - 1; } -static __inline__ __attribute__((always_inline)) long _InterlockedIncrement16(volatile short * const lpAddend) +__INTRIN_INLINE long _InterlockedIncrement16(volatile short * const lpAddend) { return _InterlockedExchangeAdd16(lpAddend, 1) + 1; } #if defined(_M_AMD64) -static __inline__ __attribute__((always_inline)) long long _InterlockedDecrement64(volatile long long * const lpAddend) +__INTRIN_INLINE long long _InterlockedDecrement64(volatile long long * const lpAddend) { return _InterlockedExchangeAdd64(lpAddend, -1) - 1; } -static __inline__ __attribute__((always_inline)) long long _InterlockedIncrement64(volatile long long * const lpAddend) +__INTRIN_INLINE long long _InterlockedIncrement64(volatile long long * const lpAddend) { return _InterlockedExchangeAdd64(lpAddend, 1) + 1; } #endif -static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandreset(volatile long * a, const long b) +__INTRIN_INLINE unsigned char _interlockedbittestandreset(volatile long * a, const long b) { unsigned char retval; __asm__("lock; btrl %[b], %[a]; setb %b[retval]" : [retval] "=q" (retval), [a] "+m" (*a) : [b] "Ir" (b) : "memory"); @@ -509,7 +509,7 @@ } #if defined(_M_AMD64) -static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandreset64(volatile long long * a, const long long b) +__INTRIN_INLINE unsigned char _interlockedbittestandreset64(volatile long long * a, const long long b) { unsigned char retval; __asm__("lock; btrq %[b], %[a]; setb %b[retval]" : [retval] "=r" (retval), [a] "+m" (*a) : [b] "Ir" (b) : "memory"); @@ -517,7 +517,7 @@ } #endif -static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandset(volatile long * a, const long b) +__INTRIN_INLINE unsigned char _interlockedbittestandset(volatile long * a, const long b) { unsigned char retval; __asm__("lock; btsl %[b], %[a]; setc %b[retval]" : [retval] "=q" (retval), [a] "+m" (*a) : [b] "Ir" (b) : "memory"); @@ -525,7 +525,7 @@ } #if defined(_M_AMD64) -static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandset64(volatile long long * a, const long long b) +__INTRIN_INLINE unsigned char _interlockedbittestandset64(volatile long long * a, const long long b) { unsigned char retval; __asm__("lock; btsq %[b], %[a]; setc %b[retval]" : [retval] "=r" (retval), [a] "+m" (*a) : [b] "Ir" (b) : "memory"); @@ -535,7 +535,7 @@ /*** String operations ***/ /* NOTE: we don't set a memory clobber in the __stosX functions because Visual C++ doesn't */ -static __inline__ __attribute__((always_inline)) void __stosb(unsigned char * Dest, const unsigned char Data, size_t Count) +__INTRIN_INLINE void __stosb(unsigned char * Dest, const unsigned char Data, size_t Count) { __asm__ __volatile__ ( @@ -545,7 +545,7 @@ ); } -static __inline__ __attribute__((always_inline)) void __stosw(unsigned short * Dest, const unsigned short Data, size_t Count) +__INTRIN_INLINE void __stosw(unsigned short * Dest, const unsigned short Data, size_t Count) { __asm__ __volatile__ ( @@ -555,7 +555,7 @@ ); } -static __inline__ __attribute__((always_inline)) void __stosd(unsigned long * Dest, const unsigned long Data, size_t Count) +__INTRIN_INLINE void __stosd(unsigned long * Dest, const unsigned long Data, size_t Count) { __asm__ __volatile__ ( @@ -565,7 +565,7 @@ ); } -static __inline__ __attribute__((always_inline)) void __movsb(unsigned char * Destination, const unsigned char * Source, size_t Count) +__INTRIN_INLINE void __movsb(unsigned char * Destination, const unsigned char * Source, size_t Count) { __asm__ __volatile__ ( @@ -575,7 +575,7 @@ ); } -static __inline__ __attribute__((always_inline)) void __movsw(unsigned short * Destination, const unsigned short * Source, size_t Count) +__INTRIN_INLINE void __movsw(unsigned short * Destination, const unsigned short * Source, size_t Count) { __asm__ __volatile__ ( @@ -585,7 +585,7 @@ ); } -static __inline__ __attribute__((always_inline)) void __movsd(unsigned long * Destination, const unsigned long * Source, size_t Count) +__INTRIN_INLINE void __movsd(unsigned long * Destination, const unsigned long * Source, size_t Count) { __asm__ __volatile__ ( @@ -598,160 +598,160 @@ #if defined(_M_AMD64) /*** GS segment addressing ***/ -static __inline__ __attribute__((always_inline)) void __writegsbyte(const unsigned long Offset, const unsigned char Data) +__INTRIN_INLINE void __writegsbyte(const unsigned long Offset, const unsigned char Data) { __asm__ __volatile__("movb %b[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } -static __inline__ __attribute__((always_inline)) void __writegsword(const unsigned long Offset, const unsigned short Data) +__INTRIN_INLINE void __writegsword(const unsigned long Offset, const unsigned short Data) { __asm__ __volatile__("movw %w[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } -static __inline__ __attribute__((always_inline)) void __writegsdword(const unsigned long Offset, const unsigned long Data) +__INTRIN_INLINE void __writegsdword(const unsigned long Offset, const unsigned long Data) { __asm__ __volatile__("movl %k[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } -static __inline__ __attribute__((always_inline)) void __writegsqword(const unsigned long Offset, const unsigned __int64 Data) +__INTRIN_INLINE void __writegsqword(const unsigned long Offset, const unsigned __int64 Data) { __asm__ __volatile__("movq %q[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } -static __inline__ __attribute__((always_inline)) unsigned char __readgsbyte(const unsigned long Offset) +__INTRIN_INLINE unsigned char __readgsbyte(const unsigned long Offset) { unsigned char value; __asm__ __volatile__("movb %%gs:%a[Offset], %b[value]" : [value] "=q" (value) : [Offset] "irm" (Offset)); return value; } -static __inline__ __attribute__((always_inline)) unsigned short __readgsword(const unsigned long Offset) +__INTRIN_INLINE unsigned short __readgsword(const unsigned long Offset) { unsigned short value; __asm__ __volatile__("movw %%gs:%a[Offset], %w[value]" : [value] "=q" (value) : [Offset] "irm" (Offset)); return value; } -static __inline__ __attribute__((always_inline)) unsigned long __readgsdword(const unsigned long Offset) +__INTRIN_INLINE unsigned long __readgsdword(const unsigned long Offset) { unsigned long value; __asm__ __volatile__("movl %%gs:%a[Offset], %k[value]" : [value] "=q" (value) : [Offset] "irm" (Offset)); return value; } -static __inline__ __attribute__((always_inline)) unsigned __int64 __readgsqword(const unsigned long Offset) +__INTRIN_INLINE unsigned __int64 __readgsqword(const unsigned long Offset) { unsigned __int64 value; __asm__ __volatile__("movq %%gs:%a[Offset], %q[value]" : [value] "=q" (value) : [Offset] "irm" (Offset)); return value; } -static __inline__ __attribute__((always_inline)) void __incgsbyte(const unsigned long Offset) +__INTRIN_INLINE void __incgsbyte(const unsigned long Offset) { __asm__ __volatile__("incb %%gs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory"); } -static __inline__ __attribute__((always_inline)) void __incgsword(const unsigned long Offset) +__INTRIN_INLINE void __incgsword(const unsigned long Offset) { __asm__ __volatile__("incw %%gs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory"); } -static __inline__ __attribute__((always_inline)) void __incgsdword(const unsigned long Offset) +__INTRIN_INLINE void __incgsdword(const unsigned long Offset) { __asm__ __volatile__("incl %%gs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory"); } -static __inline__ __attribute__((always_inline)) void __addgsbyte(const unsigned long Offset, const unsigned char Data) +__INTRIN_INLINE void __addgsbyte(const unsigned long Offset, const unsigned char Data) { __asm__ __volatile__("addb %b[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } -static __inline__ __attribute__((always_inline)) void __addgsword(const unsigned long Offset, const unsigned short Data) +__INTRIN_INLINE void __addgsword(const unsigned long Offset, const unsigned short Data) { __asm__ __volatile__("addw %w[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } -static __inline__ __attribute__((always_inline)) void __addgsdword(const unsigned long Offset, const unsigned int Data) +__INTRIN_INLINE void __addgsdword(const unsigned long Offset, const unsigned int Data) { __asm__ __volatile__("addl %k[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } -static __inline__ __attribute__((always_inline)) void __addgsqword(const unsigned long Offset, const unsigned __int64 Data) +__INTRIN_INLINE void __addgsqword(const unsigned long Offset, const unsigned __int64 Data) { __asm__ __volatile__("addq %k[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } #else /*** FS segment addressing ***/ -static __inline__ __attribute__((always_inline)) void __writefsbyte(const unsigned long Offset, const unsigned char Data) +__INTRIN_INLINE void __writefsbyte(const unsigned long Offset, const unsigned char Data) { __asm__ __volatile__("movb %b[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } -static __inline__ __attribute__((always_inline)) void __writefsword(const unsigned long Offset, const unsigned short Data) +__INTRIN_INLINE void __writefsword(const unsigned long Offset, const unsigned short Data) { __asm__ __volatile__("movw %w[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } -static __inline__ __attribute__((always_inline)) void __writefsdword(const unsigned long Offset, const unsigned long Data) +__INTRIN_INLINE void __writefsdword(const unsigned long Offset, const unsigned long Data) { __asm__ __volatile__("movl %k[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } -static __inline__ __attribute__((always_inline)) unsigned char __readfsbyte(const unsigned long Offset) +__INTRIN_INLINE unsigned char __readfsbyte(const unsigned long Offset) { unsigned char value; __asm__ __volatile__("movb %%fs:%a[Offset], %b[value]" : [value] "=q" (value) : [Offset] "irm" (Offset) : "memory"); return value; } -static __inline__ __attribute__((always_inline)) unsigned short __readfsword(const unsigned long Offset) +__INTRIN_INLINE unsigned short __readfsword(const unsigned long Offset) { unsigned short value; - __asm__ __volatile__("movw %%fs:%a[Offset], %w[value]" : [value] "=q" (value) : [Offset] "irm" (Offset)); + __asm__ __volatile__("movw %%fs:%a[Offset], %w[value]" : [value] "=q" (value) : [Offset] "irm" (Offset) : "memory"); return value; } -static __inline__ __attribute__((always_inline)) unsigned long __readfsdword(const unsigned long Offset) +__INTRIN_INLINE unsigned long __readfsdword(const unsigned long Offset) { unsigned long value; - __asm__ __volatile__("movl %%fs:%a[Offset], %k[value]" : [value] "=q" (value) : [Offset] "irm" (Offset)); + __asm__ __volatile__("movl %%fs:%a[Offset], %k[value]" : [value] "=q" (value) : [Offset] "irm" (Offset) : "memory"); return value; } -static __inline__ __attribute__((always_inline)) void __incfsbyte(const unsigned long Offset) +__INTRIN_INLINE void __incfsbyte(const unsigned long Offset) { __asm__ __volatile__("incb %%fs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory"); } -static __inline__ __attribute__((always_inline)) void __incfsword(const unsigned long Offset) +__INTRIN_INLINE void __incfsword(const unsigned long Offset) { __asm__ __volatile__("incw %%fs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory"); } -static __inline__ __attribute__((always_inline)) void __incfsdword(const unsigned long Offset) +__INTRIN_INLINE void __incfsdword(const unsigned long Offset) { __asm__ __volatile__("incl %%fs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory"); } /* NOTE: the bizarre implementation of __addfsxxx mimics the broken Visual C++ behavior */ -static __inline__ __attribute__((always_inline)) void __addfsbyte(const unsigned long Offset, const unsigned char Data) +__INTRIN_INLINE void __addfsbyte(const unsigned long Offset, const unsigned char Data) { if(!__builtin_constant_p(Offset)) - __asm__ __volatile__("addb %k[Offset], %%fs:%a[Offset]" : : [Offset] "r" (Offset) : "memory"); + __asm__ __volatile__("addb %b[Offset], %%fs:%a[Offset]" : : [Offset] "r" (Offset) : "memory"); else __asm__ __volatile__("addb %b[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } -static __inline__ __attribute__((always_inline)) void __addfsword(const unsigned long Offset, const unsigned short Data) +__INTRIN_INLINE void __addfsword(const unsigned long Offset, const unsigned short Data) { if(!__builtin_constant_p(Offset)) - __asm__ __volatile__("addw %k[Offset], %%fs:%a[Offset]" : : [Offset] "r" (Offset) : "memory"); + __asm__ __volatile__("addw %w[Offset], %%fs:%a[Offset]" : : [Offset] "r" (Offset) : "memory"); else __asm__ __volatile__("addw %w[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } -static __inline__ __attribute__((always_inline)) void __addfsdword(const unsigned long Offset, const unsigned int Data) +__INTRIN_INLINE void __addfsdword(const unsigned long Offset, const unsigned int Data) { if(!__builtin_constant_p(Offset)) __asm__ __volatile__("addl %k[Offset], %%fs:%a[Offset]" : : [Offset] "r" (Offset) : "memory"); @@ -762,20 +762,20 @@ /*** Bit manipulation ***/ -static __inline__ __attribute__((always_inline)) unsigned char _BitScanForward(unsigned long * const Index, const unsigned long Mask) +__INTRIN_INLINE unsigned char _BitScanForward(unsigned long * const Index, const unsigned long Mask) { __asm__("bsfl %[Mask], %[Index]" : [Index] "=r" (*Index) : [Mask] "mr" (Mask)); return Mask ? 1 : 0; } -static __inline__ __attribute__((always_inline)) unsigned char _BitScanReverse(unsigned long * const Index, const unsigned long Mask) +__INTRIN_INLINE unsigned char _BitScanReverse(unsigned long * const Index, const unsigned long Mask) { __asm__("bsrl %[Mask], %[Index]" : [Index] "=r" (*Index) : [Mask] "mr" (Mask)); return Mask ? 1 : 0; } /* NOTE: again, the bizarre implementation follows Visual C++ */ -static __inline__ __attribute__((always_inline)) unsigned char _bittest(const long * const a, const long b) +__INTRIN_INLINE unsigned char _bittest(const long * const a, const long b) { unsigned char retval; @@ -787,7 +787,7 @@ return retval; } -static __inline__ __attribute__((always_inline)) unsigned char _bittestandcomplement(long * const a, const long b) +__INTRIN_INLINE unsigned char _bittestandcomplement(long * const a, const long b) { unsigned char retval; @@ -799,7 +799,7 @@ return retval; } -static __inline__ __attribute__((always_inline)) unsigned char _bittestandreset(long * const a, const long b) +__INTRIN_INLINE unsigned char _bittestandreset(long * const a, const long b) { unsigned char retval; @@ -811,7 +811,7 @@ return retval; } -static __inline__ __attribute__((always_inline)) unsigned char _bittestandset(long * const a, const long b) +__INTRIN_INLINE unsigned char _bittestandset(long * const a, const long b) { unsigned char retval; @@ -823,14 +823,14 @@ return retval; } -static __inline__ __attribute__((always_inline)) unsigned char _rotl8(unsigned char value, unsigned char shift) +__INTRIN_INLINE unsigned char _rotl8(unsigned char value, unsigned char shift) { unsigned char retval; __asm__("rolb %b[shift], %b[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift)); return retval; } -static __inline__ __attribute__((always_inline)) unsigned short _rotl16(unsigned short value, unsigned char shift) +__INTRIN_INLINE unsigned short _rotl16(unsigned short value, unsigned char shift) { unsigned short retval; __asm__("rolw %b[shift], %w[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift)); @@ -838,14 +838,14 @@ } #ifndef __MSVCRT__ -static __inline__ __attribute__((always_inline)) unsigned int _rotl(unsigned int value, int shift) +__INTRIN_INLINE unsigned int _rotl(unsigned int value, int shift) { unsigned long retval; __asm__("roll %b[shift], %k[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift)); return retval; } -static __inline__ __attribute__((always_inline)) unsigned int _rotr(unsigned int value, int shift) +__INTRIN_INLINE unsigned int _rotr(unsigned int value, int shift) { unsigned long retval; __asm__("rorl %b[shift], %k[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift)); @@ -853,14 +853,14 @@ } #endif -static __inline__ __attribute__((always_inline)) unsigned char _rotr8(unsigned char value, unsigned char shift) +__INTRIN_INLINE unsigned char _rotr8(unsigned char value, unsigned char shift) { unsigned char retval; __asm__("rorb %b[shift], %b[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift)); return retval; } -static __inline__ __attribute__((always_inline)) unsigned short _rotr16(unsigned short value, unsigned char shift) +__INTRIN_INLINE unsigned short _rotr16(unsigned short value, unsigned char shift) { unsigned short retval; __asm__("rorw %b[shift], %w[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift)); @@ -874,7 +874,7 @@ just confuses it. Also we declare Bit as an int and then truncate it to match Visual C++ behavior */ -static __inline__ __attribute__((always_inline)) unsigned long long __ll_lshift(const unsigned long long Mask, const int Bit) +__INTRIN_INLINE unsigned long long __ll_lshift(const unsigned long long Mask, const int Bit) { unsigned long long retval = Mask; @@ -888,7 +888,7 @@ return retval; } -static __inline__ __attribute__((always_inline)) long long __ll_rshift(const long long Mask, const int Bit) +__INTRIN_INLINE long long __ll_rshift(const long long Mask, const int Bit) { unsigned long long retval = Mask; @@ -902,7 +902,7 @@ return retval; } -static __inline__ __attribute__((always_inline)) unsigned long long __ull_rshift(const unsigned long long Mask, int Bit) +__INTRIN_INLINE unsigned long long __ull_rshift(const unsigned long long Mask, int Bit) { unsigned long long retval = Mask; @@ -916,14 +916,14 @@ return retval; } -static __inline__ __attribute__((always_inline)) unsigned short _byteswap_ushort(unsigned short value) +__INTRIN_INLINE unsigned short _byteswap_ushort(unsigned short value) { unsigned short retval; __asm__("rorw $8, %w[retval]" : [retval] "=rm" (retval) : "[retval]" (value)); return retval; } -static __inline__ __attribute__((always_inline)) unsigned long _byteswap_ulong(unsigned long value) +__INTRIN_INLINE unsigned long _byteswap_ulong(unsigned long value) { unsigned long retval; __asm__("bswapl %[retval]" : [retval] "=rm" (retval) : "[retval]" (value)); @@ -931,14 +931,14 @@ } #ifdef _M_AMD64 -static __inline__ __attribute__((always_inline)) unsigned __int64 _byteswap_uint64(unsigned __int64 value) +__INTRIN_INLINE unsigned __int64 _byteswap_uint64(unsigned __int64 value) { unsigned __int64 retval; __asm__("bswapq %[retval]" : [retval] "=rm" (retval) : "[retval]" (value)); return retval; } #else -static __inline__ __attribute__((always_inline)) unsigned __int64 _byteswap_uint64(unsigned __int64 value) +__INTRIN_INLINE unsigned __int64 _byteswap_uint64(unsigned __int64 value) { union { __int64 int64part; @@ -956,14 +956,14 @@ #endif /*** 64-bit math ***/ -static __inline__ __attribute__((always_inline)) long long __emul(const int a, const int b) +__INTRIN_INLINE long long __emul(const int a, const int b) { long long retval; __asm__("imull %[b]" : "=A" (retval) : [a] "a" (a), [b] "rm" (b)); return retval; } -static __inline__ __attribute__((always_inline)) unsigned long long __emulu(const unsigned int a, const unsigned int b) +__INTRIN_INLINE unsigned long long __emulu(const unsigned int a, const unsigned int b) { unsigned long long retval; __asm__("mull %[b]" : "=A" (retval) : [a] "a" (a), [b] "rm" (b)); @@ -972,28 +972,28 @@ /*** Port I/O ***/ -static __inline__ __attribute__((always_inline)) unsigned char __inbyte(const unsigned short Port) +__INTRIN_INLINE unsigned char __inbyte(const unsigned short Port) { unsigned char byte; __asm__ __volatile__("inb %w[Port], %b[byte]" : [byte] "=a" (byte) : [Port] "Nd" (Port)); return byte; } -static __inline__ __attribute__((always_inline)) unsigned short __inword(const unsigned short Port) +__INTRIN_INLINE unsigned short __inword(const unsigned short Port) { unsigned short word; __asm__ __volatile__("inw %w[Port], %w[word]" : [word] "=a" (word) : [Port] "Nd" (Port)); return word; } -static __inline__ __attribute__((always_inline)) unsigned long __indword(const unsigned short Port) +__INTRIN_INLINE unsigned long __indword(const unsigned short Port) { unsigned long dword; __asm__ __volatile__("inl %w[Port], %k[dword]" : [dword] "=a" (dword) : [Port] "Nd" (Port)); return dword; } -static __inline__ __attribute__((always_inline)) void __inbytestring(unsigned short Port, unsigned char * Buffer, unsigned long Count) +__INTRIN_INLINE void __inbytestring(unsigned short Port, unsigned char * Buffer, unsigned long Count) { __asm__ __volatile__ ( @@ -1004,7 +1004,7 @@ ); } -static __inline__ __attribute__((always_inline)) void __inwordstring(unsigned short Port, unsigned short * Buffer, unsigned long Count) +__INTRIN_INLINE void __inwordstring(unsigned short Port, unsigned short * Buffer, unsigned long Count) { __asm__ __volatile__ ( @@ -1015,7 +1015,7 @@ ); } -static __inline__ __attribute__((always_inline)) void __indwordstring(unsigned short Port, unsigned long * Buffer, unsigned long Count) +__INTRIN_INLINE void __indwordstring(unsigned short Port, unsigned long * Buffer, unsigned long Count) { __asm__ __volatile__ ( @@ -1026,44 +1026,44 @@ ); } -static __inline__ __attribute__((always_inline)) void __outbyte(unsigned short const Port, const unsigned char Data) +__INTRIN_INLINE void __outbyte(unsigned short const Port, const unsigned char Data) { __asm__ __volatile__("outb %b[Data], %w[Port]" : : [Port] "Nd" (Port), [Data] "a" (Data)); } -static __inline__ __attribute__((always_inline)) void __outword(unsigned short const Port, const unsigned short Data) +__INTRIN_INLINE void __outword(unsigned short const Port, const unsigned short Data) { __asm__ __volatile__("outw %w[Data], %w[Port]" : : [Port] "Nd" (Port), [Data] "a" (Data)); } -static __inline__ __attribute__((always_inline)) void __outdword(unsigned short const Port, const unsigned long Data) +__INTRIN_INLINE void __outdword(unsigned short const Port, const unsigned long Data) { __asm__ __volatile__("outl %k[Data], %w[Port]" : : [Port] "Nd" (Port), [Data] "a" (Data)); } -static __inline__ __attribute__((always_inline)) void __outbytestring(unsigned short const Port, const unsigned char * const Buffer, const unsigned long Count) +__INTRIN_INLINE void __outbytestring(unsigned short const Port, const unsigned char * const Buffer, const unsigned long Count) { __asm__ __volatile__("rep; outsb" : : [Port] "d" (Port), [Buffer] "S" (Buffer), "c" (Count)); } -static __inline__ __attribute__((always_inline)) void __outwordstring(unsigned short const Port, const unsigned short * const Buffer, const unsigned long Count) +__INTRIN_INLINE void __outwordstring(unsigned short const Port, const unsigned short * const Buffer, const unsigned long Count) { __asm__ __volatile__("rep; outsw" : : [Port] "d" (Port), [Buffer] "S" (Buffer), "c" (Count)); } -static __inline__ __attribute__((always_inline)) void __outdwordstring(unsigned short const Port, const unsigned long * const Buffer, const unsigned long Count) +__INTRIN_INLINE void __outdwordstring(unsigned short const Port, const unsigned long * const Buffer, const unsigned long Count) { __asm__ __volatile__("rep; outsl" : : [Port] "d" (Port), [Buffer] "S" (Buffer), "c" (Count)); } /*** System information ***/ -static __inline__ __attribute__((always_inline)) void __cpuid(int CPUInfo[], const int InfoType) +__INTRIN_INLINE void __cpuid(int CPUInfo[], const int InfoType) { __asm__ __volatile__("cpuid" : "=a" (CPUInfo[0]), "=b" (CPUInfo[1]), "=c" (CPUInfo[2]), "=d" (CPUInfo[3]) : "a" (InfoType)); } -static __inline__ __attribute__((always_inline)) unsigned long long __rdtsc(void) +__INTRIN_INLINE unsigned long long __rdtsc(void) { #ifdef _M_AMD64 unsigned long long low, high; @@ -1076,12 +1076,12 @@ #endif } -static __inline__ __attribute__((always_inline)) void __writeeflags(uintptr_t Value) +__INTRIN_INLINE void __writeeflags(uintptr_t Value) { __asm__ __volatile__("push %0\n popf" : : "rim"(Value)); } -static __inline__ __attribute__((always_inline)) uintptr_t __readeflags(void) +__INTRIN_INLINE uintptr_t __readeflags(void) { uintptr_t retval; __asm__ __volatile__("pushf\n pop %0" : "=rm"(retval)); @@ -1089,22 +1089,22 @@ } /*** Interrupts ***/ -static __inline__ __attribute__((always_inline)) void __debugbreak(void) +__INTRIN_INLINE void __debugbreak(void) { __asm__("int $3"); } -static __inline__ __attribute__((always_inline)) void __int2c(void) +__INTRIN_INLINE void __int2c(void) { __asm__("int $0x2c"); } -static __inline__ __attribute__((always_inline)) void _disable(void) +__INTRIN_INLINE void _disable(void) { __asm__("cli"); } -static __inline__ __attribute__((always_inline)) void _enable(void) +__INTRIN_INLINE void _enable(void) { __asm__("sti"); } @@ -1112,50 +1112,50 @@ /*** Protected memory management ***/ -static __inline__ __attribute__((always_inline)) void __writecr0(const unsigned __int64 Data) +__INTRIN_INLINE void __writecr0(const unsigned __int64 Data) { __asm__("mov %[Data], %%cr0" : : [Data] "q" (Data) : "memory"); } -static __inline__ __attribute__((always_inline)) void __writecr3(const unsigned __int64 Data) +__INTRIN_INLINE void __writecr3(const unsigned __int64 Data) { __asm__("mov %[Data], %%cr3" : : [Data] "q" (Data) : "memory"); } -static __inline__ __attribute__((always_inline)) void __writecr4(const unsigned __int64 Data) +__INTRIN_INLINE void __writecr4(const unsigned __int64 Data) { __asm__("mov %[Data], %%cr4" : : [Data] "q" (Data) : "memory"); } #ifdef _M_AMD64 -static __inline__ __attribute__((always_inline)) void __writecr8(const unsigned __int64 Data) +__INTRIN_INLINE void __writecr8(const unsigned __int64 Data) { __asm__("mov %[Data], %%cr8" : : [Data] "q" (Data) : "memory"); } #endif -static __inline__ __attribute__((always_inline)) unsigned __int64 __readcr0(void) +__INTRIN_INLINE unsigned __int64 __readcr0(void) { unsigned __int64 value; __asm__ __volatile__("mov %%cr0, %[value]" : [value] "=q" (value)); return value; } -static __inline__ __attribute__((always_inline)) unsigned __int64 __readcr2(void) +__INTRIN_INLINE unsigned __int64 __readcr2(void) { unsigned __int64 value; __asm__ __volatile__("mov %%cr2, %[value]" : [value] "=q" (value)); return value; } -static __inline__ __attribute__((always_inline)) unsigned __int64 __readcr3(void) +__INTRIN_INLINE unsigned __int64 __readcr3(void) { unsigned __int64 value; __asm__ __volatile__("mov %%cr3, %[value]" : [value] "=q" (value)); return value; } -static __inline__ __attribute__((always_inline)) unsigned __int64 __readcr4(void) +__INTRIN_INLINE unsigned __int64 __readcr4(void) { unsigned __int64 value; __asm__ __volatile__("mov %%cr4, %[value]" : [value] "=q" (value)); @@ -1163,7 +1163,7 @@ } #ifdef _M_AMD64 -static __inline__ __attribute__((always_inline)) unsigned __int64 __readcr8(void) +__INTRIN_INLINE unsigned __int64 __readcr8(void) { unsigned __int64 value; __asm__ __volatile__("movq %%cr8, %q[value]" : [value] "=q" (value)); @@ -1172,7 +1172,7 @@ #endif #ifdef _M_AMD64 -static __inline__ __attribute__((always_inline)) unsigned __int64 __readdr(unsigned int reg) +__INTRIN_INLINE unsigned __int64 __readdr(unsigned int reg) { unsigned __int64 value; switch (reg) @@ -1205,7 +1205,7 @@ return value; } -static __inline__ __attribute__((always_inline)) void __writedr(unsigned reg, unsigned __int64 value) +__INTRIN_INLINE void __writedr(unsigned reg, unsigned __int64 value) { switch (reg) { @@ -1237,14 +1237,14 @@ } #endif -static __inline__ __attribute__((always_inline)) void __invlpg(void * const Address) +__INTRIN_INLINE void __invlpg(void * const Address) { __asm__("invlpg %[Address]" : : [Address] "m" (*((unsigned char *)(Address)))); } /*** System operations ***/ -static __inline__ __attribute__((always_inline)) unsigned long long __readmsr(const int reg) +__INTRIN_INLINE unsigned long long __readmsr(const int reg) { #ifdef _M_AMD64 unsigned long low, high; @@ -1257,7 +1257,7 @@ #endif } -static __inline__ __attribute__((always_inline)) void __writemsr(const unsigned long Register, const unsigned long long Value) +__INTRIN_INLINE void __writemsr(const unsigned long Register, const unsigned long long Value) { #ifdef _M_AMD64 __asm__ __volatile__("wrmsr" : : "a" (Value), "d" (Value >> 32), "c" (Register)); @@ -1266,7 +1266,7 @@ #endif } -static __inline__ __attribute__((always_inline)) unsigned long long __readpmc(const int counter) +__INTRIN_INLINE unsigned long long __readpmc(const int counter) { unsigned long long retval; __asm__ __volatile__("rdpmc" : "=A" (retval) : "c" (counter)); @@ -1274,29 +1274,29 @@ } /* NOTE: an immediate value for 'a' will raise an ICE in Visual C++ */ -static __inline__ __attribute__((always_inline)) unsigned long __segmentlimit(const unsigned long a) +__INTRIN_INLINE unsigned long __segmentlimit(const unsigned long a) { unsigned long retval; __asm__ __volatile__("lsl %[a], %[retval]" : [retval] "=r" (retval) : [a] "rm" (a)); return retval; } -static __inline__ __attribute__((always_inline)) void __wbinvd(void) +__INTRIN_INLINE void __wbinvd(void) { __asm__ __volatile__("wbinvd"); } -static __inline__ __attribute__((always_inline)) void __lidt(void *Source) +__INTRIN_INLINE void __lidt(void *Source) { __asm__ __volatile__("lidt %0" : : "m"(*(short*)Source)); } -static __inline__ __attribute__((always_inline)) void __sidt(void *Destination) +__INTRIN_INLINE void __sidt(void *Destination) { __asm__ __volatile__("sidt %0" : : "m"(*(short*)Destination) : "memory"); } -static __inline__ __attribute__((always_inline)) void _mm_pause(void) +__INTRIN_INLINE void _mm_pause(void) { __asm__ __volatile__("pause"); } Propchange: trunk/reactos/include/crt/msc/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Tue Jun 16 04:24:26 2009 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/include/crt/msc/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/include/crt/msc/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/include/crt/msc/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/include/crt/msc/intrin.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/msc/intrin.h?r…
============================================================================== --- trunk/reactos/include/crt/msc/intrin.h (added) +++ trunk/reactos/include/crt/msc/intrin.h [iso-8859-1] Tue Jun 16 04:24:26 2009 @@ -1,0 +1,188 @@ +#ifndef KJK_INTRIN_H_ +#define KJK_INTRIN_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/*** Stack frame juggling ***/ +void * _ReturnAddress(void); +void * _AddressOfReturnAddress(void); +unsigned int __getcallerseflags(void); + +/*** Atomic operations ***/ +void _ReadWriteBarrier(void); +void _ReadBarrier(void); +void _WriteBarrier(void); + +char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand); +short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand); +long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand); +void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand); +long _InterlockedExchange(volatile long * const Target, const long Value); +void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value); +long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value); +long _InterlockedExchangeAdd(volatile long * const Addend, const long Value); +char _InterlockedAnd8(volatile char * const value, const char mask); +short _InterlockedAnd16(volatile short * const value, const short mask); +long _InterlockedAnd(volatile long * const value, const long mask); +char _InterlockedOr8(volatile char * const value, const char mask); +short _InterlockedOr16(volatile short * const value, const short mask); +long _InterlockedOr(volatile long * const value, const long mask); +char _InterlockedXor8(volatile char * const value, const char mask); +short _InterlockedXor16(volatile short * const value, const short mask); +long _InterlockedXor(volatile long * const value, const long mask); +long _InterlockedAddLargeStatistic(volatile __int64 * const Addend, const long Value); +long _InterlockedDecrement(volatile long * const lpAddend); +long _InterlockedIncrement(volatile long * const lpAddend); +long _InterlockedDecrement16(volatile short * const lpAddend); +long _InterlockedIncrement16(volatile short * const lpAddend); +unsigned char _interlockedbittestandreset(volatile long * a, const long b); +unsigned char _interlockedbittestandset(volatile long * a, const long b); + +#if defined(_M_AMD64) +__int64 _InterlockedExchange64(volatile __int64 * const Target, const __int64 Value); +__int64 _InterlockedExchangeAdd64(volatile __int64 * const Addend, const __int64 Value); +long _InterlockedAnd64(volatile __int64 * const value, const __int64 mask); +long _InterlockedOr64(volatile __int64 * const value, const __int64 mask); +__int64 _InterlockedCompareExchange64(volatile __int64 * const Destination, const __int64 Exchange, const __int64 Comperand); +__int64 _InterlockedDecrement64(volatile __int64 * const lpAddend); +__int64 _InterlockedIncrement64(volatile __int64 * const lpAddend); +unsigned char _interlockedbittestandreset64(volatile __int64 * a, const __int64 b); +unsigned char _interlockedbittestandset64(volatile __int64 * a, const __int64 b); +#endif + +/*** String operations ***/ +void __stosb(unsigned char * Dest, const unsigned char Data, size_t Count); +void __stosw(unsigned short * Dest, const unsigned short Data, size_t Count); +void __stosd(unsigned long * Dest, const unsigned long Data, size_t Count); +void __movsb(unsigned char * Destination, const unsigned char * Source, size_t Count); +void __movsw(unsigned short * Destination, const unsigned short * Source, size_t Count); +void __movsd(unsigned long * Destination, const unsigned long * Source, size_t Count); + +#if defined(_M_AMD64) +/*** GS segment addressing ***/ +void __writegsbyte(const unsigned long Offset, const unsigned char Data); +void __writegsword(const unsigned long Offset, const unsigned short Data); +void __writegsdword(const unsigned long Offset, const unsigned long Data); +void __writegsqword(const unsigned long Offset, const unsigned __int64 Data); +unsigned char __readgsbyte(const unsigned long Offset); +unsigned short __readgsword(const unsigned long Offset); +unsigned long __readgsdword(const unsigned long Offset); +unsigned __int64 __readgsqword(const unsigned long Offset); +void __incgsbyte(const unsigned long Offset); +void __incgsword(const unsigned long Offset); +void __incgsdword(const unsigned long Offset); +void __addgsbyte(const unsigned long Offset, const unsigned char Data); +void __addgsword(const unsigned long Offset, const unsigned short Data); +void __addgsdword(const unsigned long Offset, const unsigned int Data); +void __addgsqword(const unsigned long Offset, const unsigned __int64 Data); +#endif + +#if defined(_M_IX86) +/*** FS segment addressing ***/ +void __writefsbyte(const unsigned long Offset, const unsigned char Data); +void __writefsword(const unsigned long Offset, const unsigned short Data); +void __writefsdword(const unsigned long Offset, const unsigned long Data); +unsigned char __readfsbyte(const unsigned long Offset); +unsigned short __readfsword(const unsigned long Offset); +unsigned long __readfsdword(const unsigned long Offset); +void __incfsbyte(const unsigned long Offset); +void __incfsword(const unsigned long Offset); +void __incfsdword(const unsigned long Offset); +void __addfsbyte(const unsigned long Offset, const unsigned char Data); +void __addfsword(const unsigned long Offset, const unsigned short Data); +void __addfsdword(const unsigned long Offset, const unsigned int Data) +#endif + + +/*** Bit manipulation ***/ +unsigned char _BitScanForward(unsigned long * const Index, const unsigned long Mask); +unsigned char _BitScanReverse(unsigned long * const Index, const unsigned long Mask); +unsigned char _bittest(const long * const a, const long b); +unsigned char _bittestandcomplement(long * const a, const long b); +unsigned char _bittestandreset(long * const a, const long b); +unsigned char _bittestandset(long * const a, const long b); +unsigned char _rotl8(unsigned char value, unsigned char shift); +unsigned short _rotl16(unsigned short value, unsigned char shift); +unsigned int _rotl(unsigned int value, int shift); +unsigned int _rotr(unsigned int value, int shift); +unsigned char _rotr8(unsigned char value, unsigned char shift); +unsigned short _rotr16(unsigned short value, unsigned char shift); +unsigned __int64 __ll_lshift(const unsigned __int64 Mask, const int Bit); +__int64 __ll_rshift(const __int64 Mask, const int Bit); +unsigned __int64 __ull_rshift(const unsigned __int64 Mask, int Bit); +unsigned short _byteswap_ushort(unsigned short value); +unsigned long _byteswap_ulong(unsigned long value); +unsigned __int64 _byteswap_uint64(unsigned __int64 value); + +/*** 64-bit math ***/ +__int64 __emul(const int a, const int b); +unsigned __int64 __emulu(const unsigned int a, const unsigned int b); + +/*** Port I/O ***/ +unsigned char __inbyte(const unsigned short Port); +unsigned short __inword(const unsigned short Port); +unsigned long __indword(const unsigned short Port); +void __inbytestring(unsigned short Port, unsigned char * Buffer, unsigned long Count); +void __inwordstring(unsigned short Port, unsigned short * Buffer, unsigned long Count); +void __indwordstring(unsigned short Port, unsigned long * Buffer, unsigned long Count); +void __outbyte(unsigned short const Port, const unsigned char Data); +void __outword(unsigned short const Port, const unsigned short Data); +void __outdword(unsigned short const Port, const unsigned long Data); +void __outbytestring(unsigned short const Port, const unsigned char * const Buffer, const unsigned long Count); +void __outwordstring(unsigned short const Port, const unsigned short * const Buffer, const unsigned long Count); +void __outdwordstring(unsigned short const Port, const unsigned long * const Buffer, const unsigned long Count); + +/*** System information ***/ +void __cpuid(int CPUInfo[], const int InfoType); +unsigned __int64 __rdtsc(void); +void __writeeflags(uintptr_t Value); +uintptr_t __readeflags(void); + +/*** Interrupts ***/ +void __debugbreak(void); +void __int2c(void); +void _disable(void); +void _enable(void); + +/*** Protected memory management ***/ +void __writecr0(const unsigned __int64 Data); +void __writecr3(const unsigned __int64 Data); +void __writecr4(const unsigned __int64 Data); + +#ifdef _M_AMD64 +void __writecr8(const unsigned __int64 Data); +#endif + +unsigned __int64 __readcr0(void); +unsigned __int64 __readcr2(void); +unsigned __int64 __readcr3(void); +unsigned __int64 __readcr4(void); + +#ifdef _M_AMD64 +unsigned __int64 __readcr8(void); +#endif + +unsigned __int64 __readdr(unsigned int reg); +void __writedr(unsigned reg, unsigned __int64 value); + +void __invlpg(void * const Address); + +/*** System operations ***/ +unsigned __int64 __readmsr(const int reg); +void __writemsr(const unsigned long Register, const unsigned __int64 Value); +unsigned __int64 __readpmc(const int counter); +unsigned long __segmentlimit(const unsigned long a); +void __wbinvd(void); +void __lidt(void *Source); +void __sidt(void *Destination); +void _mm_pause(void); + +#ifdef __cplusplus +} +#endif + +#endif /* KJK_INTRIN_H_ */ + +/* EOF */ Propchange: trunk/reactos/include/crt/msc/intrin.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/include/crt/stdio.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/stdio.h?rev=41…
============================================================================== --- trunk/reactos/include/crt/stdio.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/stdio.h [iso-8859-1] Tue Jun 16 04:24:26 2009 @@ -7,6 +7,9 @@ #define _INC_STDIO #include <crtdefs.h> + +#define __need___va_list +#include <stdarg.h> #pragma pack(push,_CRT_PACKING) Modified: trunk/reactos/include/crt/wchar.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/wchar.h?rev=41…
============================================================================== --- trunk/reactos/include/crt/wchar.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/wchar.h [iso-8859-1] Tue Jun 16 04:24:26 2009 @@ -7,6 +7,9 @@ #define _INC_WCHAR #include <crtdefs.h> + +#define __need___va_list +#include <stdarg.h> #pragma pack(push,_CRT_PACKING)
15 years, 5 months
1
0
0
0
[janderwald] 41420: - TerminateProcess requires a valid handle - Should fix 2 kernel32' winetests
by janderwald@svn.reactos.org
Author: janderwald Date: Tue Jun 16 02:16:49 2009 New Revision: 41420 URL:
http://svn.reactos.org/svn/reactos?rev=41420&view=rev
Log: - TerminateProcess requires a valid handle - Should fix 2 kernel32' winetests Modified: trunk/reactos/dll/win32/kernel32/process/proc.c Modified: trunk/reactos/dll/win32/kernel32/process/proc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/process…
============================================================================== --- trunk/reactos/dll/win32/kernel32/process/proc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/process/proc.c [iso-8859-1] Tue Jun 16 02:16:49 2009 @@ -605,6 +605,11 @@ { NTSTATUS Status; + if (hProcess == NULL) + { + return FALSE; + } + Status = NtTerminateProcess (hProcess, uExitCode); if (NT_SUCCESS(Status)) {
15 years, 5 months
1
0
0
0
[cwittich] 41419: fix warnings (untested)
by cwittich@svn.reactos.org
Author: cwittich Date: Mon Jun 15 19:04:56 2009 New Revision: 41419 URL:
http://svn.reactos.org/svn/reactos?rev=41419&view=rev
Log: fix warnings (untested) Modified: trunk/reactos/base/applications/paint/main.c trunk/reactos/base/applications/paint/registry.c trunk/reactos/base/applications/paint/registry.h trunk/reactos/base/applications/paint/winproc.c Modified: trunk/reactos/base/applications/paint/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/paint/ma…
============================================================================== --- trunk/reactos/base/applications/paint/main.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/paint/main.c [iso-8859-1] Mon Jun 15 19:04:56 2009 @@ -223,7 +223,7 @@ hCurPen = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_PEN)); hCurAirbrush = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_AIRBRUSH)); - HWND hLine = CreateWindowEx (0, _T("STATIC"), _T(""), WS_CHILD | WS_VISIBLE | SS_ETCHEDHORZ, 0, 0, 5000, 2, hwnd, NULL, hThisInstance, NULL); + CreateWindowEx (0, _T("STATIC"), _T(""), WS_CHILD | WS_VISIBLE | SS_ETCHEDHORZ, 0, 0, 5000, 2, hwnd, NULL, hThisInstance, NULL); // creating the 16 bitmap radio buttons and setting the bitmap Modified: trunk/reactos/base/applications/paint/registry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/paint/re…
============================================================================== --- trunk/reactos/base/applications/paint/registry.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/paint/registry.c [iso-8859-1] Mon Jun 15 19:04:56 2009 @@ -9,31 +9,30 @@ /* INCLUDES *********************************************************/ #include <windows.h> +#include <tchar.h> /* FUNCTIONS ********************************************************/ -void setWallpaper(char fname[], int style) +void SetWallpaper(TCHAR *FileName, DWORD dwStyle, DWORD dwTile) { - HKEY hkeycontrolpanel; - HKEY hkeydesktop; - RegOpenKeyEx(HKEY_CURRENT_USER, "Control Panel", 0, 0, hkeycontrolpanel); - RegOpenKeyEx(hkeycontrolpanel, "Desktop", 0, KEY_SET_VALUE, hkeydesktop); - RegSetValueEx(hkeydesktop, "Wallpaper", 0, REG_SZ, fname, sizeof(fname)); - switch (style) + HKEY hDesktop; + TCHAR szStyle[3], szTile[3]; + + if ((dwStyle > 2) || (dwTile > 2)) + return; + + if (RegOpenKeyEx(HKEY_CURRENT_USER, + _T("Control Panel\\Desktop"), 0, + KEY_READ | KEY_SET_VALUE, &hDesktop) == ERROR_SUCCESS) { - case 0: - RegSetValueEx(hkeydesktop, "WallpaperStyle", 0, REG_SZ, "2", 2); - RegSetValueEx(hkeydesktop, "TileWallpaper", 0, REG_SZ, "0", 2); - break; - case 1: - RegSetValueEx(hkeydesktop, "WallpaperStyle", 0, REG_SZ, "1", 2); - RegSetValueEx(hkeydesktop, "TileWallpaper", 0, REG_SZ, "0", 2); - break; - case 2: - RegSetValueEx(hkeydesktop, "WallpaperStyle", 0, REG_SZ, "1", 2); - RegSetValueEx(hkeydesktop, "TileWallpaper", 0, REG_SZ, "1", 2); - break; + RegSetValueEx(hDesktop, _T("Wallpaper"), 0, REG_SZ, (LPBYTE) FileName, _tcslen(FileName) * sizeof(TCHAR)); + + _stprintf(szStyle, _T("%i"), dwStyle); + _stprintf(szTile, _T("%i"), dwTile); + + RegSetValueEx(hDesktop, _T("WallpaperStyle"), 0, REG_SZ, (LPBYTE) szStyle, _tcslen(szStyle) * sizeof(TCHAR)); + RegSetValueEx(hDesktop, _T("TileWallpaper"), 0, REG_SZ, (LPBYTE) szTile, _tcslen(szTile) * sizeof(TCHAR)); + + RegCloseKey(hDesktop); } - RegCloseKey(hkeydesktop); - RegCloseKey(hkeycontrolpanel); } Modified: trunk/reactos/base/applications/paint/registry.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/paint/re…
============================================================================== --- trunk/reactos/base/applications/paint/registry.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/paint/registry.h [iso-8859-1] Mon Jun 15 19:04:56 2009 @@ -6,4 +6,4 @@ * PROGRAMMERS: Benedikt Freisen */ -void setWallpaper(char fname[], int style); +void SetWallpaper(TCHAR *szFileName, DWORD dwStyle, DWORD dwTile); Modified: trunk/reactos/base/applications/paint/winproc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/paint/wi…
============================================================================== --- trunk/reactos/base/applications/paint/winproc.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/paint/winproc.c [iso-8859-1] Mon Jun 15 19:04:56 2009 @@ -423,13 +423,13 @@ } break; case IDM_FILEASWALLPAPERPLANE: - setWallpaper(filepathname, 2); + SetWallpaper(filepathname, 1, 1); break; case IDM_FILEASWALLPAPERCENTERED: - setWallpaper(filepathname, 1); + SetWallpaper(filepathname, 1, 0); break; case IDM_FILEASWALLPAPERSTRETCHED: - setWallpaper(filepathname, 0); + SetWallpaper(filepathname, 2, 0); break; case IDM_EDITUNDO: undo();
15 years, 5 months
1
0
0
0
← Newer
1
...
27
28
29
30
31
32
33
...
50
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
48
49
50
Results per page:
10
25
50
100
200