ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
December 2005
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
40 participants
704 discussions
Start a n
N
ew thread
[greatlrd] 19866: wrote evecode.h directx header, for it is missing and it need for new sync of dxdiag.dll from wine.
by greatlrd@svn.reactos.com
wrote evecode.h directx header, for it is missing and it need for new sync of dxdiag.dll from wine. Added: trunk/reactos/w32api/include/evcode.h _____ Added: trunk/reactos/w32api/include/evcode.h --- trunk/reactos/w32api/include/evcode.h 2005-12-04 14:19:05 UTC (rev 19865) +++ trunk/reactos/w32api/include/evcode.h 2005-12-04 14:20:36 UTC (rev 19866) @@ -0,0 +1,46 @@ +#ifndef __EVCODE__ +#define __EVCODE__ + +#define EC_SYSTEMBASE 0x00 +#define EC_COMPLETE 0x01 +#define EC_USERABORT 0x02 +#define EC_ERRORABORT 0x03 +#define EC_TIME 0x04 +#define EC_REPAINT 0x05 +#define EC_STREAM_ERROR_STOPPED 0x06 +#define EC_STREAM_ERROR_STILLPLAYING 0x07 +#define EC_ERROR_STILLPLAYING 0x08 +#define EC_PALETTE_CHANGED 0x09 +#define EC_VIDEO_SIZE_CHANGED 0x0A +#define EC_QUALITY_CHANGE 0x0B +#define EC_SHUTTING_DOWN 0x0C +#define EC_CLOCK_CHANGED 0x0D +#define EC_PAUSED 0x0E +#define EC_OPENING_FILE 0x10 +#define EC_BUFFERING_DATA 0x11 +#define EC_FULLSCREEN_LOST 0x12 +#define EC_ACTIVATE 0x13 +#define EC_NEED_RESTART 0x14 +#define EC_WINDOW_DESTROYED 0x15 +#define EC_DISPLAY_CHANGED 0x16 +#define EC_STARVATION 0x17 +#define EC_OLE_EVENT 0x18 +#define EC_NOTIFY_WINDOW 0x19 +#define EC_STREAM_CONTROL_STOPPED 0x1A +#define EC_STREAM_CONTROL_STARTED 0x1B +#define EC_END_OF_SEGMENT 0x1C +#define EC_SEGMENT_STARTED 0x1D +#define EC_LENGTH_CHANGED 0x1E +#define EC_DEVICE_LOST 0x1F +#define EC_STEP_COMPLETE 0x24 +#define EC_SKIP_FRAMES 0x25 + +#define EC_TIMECODE_AVAILABLE 0x30 +#define EC_EXTDEVICE_MODE_CHANGE 0x31 +#define EC_GRAPH_CHANGED 0x50 +#define EC_CLOCK_UNSET 0x51 +#define EC_WMT_EVENT_BASE 0x0251 +#define EC_WMT_INDEX_EVENT EC_WMT_EVENT_BASE +#define EC_USER 0x8000 + +#endif \ No newline at end of file Property changes on: trunk/reactos/w32api/include/evcode.h ___________________________________________________________________ Name: svn:eol-style + native
19 years
1
0
0
0
[sgasiorek] 19865: updated listbox control from wine 0.9.2
by sgasiorek@svn.reactos.com
updated listbox control from wine 0.9.2 fixes 36 listbox tests Modified: trunk/reactos/lib/user32/controls/combo.c Modified: trunk/reactos/lib/user32/controls/listbox.c Modified: trunk/reactos/lib/user32/include/user32.h Modified: trunk/reactos/w32api/include/winuser.h _____ Modified: trunk/reactos/lib/user32/controls/combo.c --- trunk/reactos/lib/user32/controls/combo.c 2005-12-04 14:17:13 UTC (rev 19864) +++ trunk/reactos/lib/user32/controls/combo.c 2005-12-04 14:19:05 UTC (rev 19865) @@ -548,7 +548,7 @@ /* create listbox popup */ - lbeStyle = (LBS_NOTIFY | WS_BORDER | WS_CLIPSIBLINGS | WS_CHILD) | + lbeStyle = (LBS_NOTIFY | LBS_COMBOBOX | WS_BORDER | WS_CLIPSIBLINGS | WS_CHILD) | (style & (WS_VSCROLL | CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)); if( lphc->dwStyle & CBS_SORT ) _____ Modified: trunk/reactos/lib/user32/controls/listbox.c --- trunk/reactos/lib/user32/controls/listbox.c 2005-12-04 14:17:13 UTC (rev 19864) +++ trunk/reactos/lib/user32/controls/listbox.c 2005-12-04 14:19:05 UTC (rev 19865) @@ -34,7 +34,6 @@ #define WM_LBTRACKPOINT 0x0131 #define WS_EX_DRAGDETECT 0x00000002L #define WM_BEGINDRAG 0x022C -#define WM_SYSTIMER 280 UINT STDCALL SetSystemTimer(HWND,UINT_PTR,UINT,TIMERPROC); BOOL STDCALL KillSystemTimer(HWND,UINT_PTR); @@ -73,6 +72,7 @@ /* Listbox structure */ typedef struct { + HWND self; /* Our own window handle */ HWND owner; /* Owner window to send notifications to */ UINT style; /* Window style */ INT width; /* Window width */ @@ -90,6 +90,7 @@ INT horz_pos; /* Horizontal position */ INT nb_tabs; /* Number of tabs in array */ INT *tabs; /* Array of tabs */ + INT avg_char_width; /* Average width of characters */ BOOL caret_on; /* Is caret on? */ BOOL captured; /* Is mouse captured? */ BOOL in_focus; @@ -107,11 +108,12 @@ #define IS_MULTISELECT(descr) \ - ((descr)->style & LBS_MULTIPLESEL || ((descr)->style & LBS_EXTENDEDSEL)) + ((descr)->style & (LBS_MULTIPLESEL|LBS_EXTENDEDSEL) && \ + !((descr)->style & LBS_NOSEL)) -#define SEND_NOTIFICATION(hwnd,descr,code) \ +#define SEND_NOTIFICATION(descr,code) \ (SendMessageW( (descr)->owner, WM_COMMAND, \ - MAKEWPARAM( GetWindowLongA((hwnd),GWL_ID), (code)), (LPARAM)(hwnd) )) + MAKEWPARAM( GetWindowLongPtrW((descr->self),GWLP_ID), (code)), (LPARAM)(descr->self) )) #define ISWIN31 (LOWORD(GetVersion()) == 0x0a03) @@ -127,8 +129,6 @@ static TIMER_DIRECTION LISTBOX_Timer = LB_TIMER_NONE; -static LRESULT WINAPI ComboLBWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ); -static LRESULT WINAPI ComboLBWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ); static LRESULT WINAPI ListBoxWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ); static LRESULT WINAPI ListBoxWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ); @@ -167,16 +167,16 @@ #ifdef __REACTOS__ L"ComboLBox", /* name */ CS_DBLCLKS | CS_SAVEBITS, /* style */ - (WNDPROC)ComboLBWndProcW, /* procW */ - (WNDPROC)ComboLBWndProcA, /* procA */ + (WNDPROC)ListBoxWndProcW, /* procW */ + (WNDPROC)ListBoxWndProcA, /* procA */ sizeof(LB_DESCR *), /* extra */ (LPCWSTR) IDC_ARROW, /* cursor */ 0 /* brush */ #else "ComboLBox", /* name */ CS_DBLCLKS | CS_SAVEBITS, /* style */ - ComboLBWndProcA, /* procA */ - ComboLBWndProcW, /* procW */ + ListBoxWndProcA, /* procA */ + ListBoxWndProcW, /* procW */ sizeof(LB_DESCR *), /* extra */ IDC_ARROW, /* cursor */ 0 /* brush */ @@ -267,7 +267,7 @@ * Update the scrollbars. Should be called whenever the content * of the listbox changes. */ -static void LISTBOX_UpdateScroll( HWND hwnd, LB_DESCR *descr ) +static void LISTBOX_UpdateScroll( LB_DESCR *descr ) { SCROLLINFO info; @@ -300,11 +300,11 @@ if (descr->style & LBS_DISABLENOSCROLL) info.fMask |= SIF_DISABLENOSCROLL; if (descr->style & WS_HSCROLL) - SetScrollInfo( hwnd, SB_HORZ, &info, TRUE ); + SetScrollInfo( descr->self, SB_HORZ, &info, TRUE ); info.nMax = 0; info.fMask = SIF_RANGE; if (descr->style & WS_VSCROLL) - SetScrollInfo( hwnd, SB_VERT, &info, TRUE ); + SetScrollInfo( descr->self, SB_VERT, &info, TRUE ); } else { @@ -316,7 +316,7 @@ if (descr->style & LBS_DISABLENOSCROLL) info.fMask |= SIF_DISABLENOSCROLL; if (descr->style & WS_VSCROLL) - SetScrollInfo( hwnd, SB_VERT, &info, TRUE ); + SetScrollInfo( descr->self, SB_VERT, &info, TRUE ); if (descr->horz_extent) { @@ -328,7 +328,7 @@ if (descr->style & LBS_DISABLENOSCROLL) info.fMask |= SIF_DISABLENOSCROLL; if (descr->style & WS_HSCROLL) - SetScrollInfo( hwnd, SB_HORZ, &info, TRUE ); + SetScrollInfo( descr->self, SB_HORZ, &info, TRUE ); } } } @@ -339,7 +339,7 @@ * * Set the top item of the listbox, scrolling up or down if necessary. */ -static LRESULT LISTBOX_SetTopItem( HWND hwnd, LB_DESCR *descr, INT index, +static LRESULT LISTBOX_SetTopItem( LB_DESCR *descr, INT index, BOOL scroll ) { INT max = LISTBOX_GetMaxTopIndex( descr ); @@ -351,7 +351,7 @@ { INT diff = (descr->top_item - index) / descr->page_size * descr->column_width; if (scroll && (abs(diff) < descr->width)) - ScrollWindowEx( hwnd, diff, 0, NULL, NULL, 0, NULL, + ScrollWindowEx( descr->self, diff, 0, NULL, NULL, 0, NULL, SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN ); else @@ -379,14 +379,14 @@ diff = (descr->top_item - index) * descr->item_height; if (abs(diff) < descr->height) - ScrollWindowEx( hwnd, 0, diff, NULL, NULL, 0, NULL, + ScrollWindowEx( descr->self, 0, diff, NULL, NULL, 0, NULL, SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN ); else scroll = FALSE; } - if (!scroll) InvalidateRect( hwnd, NULL, TRUE ); + if (!scroll) InvalidateRect( descr->self, NULL, TRUE ); descr->top_item = index; - LISTBOX_UpdateScroll( hwnd, descr ); + LISTBOX_UpdateScroll( descr ); return LB_OKAY; } @@ -397,7 +397,7 @@ * Update the page size. Should be called when the size of * the client area or the item height changes. */ -static void LISTBOX_UpdatePage( HWND hwnd, LB_DESCR *descr ) +static void LISTBOX_UpdatePage( LB_DESCR *descr ) { INT page_size; @@ -406,8 +406,8 @@ if (page_size == descr->page_size) return; descr->page_size = page_size; if (descr->style & LBS_MULTICOLUMN) - InvalidateRect( hwnd, NULL, TRUE ); - LISTBOX_SetTopItem( hwnd, descr, descr->top_item, FALSE ); + InvalidateRect( descr->self, NULL, TRUE ); + LISTBOX_SetTopItem( descr, descr->top_item, FALSE ); } @@ -417,11 +417,11 @@ * Update the size of the listbox. Should be called when the size of * the client area changes. */ -static void LISTBOX_UpdateSize( HWND hwnd, LB_DESCR *descr ) +static void LISTBOX_UpdateSize( LB_DESCR *descr ) { RECT rect; - GetClientRect( hwnd, &rect ); + GetClientRect( descr->self, &rect ); descr->width = rect.right - rect.left; descr->height = rect.bottom - rect.top; if (!(descr->style & LBS_NOINTEGRALHEIGHT) && !(descr->style & LBS_OWNERDRAWVARIABLE)) @@ -429,7 +429,7 @@ INT remaining; RECT rect; - GetWindowRect( hwnd, &rect ); + GetWindowRect( descr->self, &rect ); if(descr->item_height != 0) remaining = descr->height % descr->item_height; else @@ -447,21 +447,21 @@ } #endif TRACE("[%p]: changing height %d -> %d\n", - hwnd, descr->height, descr->height - remaining ); - SetWindowPos( hwnd, 0, 0, 0, rect.right - rect.left, + descr->self, descr->height, descr->height - remaining ); + SetWindowPos( descr->self, 0, 0, 0, rect.right - rect.left, rect.bottom - rect.top - remaining, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE ); return; } } - TRACE("[%p]: new size = %d,%d\n", hwnd, descr->width, descr->height ); - LISTBOX_UpdatePage( hwnd, descr ); - LISTBOX_UpdateScroll( hwnd, descr ); + TRACE("[%p]: new size = %d,%d\n", descr->self, descr->width, descr->height ); + LISTBOX_UpdatePage( descr ); + LISTBOX_UpdateScroll( descr ); /* Invalidate the focused item so it will be repainted correctly */ if (LISTBOX_GetItemRect( descr, descr->focus_item, &rect ) == 1) { - InvalidateRect( hwnd, &rect, FALSE ); + InvalidateRect( descr->self, &rect, FALSE ); } } @@ -475,7 +475,12 @@ static LRESULT LISTBOX_GetItemRect( LB_DESCR *descr, INT index, RECT *rect ) { /* Index <= 0 is legal even on empty listboxes */ - if (index && (index >= descr->nb_items)) return -1; + if (index && (index >= descr->nb_items)) + { + memset(rect, 0, sizeof(*rect)); + SetLastError(ERROR_INVALID_INDEX); + return LB_ERR; + } SetRect( rect, 0, 0, descr->width, descr->height ); if (descr->style & LBS_MULTICOLUMN) { @@ -570,7 +575,7 @@ * * Paint an item. */ -static void LISTBOX_PaintItem( HWND hwnd, LB_DESCR *descr, HDC hdc, +static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect, INT index, UINT action, BOOL ignoreFocus ) { LB_ITEMDATA *item = NULL; @@ -581,7 +586,6 @@ DRAWITEMSTRUCT dis; RECT r; HRGN hrgn; - UINT id = GetWindowLongA( hwnd, GWL_ID ); if (!item) { @@ -596,14 +600,14 @@ drawing the item, *and* restore the previous region after they are done, so a region has better to exist else everything ends clipped */ - GetClientRect(hwnd, &r); + GetClientRect(descr->self, &r); hrgn = CreateRectRgnIndirect(&r); SelectClipRgn( hdc, hrgn); DeleteObject( hrgn ); dis.CtlType = ODT_LISTBOX; - dis.CtlID = id; - dis.hwndItem = hwnd; + dis.CtlID = GetWindowLongPtrW( descr->self, GWLP_ID ); + dis.hwndItem = descr->self; dis.itemAction = action; dis.hDC = hdc; dis.itemID = index; @@ -612,13 +616,13 @@ if (!ignoreFocus && (descr->focus_item == index) && (descr->caret_on) && (descr->in_focus)) dis.itemState |= ODS_FOCUS; - if (!IsWindowEnabled(hwnd)) dis.itemState |= ODS_DISABLED; + if (!IsWindowEnabled(descr->self)) dis.itemState |= ODS_DISABLED; dis.itemData = item ? item->data : 0; dis.rcItem = *rect; TRACE("[%p]: drawitem %d (%s) action=%02x state=%02x rect=%ld,%ld-%ld,%ld\n", - hwnd, index, item ? debugstr_w(item->str) : "", action, + descr->self, index, item ? debugstr_w(item->str) : "", action, dis.itemState, rect->left, rect->top, rect->right, rect->bottom ); - SendMessageW(descr->owner, WM_DRAWITEM, id, (LPARAM)&dis); + SendMessageW(descr->owner, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis); } else { @@ -636,7 +640,7 @@ } TRACE("[%p]: painting %d (%s) action=%02x rect=%ld,%ld-%ld,%ld\n", - hwnd, index, item ? debugstr_w(item->str) : "", action, + descr->self, index, item ? debugstr_w(item->str) : "", action, rect->left, rect->top, rect->right, rect->bottom ); if (!item) ExtTextOutW( hdc, rect->left + 1, rect->top, @@ -671,7 +675,7 @@ * * Change the redraw flag. */ -static void LISTBOX_SetRedraw( HWND hwnd, LB_DESCR *descr, BOOL on ) +static void LISTBOX_SetRedraw( LB_DESCR *descr, BOOL on ) { if (on) { @@ -679,7 +683,7 @@ descr->style &= ~LBS_NOREDRAW; if (descr->style & LBS_DISPLAYCHANGED) { /* page was changed while setredraw false, refresh automatically */ - InvalidateRect(hwnd, NULL, TRUE); + InvalidateRect(descr->self, NULL, TRUE); if ((descr->top_item + descr->page_size) > descr->nb_items) { /* reset top of page if less than number of items/page */ descr->top_item = descr->nb_items - descr->page_size; @@ -687,7 +691,7 @@ } descr->style &= ~LBS_DISPLAYCHANGED; } - LISTBOX_UpdateScroll( hwnd, descr ); + LISTBOX_UpdateScroll( descr ); } else descr->style |= LBS_NOREDRAW; } @@ -698,7 +702,7 @@ * * Repaint a single item synchronously. */ -static void LISTBOX_RepaintItem( HWND hwnd, LB_DESCR *descr, INT index, +static void LISTBOX_RepaintItem( LB_DESCR *descr, INT index, UINT action ) { HDC hdc; @@ -707,32 +711,32 @@ HBRUSH hbrush, oldBrush = 0; /* Do not repaint the item if the item is not visible */ - if (!IsWindowVisible(hwnd)) return; + if (!IsWindowVisible(descr->self)) return; if (descr->style & LBS_NOREDRAW) { descr->style |= LBS_DISPLAYCHANGED; return; } if (LISTBOX_GetItemRect( descr, index, &rect ) != 1) return; - if (!(hdc = GetDCEx( hwnd, 0, DCX_CACHE ))) return; + if (!(hdc = GetDCEx( descr->self, 0, DCX_CACHE ))) return; if (descr->font) oldFont = SelectObject( hdc, descr->font ); hbrush = (HBRUSH)SendMessageW( descr->owner, WM_CTLCOLORLISTBOX, - (WPARAM)hdc, (LPARAM)hwnd ); + (WPARAM)hdc, (LPARAM)descr->self ); if (hbrush) oldBrush = SelectObject( hdc, hbrush ); - if (!IsWindowEnabled(hwnd)) + if (!IsWindowEnabled(descr->self)) SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) ); SetWindowOrgEx( hdc, descr->horz_pos, 0, NULL ); - LISTBOX_PaintItem( hwnd, descr, hdc, &rect, index, action, FALSE ); + LISTBOX_PaintItem( descr, hdc, &rect, index, action, FALSE ); if (oldFont) SelectObject( hdc, oldFont ); if (oldBrush) SelectObject( hdc, oldBrush ); - ReleaseDC( hwnd, hdc ); + ReleaseDC( descr->self, hdc ); } /*********************************************************************** * LISTBOX_InitStorage */ -static LRESULT LISTBOX_InitStorage( HWND hwnd, LB_DESCR *descr, INT nb_items ) +static LRESULT LISTBOX_InitStorage( LB_DESCR *descr, INT nb_items ) { LB_ITEMDATA *item; @@ -750,7 +754,7 @@ if (!item) { - SEND_NOTIFICATION( hwnd, descr, LBN_ERRSPACE ); + SEND_NOTIFICATION( descr, LBN_ERRSPACE ); return LB_ERRSPACE; } descr->items = item; @@ -761,19 +765,25 @@ /*********************************************************************** * LISTBOX_SetTabStops */ -static BOOL LISTBOX_SetTabStops( HWND hwnd, LB_DESCR *descr, INT count, +static BOOL LISTBOX_SetTabStops( LB_DESCR *descr, INT count, LPINT tabs, BOOL short_ints ) { - if (!(descr->style & LBS_USETABSTOPS)) return TRUE; - if (descr->tabs) HeapFree( GetProcessHeap(), 0, descr->tabs ); + INT i; + + if (!(descr->style & LBS_USETABSTOPS)) + { + SetLastError(ERROR_LB_WITHOUT_TABSTOPS); + return FALSE; + } + + HeapFree( GetProcessHeap(), 0, descr->tabs ); if (!(descr->nb_tabs = count)) { descr->tabs = NULL; return TRUE; } - /* FIXME: count = 1 */ - if (!(descr->tabs = (INT *)HeapAlloc( GetProcessHeap(), 0, - descr->nb_tabs * sizeof(INT) ))) + if (!(descr->tabs = HeapAlloc( GetProcessHeap(), 0, + descr->nb_tabs * sizeof(INT) ))) return FALSE; #ifndef __REACTOS__ if (short_ints) @@ -792,7 +802,11 @@ #else memcpy( descr->tabs, tabs, descr->nb_tabs * sizeof(INT) ); #endif - /* FIXME: repaint the window? */ + + /* convert into "dialog units"*/ + for (i = 0; i < descr->nb_tabs; i++) + descr->tabs[i] = MulDiv(descr->tabs[i], descr->avg_char_width, 4); + return TRUE; } @@ -800,34 +814,53 @@ /*********************************************************************** * LISTBOX_GetText */ -static LRESULT LISTBOX_GetText( LB_DESCR *descr, INT index, LPARAM lParam, BOOL unicode ) +static LRESULT LISTBOX_GetText( LB_DESCR *descr, INT index, LPWSTR buffer, BOOL unicode ) { - if ((index < 0) || (index >= descr->nb_items)) return LB_ERR; + if ((index < 0) || (index >= descr->nb_items)) + { + SetLastError(ERROR_INVALID_INDEX); + return LB_ERR; + } if (HAS_STRINGS(descr)) { - if (!lParam) - return strlenW(descr->items[index].str); + if (!buffer) + { + DWORD len = strlenW(descr->items[index].str); + if( unicode ) + return len; + return WideCharToMultiByte( CP_ACP, 0, descr->items[index].str, len, + NULL, 0, NULL, NULL ); + } TRACE("index %d (0x%04x) %s\n", index, index, debugstr_w(descr->items[index].str)); if(unicode) { - LPWSTR buffer = (LPWSTR)lParam; strcpyW( buffer, descr->items[index].str ); return strlenW(buffer); } else { - LPSTR buffer = (LPSTR)lParam; - return WideCharToMultiByte(CP_ACP, 0, descr->items[index].str, -1, buffer, 0x7FFFFFFF, NULL, NULL) - 1; + return WideCharToMultiByte(CP_ACP, 0, descr->items[index].str, -1, (LPSTR)buffer, 0x7FFFFFFF, NULL, NULL) - 1; } } else { - if (lParam) - *((LPDWORD)lParam)=*(LPDWORD)(&descr->items[index].data); + if (buffer) + *((LPDWORD)buffer)=*(LPDWORD)(&descr->items[index].data); return sizeof(DWORD); } } +static inline INT LISTBOX_lstrcmpiW( LCID lcid, LPCWSTR str1, LPCWSTR str2 ) +{ + INT ret = CompareStringW( lcid, NORM_IGNORECASE, str1, -1, str2, -1 ); + if (ret == CSTR_LESS_THAN) + return -1; + if (ret == CSTR_EQUAL) + return 0; + if (ret == CSTR_GREATER_THAN) + return 1; + return -1; +} /*********************************************************************** * LISTBOX_FindStringPos @@ -835,8 +868,7 @@ * Find the nearest string located before a given string in sort order. * If 'exact' is TRUE, return an error if we don't get an exact match. */ -static INT LISTBOX_FindStringPos( HWND hwnd, LB_DESCR *descr, LPCWSTR str, - BOOL exact ) +static INT LISTBOX_FindStringPos( LB_DESCR *descr, LPCWSTR str, BOOL exact ) { INT index, min, max, res = -1; @@ -847,15 +879,15 @@ { index = (min + max) / 2; if (HAS_STRINGS(descr)) - res = lstrcmpiW( str, descr->items[index].str); + res = LISTBOX_lstrcmpiW( descr->locale, str, descr->items[index].str); else { COMPAREITEMSTRUCT cis; - UINT id = GetWindowLongA( hwnd, GWL_ID ); + UINT id = (UINT)GetWindowLongPtrW( descr->self, GWLP_ID ); cis.CtlType = ODT_LISTBOX; cis.CtlID = id; - cis.hwndItem = hwnd; + cis.hwndItem = descr->self; /* note that some application (MetaStock) expects the second item * to be in the listbox */ cis.itemID1 = -1; @@ -872,19 +904,18 @@ return exact ? -1 : max; } - /*********************************************************************** * LISTBOX_FindFileStrPos * * Find the nearest string located before a given string in directory * sort order (i.e. first files, then directories, then drives). */ -static INT LISTBOX_FindFileStrPos( HWND hwnd, LB_DESCR *descr, LPCWSTR str ) +static INT LISTBOX_FindFileStrPos( LB_DESCR *descr, LPCWSTR str ) { INT min, max, res = -1; if (!HAS_STRINGS(descr)) - return LISTBOX_FindStringPos( hwnd, descr, str, FALSE ); + return LISTBOX_FindStringPos( descr, str, FALSE ); min = 0; max = descr->nb_items; while (min != max) @@ -902,13 +933,13 @@ else /* directory */ { if (str[1] == '-') res = 1; - else res = lstrcmpiW( str, p ); + else res = LISTBOX_lstrcmpiW( descr->locale, str, p ); } } else /* filename */ { if (*str == '[') res = 1; - else res = lstrcmpiW( str, p ); + else res = LISTBOX_lstrcmpiW( descr->locale, str, p ); } if (!res) return index; if (res < 0) max = index; @@ -923,8 +954,7 @@ * * Find the item beginning with a given string. */ -static INT LISTBOX_FindString( HWND hwnd, LB_DESCR *descr, INT start, - LPCWSTR str, BOOL exact ) +static INT LISTBOX_FindString( LB_DESCR *descr, INT start, LPCWSTR str, BOOL exact ) { INT i; LB_ITEMDATA *item; @@ -937,9 +967,9 @@ if (exact) { for (i = start + 1; i < descr->nb_items; i++, item++) - if (!lstrcmpiW( str, item->str )) return i; + if (!LISTBOX_lstrcmpiW( descr->locale, str, item->str )) return i; for (i = 0, item = descr->items; i <= start; i++, item++) - if (!lstrcmpiW( str, item->str )) return i; + if (!LISTBOX_lstrcmpiW( descr->locale, str, item->str )) return i; } else { @@ -970,13 +1000,13 @@ { if (exact && (descr->style & LBS_SORT)) /* If sorted, use a WM_COMPAREITEM binary search */ - return LISTBOX_FindStringPos( hwnd, descr, str, TRUE ); + return LISTBOX_FindStringPos( descr, str, TRUE ); /* Otherwise use a linear search */ for (i = start + 1; i < descr->nb_items; i++, item++) - if (item->data == (DWORD)str) return i; + if (item->data == (ULONG_PTR)str) return i; for (i = 0, item = descr->items; i <= start; i++, item++) - if (item->data == (DWORD)str) return i; + if (item->data == (ULONG_PTR)str) return i; } return LB_ERR; } @@ -990,7 +1020,9 @@ INT i, count; LB_ITEMDATA *item = descr->items; - if (!(descr->style & LBS_MULTIPLESEL)) return LB_ERR; + if (!(descr->style & LBS_MULTIPLESEL) || + (descr->style & LBS_NOSEL)) + return LB_ERR; for (i = count = 0; i < descr->nb_items; i++, item++) if (item->selected) count++; return count; @@ -1032,7 +1064,7 @@ /*********************************************************************** * LISTBOX_Paint */ -static LRESULT LISTBOX_Paint( HWND hwnd, LB_DESCR *descr, HDC hdc ) +static LRESULT LISTBOX_Paint( LB_DESCR *descr, HDC hdc ) { INT i, col_pos = descr->page_size - 1; RECT rect; @@ -1053,16 +1085,18 @@ if (descr->font) oldFont = SelectObject( hdc, descr->font ); hbrush = (HBRUSH)SendMessageW( descr->owner, WM_CTLCOLORLISTBOX, - (WPARAM)hdc, (LPARAM)hwnd ); + (WPARAM)hdc, (LPARAM)descr->self ); if (hbrush) oldBrush = SelectObject( hdc, hbrush ); - if (!IsWindowEnabled(hwnd)) SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) ); + if (!IsWindowEnabled(descr->self)) SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) ); if (!descr->nb_items && (descr->focus_item != -1) && descr->caret_on && (descr->in_focus)) { /* Special case for empty listbox: paint focus rect */ rect.bottom = rect.top + descr->item_height; - LISTBOX_PaintItem( hwnd, descr, hdc, &rect, descr->focus_item, + ExtTextOutW( hdc, 0, 0, ETO_OPAQUE | ETO_CLIPPED, + &rect, NULL, 0, NULL ); + LISTBOX_PaintItem( descr, hdc, &rect, descr->focus_item, ODA_FOCUS, FALSE ); rect.top = rect.bottom; } @@ -1085,7 +1119,7 @@ focusRect.top = rect.top; focusRect.bottom = rect.bottom; } - LISTBOX_PaintItem( hwnd, descr, hdc, &rect, i, ODA_DRAWENTIRE, TRUE ); + LISTBOX_PaintItem( descr, hdc, &rect, i, ODA_DRAWENTIRE, TRUE ); rect.top = rect.bottom; if ((descr->style & LBS_MULTICOLUMN) && !col_pos) @@ -1115,8 +1149,9 @@ } /* Paint the focus item now */ - if (focusRect.top != focusRect.bottom && descr->caret_on) - LISTBOX_PaintItem( hwnd, descr, hdc, &focusRect, descr->focus_item, ODA_FOCUS, FALSE ); + if (focusRect.top != focusRect.bottom && + descr->caret_on && descr->in_focus) + LISTBOX_PaintItem( descr, hdc, &focusRect, descr->focus_item, ODA_FOCUS, FALSE ); if (!IS_OWNERDRAW(descr)) { @@ -1149,7 +1184,7 @@ * Invalidate all items from a given item. If the specified item is not * visible, nothing happens. */ -static void LISTBOX_InvalidateItems( HWND hwnd, LB_DESCR *descr, INT index ) +static void LISTBOX_InvalidateItems( LB_DESCR *descr, INT index ) { RECT rect; @@ -1161,24 +1196,24 @@ return; } rect.bottom = descr->height; - InvalidateRect( hwnd, &rect, TRUE ); + InvalidateRect( descr->self, &rect, TRUE ); if (descr->style & LBS_MULTICOLUMN) { /* Repaint the other columns */ rect.left = rect.right; rect.right = descr->width; rect.top = 0; - InvalidateRect( hwnd, &rect, TRUE ); + InvalidateRect( descr->self, &rect, TRUE ); } } } -static void LISTBOX_InvalidateItemRect( HWND hwnd, LB_DESCR *descr, INT index ) +static void LISTBOX_InvalidateItemRect( LB_DESCR *descr, INT index ) { RECT rect; if (LISTBOX_GetItemRect( descr, index, &rect ) == 1) - InvalidateRect( hwnd, &rect, TRUE ); + InvalidateRect( descr->self, &rect, TRUE ); } /*********************************************************************** @@ -1188,7 +1223,11 @@ { if (descr->style & LBS_OWNERDRAWVARIABLE) { - if ((index < 0) || (index >= descr->nb_items)) return LB_ERR; + if ((index < 0) || (index >= descr->nb_items)) + { + SetLastError(ERROR_INVALID_INDEX); + return LB_ERR; + } return descr->items[index].height; } else return descr->item_height; @@ -1198,28 +1237,32 @@ /*********************************************************************** * LISTBOX_SetItemHeight */ -static LRESULT LISTBOX_SetItemHeight( HWND hwnd, LB_DESCR *descr, INT index, +static LRESULT LISTBOX_SetItemHeight( LB_DESCR *descr, INT index, INT height, BOOL repaint ) { if (!height) height = 1; if (descr->style & LBS_OWNERDRAWVARIABLE) { - if ((index < 0) || (index >= descr->nb_items)) return LB_ERR; - TRACE("[%p]: item %d height = %d\n", hwnd, index, height ); + if ((index < 0) || (index >= descr->nb_items)) + { + SetLastError(ERROR_INVALID_INDEX); + return LB_ERR; + } + TRACE("[%p]: item %d height = %d\n", descr->self, index, height ); descr->items[index].height = height; - LISTBOX_UpdateScroll( hwnd, descr ); + LISTBOX_UpdateScroll( descr ); if (repaint) - LISTBOX_InvalidateItems( hwnd, descr, index ); + LISTBOX_InvalidateItems( descr, index ); } else if (height != descr->item_height) { - TRACE("[%p]: new height = %d\n", hwnd, height ); + TRACE("[%p]: new height = %d\n", descr->self, height ); descr->item_height = height; - LISTBOX_UpdatePage( hwnd, descr ); - LISTBOX_UpdateScroll( hwnd, descr ); + LISTBOX_UpdatePage( descr ); + LISTBOX_UpdateScroll( descr ); if (repaint) - InvalidateRect( hwnd, 0, TRUE ); + InvalidateRect( descr->self, 0, TRUE ); } return LB_OKAY; } @@ -1228,7 +1271,7 @@ /*********************************************************************** * LISTBOX_SetHorizontalPos */ -static void LISTBOX_SetHorizontalPos( HWND hwnd, LB_DESCR *descr, INT pos ) +static void LISTBOX_SetHorizontalPos( LB_DESCR *descr, INT pos ) { INT diff; @@ -1236,39 +1279,39 @@ pos = descr->horz_extent - descr->width; if (pos < 0) pos = 0; if (!(diff = descr->horz_pos - pos)) return; - TRACE("[%p]: new horz pos = %d\n", hwnd, pos ); + TRACE("[%p]: new horz pos = %d\n", descr->self, pos ); descr->horz_pos = pos; - LISTBOX_UpdateScroll( hwnd, descr ); + LISTBOX_UpdateScroll( descr ); if (abs(diff) < descr->width) { RECT rect; /* Invalidate the focused item so it will be repainted correctly */ if (LISTBOX_GetItemRect( descr, descr->focus_item, &rect ) == 1) - InvalidateRect( hwnd, &rect, TRUE ); - ScrollWindowEx( hwnd, diff, 0, NULL, NULL, 0, NULL, + InvalidateRect( descr->self, &rect, TRUE ); + ScrollWindowEx( descr->self, diff, 0, NULL, NULL, 0, NULL, SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN ); } else - InvalidateRect( hwnd, NULL, TRUE ); + InvalidateRect( descr->self, NULL, TRUE ); } /*********************************************************************** * LISTBOX_SetHorizontalExtent */ -static LRESULT LISTBOX_SetHorizontalExtent( HWND hwnd, LB_DESCR *descr, +static LRESULT LISTBOX_SetHorizontalExtent( LB_DESCR *descr, INT extent ) { if (!descr->horz_extent || (descr->style & LBS_MULTICOLUMN)) return LB_OKAY; if (extent <= 0) extent = 1; if (extent == descr->horz_extent) return LB_OKAY; - TRACE("[%p]: new horz extent = %d\n", hwnd, extent ); + TRACE("[%p]: new horz extent = %d\n", descr->self, extent ); descr->horz_extent = extent; if (descr->horz_pos > extent - descr->width) - LISTBOX_SetHorizontalPos( hwnd, descr, extent - descr->width ); + LISTBOX_SetHorizontalPos( descr, extent - descr->width ); else - LISTBOX_UpdateScroll( hwnd, descr ); + LISTBOX_UpdateScroll( descr ); return LB_OKAY; } @@ -1276,12 +1319,12 @@ /*********************************************************************** * LISTBOX_SetColumnWidth */ -static LRESULT LISTBOX_SetColumnWidth( HWND hwnd, LB_DESCR *descr, INT width) +static LRESULT LISTBOX_SetColumnWidth( LB_DESCR *descr, INT width) { if (width == descr->column_width) return LB_OKAY; - TRACE("[%p]: new column width = %d\n", hwnd, width ); + TRACE("[%p]: new column width = %d\n", descr->self, width ); descr->column_width = width; - LISTBOX_UpdatePage( hwnd, descr ); + LISTBOX_UpdatePage( descr ); return LB_OKAY; } @@ -1291,26 +1334,29 @@ * * Returns the item height. */ -static INT LISTBOX_SetFont( HWND hwnd, LB_DESCR *descr, HFONT font ) +static INT LISTBOX_SetFont( LB_DESCR *descr, HFONT font ) { HDC hdc; HFONT oldFont = 0; - TEXTMETRICW tm; + const char *alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + SIZE sz; descr->font = font; - if (!(hdc = GetDCEx( hwnd, 0, DCX_CACHE ))) + if (!(hdc = GetDCEx( descr->self, 0, DCX_CACHE ))) { ERR("unable to get DC.\n" ); return 16; } if (font) oldFont = SelectObject( hdc, font ); - GetTextMetricsW( hdc, &tm ); + GetTextExtentPointA( hdc, alphabet, 52, &sz); if (oldFont) SelectObject( hdc, oldFont ); - ReleaseDC( hwnd, hdc ); + ReleaseDC( descr->self, hdc ); + + descr->avg_char_width = (sz.cx / 26 + 1) / 2; if (!IS_OWNERDRAW(descr)) - LISTBOX_SetItemHeight( hwnd, descr, 0, tm.tmHeight, FALSE ); - return tm.tmHeight ; + LISTBOX_SetItemHeight( descr, 0, sz.cy, FALSE ); + return sz.cy; } @@ -1319,7 +1365,7 @@ * * Make sure that a given item is partially or fully visible. */ -static void LISTBOX_MakeItemVisible( HWND hwnd, LB_DESCR *descr, INT index, +static void LISTBOX_MakeItemVisible( LB_DESCR *descr, INT index, BOOL fully ) { INT top; @@ -1347,7 +1393,7 @@ (descr->height > (descr->page_size * descr->item_height))) return; top = index - descr->page_size + 1; } - LISTBOX_SetTopItem( hwnd, descr, top, TRUE ); + LISTBOX_SetTopItem( descr, top, TRUE ); } /*********************************************************************** @@ -1357,7 +1403,7 @@ * index must be between 0 and descr->nb_items-1, or LB_ERR is returned. * */ -static LRESULT LISTBOX_SetCaretIndex( HWND hwnd, LB_DESCR *descr, INT index, +static LRESULT LISTBOX_SetCaretIndex( LB_DESCR *descr, INT index, BOOL fully_visible ) { INT oldfocus = descr->focus_item; @@ -1367,11 +1413,11 @@ if (index == oldfocus) return LB_OKAY; descr->focus_item = index; if ((oldfocus != -1) && descr->caret_on && (descr->in_focus)) - LISTBOX_RepaintItem( hwnd, descr, oldfocus, ODA_FOCUS ); + LISTBOX_RepaintItem( descr, oldfocus, ODA_FOCUS ); - LISTBOX_MakeItemVisible( hwnd, descr, index, fully_visible ); + LISTBOX_MakeItemVisible( descr, index, fully_visible ); if (descr->caret_on && (descr->in_focus)) - LISTBOX_RepaintItem( hwnd, descr, index, ODA_FOCUS ); + LISTBOX_RepaintItem( descr, index, ODA_FOCUS ); return LB_OKAY; } @@ -1382,7 +1428,7 @@ * * Select a range of items. Should only be used on a MULTIPLESEL listbox. */ -static LRESULT LISTBOX_SelectItemRange( HWND hwnd, LB_DESCR *descr, INT first, +static LRESULT LISTBOX_SelectItemRange( LB_DESCR *descr, INT first, INT last, BOOL on ) { INT i; @@ -1395,8 +1441,6 @@ if (last == -1) last = descr->nb_items - 1; if ((first < 0) || (first >= descr->nb_items)) return LB_ERR; if ((last < 0) || (last >= descr->nb_items)) return LB_ERR; - /* selected_item reflects last selected/unselected item on multiple sel */ - descr->selected_item = last; if (on) /* Turn selection on */ { @@ -1404,9 +1448,8 @@ { if (descr->items[i].selected) continue; descr->items[i].selected = TRUE; - LISTBOX_InvalidateItemRect(hwnd, descr, i); + LISTBOX_InvalidateItemRect(descr, i); } - LISTBOX_SetCaretIndex( hwnd, descr, last, TRUE ); } else /* Turn selection off */ { @@ -1414,7 +1457,7 @@ { if (!descr->items[i].selected) continue; descr->items[i].selected = FALSE; - LISTBOX_InvalidateItemRect(hwnd, descr, i); + LISTBOX_InvalidateItemRect(descr, i); } } return LB_OKAY; @@ -1423,19 +1466,23 @@ /*********************************************************************** * LISTBOX_SetSelection */ -static LRESULT LISTBOX_SetSelection( HWND hwnd, LB_DESCR *descr, INT index, +static LRESULT LISTBOX_SetSelection( LB_DESCR *descr, INT index, BOOL on, BOOL send_notify ) { TRACE( "index=%d notify=%s\n", index, send_notify ? "YES" : "NO" ); - if (descr->style & LBS_NOSEL) return LB_ERR; + if (descr->style & LBS_NOSEL) + { + descr->selected_item = index; + return LB_ERR; + } if ((index < -1) || (index >= descr->nb_items)) return LB_ERR; if (descr->style & LBS_MULTIPLESEL) { if (index == -1) /* Select all items */ - return LISTBOX_SelectItemRange( hwnd, descr, 0, -1, on ); + return LISTBOX_SelectItemRange( descr, 0, -1, on ); else /* Only one item */ - return LISTBOX_SelectItemRange( hwnd, descr, index, index, on ); + return LISTBOX_SelectItemRange( descr, index, index, on ); } else { @@ -1444,9 +1491,9 @@ if (oldsel != -1) descr->items[oldsel].selected = FALSE; if (index != -1) descr->items[index].selected = TRUE; descr->selected_item = index; - if (oldsel != -1) LISTBOX_RepaintItem( hwnd, descr, oldsel, ODA_SELECT ); - if (index != -1) LISTBOX_RepaintItem( hwnd, descr, index, ODA_SELECT ); - if (send_notify && descr->nb_items) SEND_NOTIFICATION( hwnd, descr, + if (oldsel != -1) LISTBOX_RepaintItem( descr, oldsel, ODA_SELECT ); + if (index != -1) LISTBOX_RepaintItem( descr, index, ODA_SELECT ); + if (send_notify && descr->nb_items) SEND_NOTIFICATION( descr, (index != -1) ? LBN_SELCHANGE : LBN_SELCANCEL ); else if( descr->lphc ) /* set selection change flag for parent combo */ @@ -1461,7 +1508,7 @@ * * Change the caret position and extend the selection to the new caret. [truncated at 1000 lines; 1662 more skipped]
19 years
1
0
0
0
[weiden] 19864: added missing constants
by weiden@svn.reactos.com
added missing constants Modified: trunk/reactos/lib/devmgr/misc.c Modified: trunk/reactos/w32api/include/ddk/cfg.h _____ Modified: trunk/reactos/lib/devmgr/misc.c --- trunk/reactos/lib/devmgr/misc.c 2005-12-04 13:02:17 UTC (rev 19863) +++ trunk/reactos/lib/devmgr/misc.c 2005-12-04 14:17:13 UTC (rev 19864) @@ -401,7 +401,7 @@ } -static const UINT ProblemStringId[] = +static const UINT ProblemStringId[NUM_CM_PROB] = { IDS_DEV_NO_PROBLEM, IDS_DEV_NOT_CONFIGURED, _____ Modified: trunk/reactos/w32api/include/ddk/cfg.h --- trunk/reactos/w32api/include/ddk/cfg.h 2005-12-04 13:02:17 UTC (rev 19863) +++ trunk/reactos/w32api/include/ddk/cfg.h 2005-12-04 14:17:13 UTC (rev 19864) @@ -80,6 +80,8 @@ #define CM_PROB_HELD_FOR_EJECT 0x0000002F #define CM_PROB_DRIVER_BLOCKED 0x00000030 #define CM_PROB_REGISTRY_TOO_LARGE 0x00000031 +#define CM_PROB_SETPROPERTIES_FAILED 0x00000032 +#define NUM_CM_PROB 0x00000033 #define LCPRI_FORCECONFIG 0x00000000 #define LCPRI_BOOTCONFIG 0x00000001
19 years
1
0
0
0
[weiden] 19863: SVN maintainance: set eol-style to native
by weiden@svn.reactos.com
SVN maintainance: set eol-style to native Modified: trunk/reactos/w32api/include/activecf.h Modified: trunk/reactos/w32api/include/amaudio.h Modified: trunk/reactos/w32api/include/amparse.h Modified: trunk/reactos/w32api/include/audevcod.h Modified: trunk/reactos/w32api/include/dv.h Modified: trunk/reactos/w32api/include/dvdevcod.h Modified: trunk/reactos/w32api/include/mediaerr.h Property changes on: trunk/reactos/ReactOS-ppc.xml ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c ___________________________________________________________________ Name: svn:eol-style + native _____ Modified: trunk/reactos/w32api/include/activecf.h --- trunk/reactos/w32api/include/activecf.h 2005-12-04 12:56:16 UTC (rev 19862) +++ trunk/reactos/w32api/include/activecf.h 2005-12-04 13:02:17 UTC (rev 19863) @@ -1,13 +1,13 @@ - -#ifndef __ACTIVECF__ -#define __ACTIVECF__ - -#define CFSTR_VFW_FILTERLIST "Video for Windows 4 Filters" - -typedef struct tagVFW_FILTERLIST -{ - UINT cFilters; - CLSID aClsId[1]; -} VFW_FILTERLIST; - + +#ifndef __ACTIVECF__ +#define __ACTIVECF__ + +#define CFSTR_VFW_FILTERLIST "Video for Windows 4 Filters" + +typedef struct tagVFW_FILTERLIST +{ + UINT cFilters; + CLSID aClsId[1]; +} VFW_FILTERLIST; + #endif \ No newline at end of file Property changes on: trunk/reactos/w32api/include/activecf.h ___________________________________________________________________ Name: svn:eol-style + native _____ Modified: trunk/reactos/w32api/include/amaudio.h --- trunk/reactos/w32api/include/amaudio.h 2005-12-04 12:56:16 UTC (rev 19862) +++ trunk/reactos/w32api/include/amaudio.h 2005-12-04 13:02:17 UTC (rev 19863) @@ -1,34 +1,34 @@ -#ifndef __AMAUDIO__ -#define __AMAUDIO__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include <mmsystem.h> -#include <dsound.h> - -#undef INTERFACE -#define INTERFACE IAMDirectSound - -DECLARE_INTERFACE_(IAMDirectSound,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(GetDirectSoundInterface)(THIS_ LPDIRECTSOUND *lplpds) PURE; - STDMETHOD(GetPrimaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER *lplpdsb) PURE; - STDMETHOD(GetSecondaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER *lplpdsb) PURE; - STDMETHOD(ReleaseDirectSoundInterface)(THIS_ LPDIRECTSOUND lpds) PURE; - STDMETHOD(ReleasePrimaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER lpdsb) PURE; - STDMETHOD(ReleaseSecondaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER lpdsb) PURE; - STDMETHOD(SetFocusWindow)(THIS_ HWND, BOOL) PURE ; - STDMETHOD(GetFocusWindow)(THIS_ HWND *, BOOL*) PURE ; -}; - - -#ifdef __cplusplus -} -#endif -#endif - +#ifndef __AMAUDIO__ +#define __AMAUDIO__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <mmsystem.h> +#include <dsound.h> + +#undef INTERFACE +#define INTERFACE IAMDirectSound + +DECLARE_INTERFACE_(IAMDirectSound,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(GetDirectSoundInterface)(THIS_ LPDIRECTSOUND *lplpds) PURE; + STDMETHOD(GetPrimaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER *lplpdsb) PURE; + STDMETHOD(GetSecondaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER *lplpdsb) PURE; + STDMETHOD(ReleaseDirectSoundInterface)(THIS_ LPDIRECTSOUND lpds) PURE; + STDMETHOD(ReleasePrimaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER lpdsb) PURE; + STDMETHOD(ReleaseSecondaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER lpdsb) PURE; + STDMETHOD(SetFocusWindow)(THIS_ HWND, BOOL) PURE ; + STDMETHOD(GetFocusWindow)(THIS_ HWND *, BOOL*) PURE ; +}; + + +#ifdef __cplusplus +} +#endif +#endif + Property changes on: trunk/reactos/w32api/include/amaudio.h ___________________________________________________________________ Name: svn:eol-style + native _____ Modified: trunk/reactos/w32api/include/amparse.h --- trunk/reactos/w32api/include/amparse.h 2005-12-04 12:56:16 UTC (rev 19862) +++ trunk/reactos/w32api/include/amparse.h 2005-12-04 13:02:17 UTC (rev 19863) @@ -1,20 +1,20 @@ - -#ifndef __AMPARSE__ -#define __AMPARSE__ - -#ifdef __cplusplus -extern "C" { -#endif - -DECLARE_INTERFACE_(IAMParse, IUnknown) -{ - STDMETHOD(GetParseTime) (THIS_REFERENCE_TIME *prtCurrent) PURE; - STDMETHOD(SetParseTime) (THIS_REFERENCE_TIME rtCurrent) PURE; - STDMETHOD(Flush) (THIS) PURE; -}; - -DEFINE_GUID(IID_IAMParse, 0xC47A3420, 0x005C, 0x11D2, 0x90, 0x38, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x98); -#ifdef __cplusplus -} -#endif -#endif + +#ifndef __AMPARSE__ +#define __AMPARSE__ + +#ifdef __cplusplus +extern "C" { +#endif + +DECLARE_INTERFACE_(IAMParse, IUnknown) +{ + STDMETHOD(GetParseTime) (THIS_REFERENCE_TIME *prtCurrent) PURE; + STDMETHOD(SetParseTime) (THIS_REFERENCE_TIME rtCurrent) PURE; + STDMETHOD(Flush) (THIS) PURE; +}; + +DEFINE_GUID(IID_IAMParse, 0xC47A3420, 0x005C, 0x11D2, 0x90, 0x38, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x98); +#ifdef __cplusplus +} +#endif +#endif Property changes on: trunk/reactos/w32api/include/amparse.h ___________________________________________________________________ Name: svn:eol-style + native _____ Modified: trunk/reactos/w32api/include/audevcod.h --- trunk/reactos/w32api/include/audevcod.h 2005-12-04 12:56:16 UTC (rev 19862) +++ trunk/reactos/w32api/include/audevcod.h 2005-12-04 13:02:17 UTC (rev 19863) @@ -1,28 +1,28 @@ - -#ifndef __AUDEVCOD__ -#define __AUDEVCOD__ - -#define EC_SND_DEVICE_ERROR_BASE 0x0200 -#define EC_SNDDEV_IN_ERROR (EC_SND_DEVICE_ERROR_BASE + 0x00) -#define EC_SNDDEV_OUT_ERROR (EC_SND_DEVICE_ERROR_BASE + 0x01) - -typedef enum _tagSND_DEVICE_ERROR -{ - - SNDDEV_ERROR_Open =1, - SNDDEV_ERROR_Close =2, - SNDDEV_ERROR_GetCaps =3, - SNDDEV_ERROR_PrepareHeader =4, - SNDDEV_ERROR_UnprepareHeader =5, - SNDDEV_ERROR_Reset =6, - SNDDEV_ERROR_Restart =7, - SNDDEV_ERROR_GetPosition =8, - SNDDEV_ERROR_Write =9, - SNDDEV_ERROR_Pause =10, - SNDDEV_ERROR_Stop =11, - SNDDEV_ERROR_Start =12, - SNDDEV_ERROR_AddBuffer =13, - SNDDEV_ERROR_Query =14 - -} SNDDEV_ERR; -#endif // __AUDEVCOD__ + +#ifndef __AUDEVCOD__ +#define __AUDEVCOD__ + +#define EC_SND_DEVICE_ERROR_BASE 0x0200 +#define EC_SNDDEV_IN_ERROR (EC_SND_DEVICE_ERROR_BASE + 0x00) +#define EC_SNDDEV_OUT_ERROR (EC_SND_DEVICE_ERROR_BASE + 0x01) + +typedef enum _tagSND_DEVICE_ERROR +{ + + SNDDEV_ERROR_Open =1, + SNDDEV_ERROR_Close =2, + SNDDEV_ERROR_GetCaps =3, + SNDDEV_ERROR_PrepareHeader =4, + SNDDEV_ERROR_UnprepareHeader =5, + SNDDEV_ERROR_Reset =6, + SNDDEV_ERROR_Restart =7, + SNDDEV_ERROR_GetPosition =8, + SNDDEV_ERROR_Write =9, + SNDDEV_ERROR_Pause =10, + SNDDEV_ERROR_Stop =11, + SNDDEV_ERROR_Start =12, + SNDDEV_ERROR_AddBuffer =13, + SNDDEV_ERROR_Query =14 + +} SNDDEV_ERR; +#endif // __AUDEVCOD__ Property changes on: trunk/reactos/w32api/include/audevcod.h ___________________________________________________________________ Name: svn:eol-style + native _____ Modified: trunk/reactos/w32api/include/dv.h --- trunk/reactos/w32api/include/dv.h 2005-12-04 12:56:16 UTC (rev 19862) +++ trunk/reactos/w32api/include/dv.h 2005-12-04 13:02:17 UTC (rev 19863) @@ -1,32 +1,32 @@ - -#ifndef _DV_H_ -#define _DV_H_ - -typedef struct Tag_DVAudInfo -{ - BYTE bAudStyle[2]; - BYTE bAudQu[2]; - BYTE bNumAudPin; - WORD wAvgSamplesPerPinPerFrm[2]; - WORD wBlkMode; - WORD wDIFMode; - WORD wBlkDiv; -} DVAudInfo; - -#define DV_SD 0x00 -#define DV_HD 0x01 -#define DV_SL 0x02 -#define DV_CAP_AUD16Bits 0x00 -#define DV_CAP_AUD12Bits 0x01 -#define SIZE_DVINFO 0x20 -#define DV_DVSD_NTSC_FRAMESIZE 120000L -#define DV_DVSD_PAL_FRAMESIZE 144000L -#define DV_AUDIOMODE 0x00000F00 -#define DV_SMCHN 0x0000E000 -#define DV_STYPE 0x001F0000 -#define DV_NTSCPAL 0x00200000 -#define DV_AUDIOQU 0x07000000 -#define DV_AUDIOSMP 0x38000000 -#define DV_NTSC 0 -#define DV_PAL 1 -#endif + +#ifndef _DV_H_ +#define _DV_H_ + +typedef struct Tag_DVAudInfo +{ + BYTE bAudStyle[2]; + BYTE bAudQu[2]; + BYTE bNumAudPin; + WORD wAvgSamplesPerPinPerFrm[2]; + WORD wBlkMode; + WORD wDIFMode; + WORD wBlkDiv; +} DVAudInfo; + +#define DV_SD 0x00 +#define DV_HD 0x01 +#define DV_SL 0x02 +#define DV_CAP_AUD16Bits 0x00 +#define DV_CAP_AUD12Bits 0x01 +#define SIZE_DVINFO 0x20 +#define DV_DVSD_NTSC_FRAMESIZE 120000L +#define DV_DVSD_PAL_FRAMESIZE 144000L +#define DV_AUDIOMODE 0x00000F00 +#define DV_SMCHN 0x0000E000 +#define DV_STYPE 0x001F0000 +#define DV_NTSCPAL 0x00200000 +#define DV_AUDIOQU 0x07000000 +#define DV_AUDIOSMP 0x38000000 +#define DV_NTSC 0 +#define DV_PAL 1 +#endif Property changes on: trunk/reactos/w32api/include/dv.h ___________________________________________________________________ Name: svn:eol-style + native _____ Modified: trunk/reactos/w32api/include/dvdevcod.h --- trunk/reactos/w32api/include/dvdevcod.h 2005-12-04 12:56:16 UTC (rev 19862) +++ trunk/reactos/w32api/include/dvdevcod.h 2005-12-04 13:02:17 UTC (rev 19863) @@ -1,60 +1,60 @@ - -#ifndef __DVDEVCOD__ -#define __DVDEVCOD__ - -#define EC_DVDBASE 0x0100 -#define EC_DVD_DOMAIN_CHANGE (EC_DVDBASE + 0x01) -#define EC_DVD_TITLE_CHANGE (EC_DVDBASE + 0x02) -#define EC_DVD_CHAPTER_START (EC_DVDBASE + 0x03) -#define EC_DVD_AUDIO_STREAM_CHANGE (EC_DVDBASE + 0x04) -#define EC_DVD_SUBPICTURE_STREAM_CHANGE (EC_DVDBASE + 0x05) -#define EC_DVD_ANGLE_CHANGE (EC_DVDBASE + 0x06) -#define EC_DVD_BUTTON_CHANGE (EC_DVDBASE + 0x07) -#define EC_DVD_VALID_UOPS_CHANGE (EC_DVDBASE + 0x08) -#define EC_DVD_STILL_ON (EC_DVDBASE + 0x09) -#define EC_DVD_STILL_OFF (EC_DVDBASE + 0x0A) -#define EC_DVD_CURRENT_TIME (EC_DVDBASE + 0x0B) -#define EC_DVD_ERROR (EC_DVDBASE + 0x0C) -#define EC_DVD_WARNING (EC_DVDBASE + 0x0D) -#define EC_DVD_CHAPTER_AUTOSTOP (EC_DVDBASE + 0x0E) -#define EC_DVD_NO_FP_PGC (EC_DVDBASE + 0x0F) -#define EC_DVD_PLAYBACK_RATE_CHANGE (EC_DVDBASE + 0x10) -#define EC_DVD_PARENTAL_LEVEL_CHANGE (EC_DVDBASE + 0x11) -#define EC_DVD_PLAYBACK_STOPPED (EC_DVDBASE + 0x12) -#define EC_DVD_ANGLES_AVAILABLE (EC_DVDBASE + 0x13) -#define EC_DVD_PLAYPERIOD_AUTOSTOP (EC_DVDBASE + 0x14) -#define EC_DVD_BUTTON_AUTO_ACTIVATED (EC_DVDBASE + 0x15) -#define EC_DVD_CMD_START (EC_DVDBASE + 0x16) -#define EC_DVD_CMD_END (EC_DVDBASE + 0x17) -#define EC_DVD_DISC_EJECTED (EC_DVDBASE + 0x18) -#define EC_DVD_DISC_INSERTED (EC_DVDBASE + 0x19) -#define EC_DVD_CURRENT_HMSF_TIME (EC_DVDBASE + 0x1A) -#define EC_DVD_KARAOKE_MODE (EC_DVDBASE + 0x1B) - - -#ifndef EXCLUDE_DVDEVCODE_ENUMS -typedef enum _tagDVD_WARNING -{ - DVD_WARNING_InvalidDVD1_0Disc =1, - DVD_WARNING_FormatNotSupported =2, - DVD_WARNING_IllegalNavCommand =3, - DVD_WARNING_Open =4, - DVD_WARNING_Seek =5, - DVD_WARNING_Read =6 -} DVD_WARNING; - -typedef enum _tagDVD_ERROR -{ - DVD_ERROR_Unexpected =1, - DVD_ERROR_CopyProtectFail =2, - DVD_ERROR_InvalidDVD1_0Disc =3, - DVD_ERROR_InvalidDiscRegion =4, - DVD_ERROR_LowParentalLevel =5, - DVD_ERROR_MacrovisionFail =6, - DVD_ERROR_IncompatibleSystemAndDecoderRegions =7, - DVD_ERROR_IncompatibleDiscAndDecoderRegions =8 - -} DVD_ERROR; - -#endif -#endif + +#ifndef __DVDEVCOD__ +#define __DVDEVCOD__ + +#define EC_DVDBASE 0x0100 +#define EC_DVD_DOMAIN_CHANGE (EC_DVDBASE + 0x01) +#define EC_DVD_TITLE_CHANGE (EC_DVDBASE + 0x02) +#define EC_DVD_CHAPTER_START (EC_DVDBASE + 0x03) +#define EC_DVD_AUDIO_STREAM_CHANGE (EC_DVDBASE + 0x04) +#define EC_DVD_SUBPICTURE_STREAM_CHANGE (EC_DVDBASE + 0x05) +#define EC_DVD_ANGLE_CHANGE (EC_DVDBASE + 0x06) +#define EC_DVD_BUTTON_CHANGE (EC_DVDBASE + 0x07) +#define EC_DVD_VALID_UOPS_CHANGE (EC_DVDBASE + 0x08) +#define EC_DVD_STILL_ON (EC_DVDBASE + 0x09) +#define EC_DVD_STILL_OFF (EC_DVDBASE + 0x0A) +#define EC_DVD_CURRENT_TIME (EC_DVDBASE + 0x0B) +#define EC_DVD_ERROR (EC_DVDBASE + 0x0C) +#define EC_DVD_WARNING (EC_DVDBASE + 0x0D) +#define EC_DVD_CHAPTER_AUTOSTOP (EC_DVDBASE + 0x0E) +#define EC_DVD_NO_FP_PGC (EC_DVDBASE + 0x0F) +#define EC_DVD_PLAYBACK_RATE_CHANGE (EC_DVDBASE + 0x10) +#define EC_DVD_PARENTAL_LEVEL_CHANGE (EC_DVDBASE + 0x11) +#define EC_DVD_PLAYBACK_STOPPED (EC_DVDBASE + 0x12) +#define EC_DVD_ANGLES_AVAILABLE (EC_DVDBASE + 0x13) +#define EC_DVD_PLAYPERIOD_AUTOSTOP (EC_DVDBASE + 0x14) +#define EC_DVD_BUTTON_AUTO_ACTIVATED (EC_DVDBASE + 0x15) +#define EC_DVD_CMD_START (EC_DVDBASE + 0x16) +#define EC_DVD_CMD_END (EC_DVDBASE + 0x17) +#define EC_DVD_DISC_EJECTED (EC_DVDBASE + 0x18) +#define EC_DVD_DISC_INSERTED (EC_DVDBASE + 0x19) +#define EC_DVD_CURRENT_HMSF_TIME (EC_DVDBASE + 0x1A) +#define EC_DVD_KARAOKE_MODE (EC_DVDBASE + 0x1B) + + +#ifndef EXCLUDE_DVDEVCODE_ENUMS +typedef enum _tagDVD_WARNING +{ + DVD_WARNING_InvalidDVD1_0Disc =1, + DVD_WARNING_FormatNotSupported =2, + DVD_WARNING_IllegalNavCommand =3, + DVD_WARNING_Open =4, + DVD_WARNING_Seek =5, + DVD_WARNING_Read =6 +} DVD_WARNING; + +typedef enum _tagDVD_ERROR +{ + DVD_ERROR_Unexpected =1, + DVD_ERROR_CopyProtectFail =2, + DVD_ERROR_InvalidDVD1_0Disc =3, + DVD_ERROR_InvalidDiscRegion =4, + DVD_ERROR_LowParentalLevel =5, + DVD_ERROR_MacrovisionFail =6, + DVD_ERROR_IncompatibleSystemAndDecoderRegions =7, + DVD_ERROR_IncompatibleDiscAndDecoderRegions =8 + +} DVD_ERROR; + +#endif +#endif Property changes on: trunk/reactos/w32api/include/dvdevcod.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/reactos/w32api/include/errors.h ___________________________________________________________________ Name: svn:eol-style + native _____ Modified: trunk/reactos/w32api/include/mediaerr.h --- trunk/reactos/w32api/include/mediaerr.h 2005-12-04 12:56:16 UTC (rev 19862) +++ trunk/reactos/w32api/include/mediaerr.h 2005-12-04 13:02:17 UTC (rev 19863) @@ -1,11 +1,11 @@ -#ifndef _MEDIAERR_H_ -#define _MEDIAERR_H_ - -#define DMO_E_INVALIDSTREAMINDEX 0x80040201 -#define DMO_E_INVALIDTYPE 0x80040202 -#define DMO_E_TYPE_NOT_SET 0x80040203 -#define DMO_E_NOTACCEPTING 0x80040204 -#define DMO_E_TYPE_NOT_ACCEPTED 0x80040205 -#define DMO_E_NO_MORE_ITEMS 0x80040206 - -#endif _MEDIAERR_H_ +#ifndef _MEDIAERR_H_ +#define _MEDIAERR_H_ + +#define DMO_E_INVALIDSTREAMINDEX 0x80040201 +#define DMO_E_INVALIDTYPE 0x80040202 +#define DMO_E_TYPE_NOT_SET 0x80040203 +#define DMO_E_NOTACCEPTING 0x80040204 +#define DMO_E_TYPE_NOT_ACCEPTED 0x80040205 +#define DMO_E_NO_MORE_ITEMS 0x80040206 + +#endif _MEDIAERR_H_ Property changes on: trunk/reactos/w32api/include/mediaerr.h ___________________________________________________________________ Name: svn:eol-style + native
19 years
1
0
0
0
[greatlrd] 19862: wrote errors.h directx header, for it is missing and it need for new sync of dxdiag.dll from wine.
by greatlrd@svn.reactos.com
wrote errors.h directx header, for it is missing and it need for new sync of dxdiag.dll from wine. Added: trunk/reactos/w32api/include/errors.h _____ Added: trunk/reactos/w32api/include/errors.h
19 years
1
0
0
0
[greatlrd] 19861: adding missing dx headers
by greatlrd@svn.reactos.com
adding missing dx headers Added: trunk/reactos/w32api/include/mediaerr.h _____ Added: trunk/reactos/w32api/include/mediaerr.h --- trunk/reactos/w32api/include/mediaerr.h 2005-12-04 12:41:54 UTC (rev 19860) +++ trunk/reactos/w32api/include/mediaerr.h 2005-12-04 12:47:31 UTC (rev 19861) @@ -0,0 +1,11 @@ +#ifndef _MEDIAERR_H_ +#define _MEDIAERR_H_ + +#define DMO_E_INVALIDSTREAMINDEX 0x80040201 +#define DMO_E_INVALIDTYPE 0x80040202 +#define DMO_E_TYPE_NOT_SET 0x80040203 +#define DMO_E_NOTACCEPTING 0x80040204 +#define DMO_E_TYPE_NOT_ACCEPTED 0x80040205 +#define DMO_E_NO_MORE_ITEMS 0x80040206 + +#endif _MEDIAERR_H_
19 years
1
0
0
0
[greatlrd] 19860: adding dvdevcod.h and fix a compiling issue with new dxdiag.dll on my hd
by greatlrd@svn.reactos.com
adding dvdevcod.h and fix a compiling issue with new dxdiag.dll on my hd Modified: trunk/reactos/w32api/include/amvideo.h Added: trunk/reactos/w32api/include/dvdevcod.h Modified: trunk/reactos/w32api/include/dxdiag.h _____ Modified: trunk/reactos/w32api/include/amvideo.h --- trunk/reactos/w32api/include/amvideo.h 2005-12-04 12:31:46 UTC (rev 19859) +++ trunk/reactos/w32api/include/amvideo.h 2005-12-04 12:41:54 UTC (rev 19860) @@ -106,8 +106,8 @@ #define DIBSIZE(BI) ((BI).biHeight < 0 ? (-1)*(_DIBSIZE(BI)) : _DIBSIZE(BI)) #define BIT_MASKS_MATCH(PBMIH1,PBMIH2) \ - ((PBMIH2)->dwBitMasks[iGREEN] == (PBMIH1)->dwBitMasks[iGREEN]) && \ - (((PBMIH2)->dwBitMasks[iRED] == (PBMIH1)->dwBitMasks[iRED]) && \ + ((PBMIH2)->dwBitMasks[iGREEN] == (PBMIH1)->dwBitMasks[iGREEN]) && \ + (((PBMIH2)->dwBitMasks[iRED] == (PBMIH1)->dwBitMasks[iRED]) && \ ((PBMIH2)->dwBitMasks[iBLUE] == (PBMIH1)->dwBitMasks[iBLUE])) #define RESET_MASKS(PBMIH) (ZeroMemory((PVOID)(PBMIH)->dwBitFields,SIZE_MASKS)) @@ -257,3 +257,4 @@ } #endif #endif + _____ Added: trunk/reactos/w32api/include/dvdevcod.h --- trunk/reactos/w32api/include/dvdevcod.h 2005-12-04 12:31:46 UTC (rev 19859) +++ trunk/reactos/w32api/include/dvdevcod.h 2005-12-04 12:41:54 UTC (rev 19860) @@ -0,0 +1,60 @@ + +#ifndef __DVDEVCOD__ +#define __DVDEVCOD__ + +#define EC_DVDBASE 0x0100 +#define EC_DVD_DOMAIN_CHANGE (EC_DVDBASE + 0x01) +#define EC_DVD_TITLE_CHANGE (EC_DVDBASE + 0x02) +#define EC_DVD_CHAPTER_START (EC_DVDBASE + 0x03) +#define EC_DVD_AUDIO_STREAM_CHANGE (EC_DVDBASE + 0x04) +#define EC_DVD_SUBPICTURE_STREAM_CHANGE (EC_DVDBASE + 0x05) +#define EC_DVD_ANGLE_CHANGE (EC_DVDBASE + 0x06) +#define EC_DVD_BUTTON_CHANGE (EC_DVDBASE + 0x07) +#define EC_DVD_VALID_UOPS_CHANGE (EC_DVDBASE + 0x08) +#define EC_DVD_STILL_ON (EC_DVDBASE + 0x09) +#define EC_DVD_STILL_OFF (EC_DVDBASE + 0x0A) +#define EC_DVD_CURRENT_TIME (EC_DVDBASE + 0x0B) +#define EC_DVD_ERROR (EC_DVDBASE + 0x0C) +#define EC_DVD_WARNING (EC_DVDBASE + 0x0D) +#define EC_DVD_CHAPTER_AUTOSTOP (EC_DVDBASE + 0x0E) +#define EC_DVD_NO_FP_PGC (EC_DVDBASE + 0x0F) +#define EC_DVD_PLAYBACK_RATE_CHANGE (EC_DVDBASE + 0x10) +#define EC_DVD_PARENTAL_LEVEL_CHANGE (EC_DVDBASE + 0x11) +#define EC_DVD_PLAYBACK_STOPPED (EC_DVDBASE + 0x12) +#define EC_DVD_ANGLES_AVAILABLE (EC_DVDBASE + 0x13) +#define EC_DVD_PLAYPERIOD_AUTOSTOP (EC_DVDBASE + 0x14) +#define EC_DVD_BUTTON_AUTO_ACTIVATED (EC_DVDBASE + 0x15) +#define EC_DVD_CMD_START (EC_DVDBASE + 0x16) +#define EC_DVD_CMD_END (EC_DVDBASE + 0x17) +#define EC_DVD_DISC_EJECTED (EC_DVDBASE + 0x18) +#define EC_DVD_DISC_INSERTED (EC_DVDBASE + 0x19) +#define EC_DVD_CURRENT_HMSF_TIME (EC_DVDBASE + 0x1A) +#define EC_DVD_KARAOKE_MODE (EC_DVDBASE + 0x1B) + + +#ifndef EXCLUDE_DVDEVCODE_ENUMS +typedef enum _tagDVD_WARNING +{ + DVD_WARNING_InvalidDVD1_0Disc =1, + DVD_WARNING_FormatNotSupported =2, + DVD_WARNING_IllegalNavCommand =3, + DVD_WARNING_Open =4, + DVD_WARNING_Seek =5, + DVD_WARNING_Read =6 +} DVD_WARNING; + +typedef enum _tagDVD_ERROR +{ + DVD_ERROR_Unexpected =1, + DVD_ERROR_CopyProtectFail =2, + DVD_ERROR_InvalidDVD1_0Disc =3, + DVD_ERROR_InvalidDiscRegion =4, + DVD_ERROR_LowParentalLevel =5, + DVD_ERROR_MacrovisionFail =6, + DVD_ERROR_IncompatibleSystemAndDecoderRegions =7, + DVD_ERROR_IncompatibleDiscAndDecoderRegions =8 + +} DVD_ERROR; + +#endif +#endif _____ Modified: trunk/reactos/w32api/include/dxdiag.h --- trunk/reactos/w32api/include/dxdiag.h 2005-12-04 12:31:46 UTC (rev 19859) +++ trunk/reactos/w32api/include/dxdiag.h 2005-12-04 12:41:54 UTC (rev 19860) @@ -61,46 +61,10 @@ DEFINE_GUID(IID_IDxDiagContainer, 0x7D0F462F, 0x4064, 0x4862, 0xBC, 0x7F, 0x93, 0x3E, 0x50, 0x58, 0xC1, 0x0F); /* typedef definitions */ -//typedef struct IDxDiagProvider IDxDiagProvider, *LPDXDIAGPROVIDER, *PDXDIAGPROVIDER; -//typedef struct IDxDiagContainer IDxDiagContainer, *LPDXDIAGCONTAINER, *PDXDIAGCONTAINER; -typedef struct IDxDiagProvider *LPDXDIAGPROVIDER, *PDXDIAGPROVIDER; -typedef struct IDxDiagContainer *LPDXDIAGCONTAINER, *PDXDIAGCONTAINER; +typedef struct IDxDiagProvider *LPDXDIAGPROVIDER, *PDXDIAGPROVIDER; +typedef struct IDxDiagContainer *LPDXDIAGCONTAINER, *PDXDIAGCONTAINER; /*********************************************************************** ****** - * IDxDiagProvider interface - */ -#define INTERFACE IDxDiagProvider -DECLARE_INTERFACE_(IDxDiagProvider,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDxDiagProvider methods ***/ - STDMETHOD(Initialize)(THIS_ DXDIAG_INIT_PARAMS* pParams) PURE; - STDMETHOD(GetRootContainer)(THIS_ LPDXDIAGCONTAINER* ppInstance) PURE; -}; -#undef INTERFACE - -#if !defined(__cplusplus) || defined(CINTERFACE) -/*** IUnknown methods ***/ -#define IDxDiagProvider_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDxDiagProvider_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDxDiagProvider_Release(p) (p)->lpVtbl->Release(p) -/*** IDxDiagProvider methods ***/ -#define IDxDiagProvider_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDxDiagProvider_GetRootContainer(p,a) (p)->lpVtbl->GetRootContainer(p,a) -#else -/*** IUnknown methods ***/ -#define IDxDiagProvider_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDxDiagProvider_AddRef(p) (p)->AddRef() -#define IDxDiagProvider_Release(p) (p)->Release() -/*** IDxDiagProvider methods ***/ -#define IDxDiagProvider_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDxDiagProvider_GetRootContainer(p,a) (p)->GetRootContainer(a) -#endif - -/********************************************************************** ******* * IDxDiagContainer interface */ #ifdef __WINESRC__ @@ -134,7 +98,7 @@ #define IDxDiagContainer_EnumChildContainerNames(p,a,b,c) (p)->lpVtbl->EnumChildContainerNames(p,a,b,c) #define IDxDiagContainer_GetChildContainer(p,a,b) (p)->lpVtbl->GetChildContainer(p,a,b) #define IDxDiagContainer_GetNumberOfProps(p,a) (p)->lpVtbl->GetNumberOfProps(p,a) -#define IDxDiagContainer_EnumProps(p,a,b) (p)->lpVtbl->EnumProps(p,a,b,c) +#define IDxDiagContainer_EnumPropNames(p,a,b,c) (p)->lpVtbl->EnumPropNames(p,a,b,c) #define IDxDiagContainer_GetProp(p,a,b) (p)->lpVtbl->GetProp(p,a,b) #else /*** IUnknown methods ***/ @@ -146,10 +110,44 @@ #define IDxDiagContainer_EnumChildContainerNames(p,a,b,c) (p)->EnumChildContainerNames(a,b,c) #define IDxDiagContainer_GetChildContainer(p,a,b) (p)->GetChildContainer(a,b) #define IDxDiagContainer_GetNumberOfProps(p,a) (p)->GetNumberOfProps(a) -#define IDxDiagContainer_EnumProps(p,a,b) (p)->EnumProps(a,b,c) +#define IDxDiagContainer_EnumPropNames(p,a,b,c) (p)->EnumPropNames(a,b,c) #define IDxDiagContainer_GetProp(p,a,b) (p)->GetProp(a,b) #endif +/********************************************************************** ******* + * IDxDiagProvider interface + */ +#define INTERFACE IDxDiagProvider +DECLARE_INTERFACE_(IDxDiagProvider,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDxDiagProvider methods ***/ + STDMETHOD(Initialize)(THIS_ DXDIAG_INIT_PARAMS* pParams) PURE; + STDMETHOD(GetRootContainer)(THIS_ IDxDiagContainer** ppInstance) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDxDiagProvider_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDxDiagProvider_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDxDiagProvider_Release(p) (p)->lpVtbl->Release(p) +/*** IDxDiagProvider methods ***/ +#define IDxDiagProvider_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) +#define IDxDiagProvider_GetRootContainer(p,a) (p)->lpVtbl->GetRootContainer(p,a) +#else +/*** IUnknown methods ***/ +#define IDxDiagProvider_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDxDiagProvider_AddRef(p) (p)->AddRef() +#define IDxDiagProvider_Release(p) (p)->Release() +/*** IDxDiagProvider methods ***/ +#define IDxDiagProvider_Initialize(p,a) (p)->Initialize(a) +#define IDxDiagProvider_GetRootContainer(p,a) (p)->GetRootContainer(a) +#endif + #ifdef __cplusplus } #endif
19 years
1
0
0
0
[greatlrd] 19859: correct a mistake
by greatlrd@svn.reactos.com
correct a mistake Modified: trunk/reactos/w32api/include/audevcod.h _____ Modified: trunk/reactos/w32api/include/audevcod.h --- trunk/reactos/w32api/include/audevcod.h 2005-12-04 12:18:22 UTC (rev 19858) +++ trunk/reactos/w32api/include/audevcod.h 2005-12-04 12:31:46 UTC (rev 19859) @@ -22,7 +22,7 @@ SNDDEV_ERROR_Stop =11, SNDDEV_ERROR_Start =12, SNDDEV_ERROR_AddBuffer =13, - SNDDEV_ERROR_Query =14, + SNDDEV_ERROR_Query =14 } SNDDEV_ERR; #endif // __AUDEVCOD__
19 years
1
0
0
0
[greatlrd] 19858: adding missing dx headers
by greatlrd@svn.reactos.com
adding missing dx headers Added: trunk/reactos/w32api/include/dv.h _____ Added: trunk/reactos/w32api/include/dv.h --- trunk/reactos/w32api/include/dv.h 2005-12-04 12:13:48 UTC (rev 19857) +++ trunk/reactos/w32api/include/dv.h 2005-12-04 12:18:22 UTC (rev 19858) @@ -0,0 +1,32 @@ + +#ifndef _DV_H_ +#define _DV_H_ + +typedef struct Tag_DVAudInfo +{ + BYTE bAudStyle[2]; + BYTE bAudQu[2]; + BYTE bNumAudPin; + WORD wAvgSamplesPerPinPerFrm[2]; + WORD wBlkMode; + WORD wDIFMode; + WORD wBlkDiv; +} DVAudInfo; + +#define DV_SD 0x00 +#define DV_HD 0x01 +#define DV_SL 0x02 +#define DV_CAP_AUD16Bits 0x00 +#define DV_CAP_AUD12Bits 0x01 +#define SIZE_DVINFO 0x20 +#define DV_DVSD_NTSC_FRAMESIZE 120000L +#define DV_DVSD_PAL_FRAMESIZE 144000L +#define DV_AUDIOMODE 0x00000F00 +#define DV_SMCHN 0x0000E000 +#define DV_STYPE 0x001F0000 +#define DV_NTSCPAL 0x00200000 +#define DV_AUDIOQU 0x07000000 +#define DV_AUDIOSMP 0x38000000 +#define DV_NTSC 0 +#define DV_PAL 1 +#endif
19 years
1
0
0
0
[arty] 19857: PowerPC support drop in freeldr, from my branch.
by arty@svn.reactos.com
PowerPC support drop in freeldr, from my branch. Some stuff not working, but disk IO now implemented. Get boot partition either from boot-device env var or from cmd line. Needs some work to build with the new tools. Modified: trunk/reactos/boot/freeldr/bootsect/ofwboot.s Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/boot.s Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c Added: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c _____ Modified: trunk/reactos/boot/freeldr/bootsect/ofwboot.s --- trunk/reactos/boot/freeldr/bootsect/ofwboot.s 2005-12-04 12:07:08 UTC (rev 19856) +++ trunk/reactos/boot/freeldr/bootsect/ofwboot.s 2005-12-04 12:13:48 UTC (rev 19857) @@ -61,9 +61,10 @@ li %r9,0x12 /* BATL(0, BAT_M, BAT_PP_RW) */ mtibatl 0,%r9 mtdbatl 0,%r9 - li %r9,0x1ffe /* BATU(0, BAT_BL_256M, BAT_Vs) */ - mtibatu 0,%r9 - mtdbatu 0,%r9 + li %r10,0x1ffe /* BATU(0, BAT_BL_256M, BAT_Vs) */ + mtibatu 0,%r10 + mtdbatu 0,%r10 + isync li %r8,0x3030 @@ -93,6 +94,8 @@ bl ofw_print_eol + bl setup_exc + /* Zero CTR */ mtcr %r31 @@ -630,6 +633,53 @@ /* Return */ blr +ofw_open: + /* Reserve stack space ... + * 20 bytes for the ofw call, + * r8, r9, and lr */ + subi %r1,%r1,32 + + /* Store r8, r9, lr */ + stw %r8,20(%r1) + stw %r9,24(%r1) + mflr %r8 + stw %r8,28(%r1) + + /* Get open name */ + lis %r8,0xe00000@ha + addi %r9,%r8,ofw_open_name - _start + stw %r9,0(%r1) + + /* 1 Argument and 1 return */ + li %r9,1 + stw %r9,4(%r1) + stw %r9,8(%r1) + + stw %r3,12(%r1) + + /* Load up the call address */ + lwz %r9,ofw_call_addr - _start(%r8) + mtlr %r9 + + /* Set argument */ + mr %r3,%r1 + + /* Fire */ + blrl + + lwz %r3,16(%r1) + + /* Restore registers */ + lwz %r8,28(%r1) + mtlr %r8 + lwz %r9,24(%r1) + lwz %r8,20(%r1) + + addi %r1,%r1,32 + + /* Return */ + blr + ofw_getprop_hook: /* Reserve stack space: * 32 bytes for the ofw call @@ -889,7 +939,224 @@ /* Fire */ blrl /* No return from exit */ + +ofw_child: + /* Reserve stack space ... + * 20 bytes for the ofw call, + * r8, r9, and lr */ + subi %r1,%r1,32 + + /* Store r8, r9, lr */ + stw %r8,20(%r1) + stw %r9,24(%r1) + mflr %r8 + stw %r8,28(%r1) + + /* Get child name */ + lis %r8,0xe00000@ha + addi %r9,%r8,ofw_child_name - _start + stw %r9,0(%r1) + + /* 1 Argument and 1 return */ + li %r9,1 + stw %r9,4(%r1) + stw %r9,8(%r1) + + stw %r3,12(%r1) + + /* Load up the call address */ + lwz %r9,ofw_call_addr - _start(%r8) + mtlr %r9 + + /* Set argument */ + mr %r3,%r1 + + /* Fire */ + blrl + + lwz %r3,16(%r1) + + /* Restore registers */ + lwz %r8,28(%r1) + mtlr %r8 + lwz %r9,24(%r1) + lwz %r8,20(%r1) + + addi %r1,%r1,32 + + /* Return */ + blr + +ofw_peer: + /* Reserve stack space ... + * 20 bytes for the ofw call, + * r8, r9, and lr */ + subi %r1,%r1,32 + + /* Store r8, r9, lr */ + stw %r8,20(%r1) + stw %r9,24(%r1) + mflr %r8 + stw %r8,28(%r1) + + /* Get peer name */ + lis %r8,0xe00000@ha + addi %r9,%r8,ofw_peer_name - _start + stw %r9,0(%r1) + + /* 1 Argument and 1 return */ + li %r9,1 + stw %r9,4(%r1) + stw %r9,8(%r1) + + stw %r3,12(%r1) + + /* Load up the call address */ + lwz %r9,ofw_call_addr - _start(%r8) + mtlr %r9 + + /* Set argument */ + mr %r3,%r1 + + /* Fire */ + blrl + + lwz %r3,16(%r1) + + /* Restore registers */ + lwz %r8,28(%r1) + mtlr %r8 + lwz %r9,24(%r1) + lwz %r8,20(%r1) + + addi %r1,%r1,32 + + /* Return */ + blr + +ofw_seek: + /* Reserve stack space ... + * 20 bytes for the ofw call, + * r8, r9, and lr */ + subi %r1,%r1,32 + + /* Store r8, r9, lr */ + stw %r8,20(%r1) + stw %r9,24(%r1) + mflr %r8 + stw %r8,28(%r1) + + /* Get peer name */ + lis %r8,0xe00000@ha + addi %r9,%r8,ofw_seek_name - _start + stw %r9,0(%r1) + + /* 3 Arguments and 1 return */ + li %r9,3 + stw %r9,4(%r1) + li %r9,1 + stw %r9,8(%r1) + + stw %r3,12(%r1) + stw %r4,16(%r1) + stw %r5,20(%r1) + + /* Load up the call address */ + lwz %r9,ofw_call_addr - _start(%r8) + mtlr %r9 + + /* Set argument */ + mr %r3,%r1 + + /* Fire */ + blrl + + lwz %r3,16(%r1) + + /* Restore registers */ + lwz %r8,28(%r1) + mtlr %r8 + lwz %r9,24(%r1) + lwz %r8,20(%r1) + + addi %r1,%r1,32 + + /* Return */ + blr + + +setup_exc: + subi %r1,%r1,32 + + stw %r3,0(%r1) + mflr %r3 + stw %r3,4(%r1) + stw %r8,8(%r1) + stw %r9,12(%r1) + stw %r10,16(%r1) + stw %r12,20(%r1) + + lis %r8,0xe00000@ha + xor %r12,%r12,%r12 + addi %r12,%r12,0x300 + addi %r9,%r8,dsi_exc - _start + addi %r10,%r8,dsi_end - _start + +copy_loop: + cmp 0,0,%r9,%r10 + beq ret_setup_exc + + mr %r3,%r12 + bl ofw_print_number + bl ofw_print_space + + lwz %r3,0(%r9) + stw %r3,0(%r12) + + bl ofw_print_number + bl ofw_print_eol + + addi %r12,%r12,4 + addi %r9,%r9,4 + b copy_loop + +ret_setup_exc: + mfmsr %r12 + andi. %r12,%r12,0xffbf + mtmsr %r12 + + lwz %r12,20(%r1) + lwz %r10,16(%r1) + lwz %r9,12(%r1) + lwz %r8,8(%r1) + + lwz %r3,4(%r1) + mtlr %r3 + lwz %r3,0(%r1) + + blr + +dsi_exc: + subi %r1,%r1,16 + + stw %r0,0(%r1) + stw %r3,4(%r1) + + mfsrr0 %r3 + addi %r3,%r3,4 + mtsrr0 %r3 + + /* mfsrr1 %r3 */ + /* ori %r3,%r3,2 */ + /* mtsrr1 %r3 */ + lwz %r3,4(%r1) + lwz %r0,0(%r1) + + addi %r1,%r1,16 + rfi +dsi_end: + .org 0x1000 freeldr_banner: .ascii "ReactOS OpenFirmware Boot Program\r\n\0" @@ -899,7 +1166,6 @@ freeldr_reg_init: .ascii "r\0" - freeldr_reg_lr: .ascii "lr \0" freeldr_reg_cr: @@ -933,6 +1199,18 @@ ofw_exit_name: .ascii "exit\0" +ofw_open_name: + .ascii "open\0" + +ofw_child_name: + .ascii "child\0" + +ofw_peer_name: + .ascii "peer\0" + +ofw_seek_name: + .ascii "seek\0" + ofw_chosen_name: .ascii "/chosen\0" @@ -954,6 +1232,10 @@ .long ofw_print_regs .long ofw_print_string .long ofw_print_number + .long ofw_open + .long ofw_child + .long ofw_peer + .long ofw_seek .org 0x2000 stack: _____ Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/boot.s --- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/boot.s 2005-12-04 12:07:08 UTC (rev 19856) +++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/boot.s 2005-12-04 12:13:48 UTC (rev 19857) @@ -1,3 +1,3 @@ .extern PpcInit _start: - b PpcInit + b PpcInit+4 _____ Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c --- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c 2005-12-04 12:07:08 UTC (rev 19856) +++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c 2005-12-04 12:13:48 UTC (rev 19857) @@ -22,20 +22,18 @@ extern void BootMain( char * ); extern char *GetFreeLoaderVersionString(); -ULONG BootPartition = 0; -ULONG BootDrive = 0; - of_proxy ofproxy; void *PageDirectoryStart, *PageDirectoryEnd; -static int chosen_package, stdin_handle; +static int chosen_package, stdin_handle, part_handle = -1; BOOLEAN AcpiPresent = FALSE; -char BootPath[0x100]; +char BootPath[0x100] = { 0 }, BootPart[0x100] = { 0 }, CmdLine[0x100] = { 0 }; +jmp_buf jmp; -void le_swap( const void *start_addr_v, - const void *end_addr_v, +void le_swap( const void *start_addr_v, + const void *end_addr_v, const void *target_addr_v ) { - long *start_addr = (long *)ROUND_DOWN((long)start_addr_v,8), - *end_addr = (long *)ROUND_UP((long)end_addr_v,8), + long *start_addr = (long *)ROUND_DOWN((long)start_addr_v,8), + *end_addr = (long *)ROUND_UP((long)end_addr_v,8), *target_addr = (long *)ROUND_DOWN((long)target_addr_v,8); long tmp; while( start_addr <= end_addr ) { @@ -68,6 +66,7 @@ return ret; } +/* Since this is from external storage, it doesn't need swapping */ int ofw_write( int handle, const char *data, int len ) { int ret; le_swap( data, data + len, data ); @@ -77,12 +76,15 @@ return ret; } +/* Since this is from external storage, it doesn't need swapping */ int ofw_read( int handle, const char *data, int len ) { int ret; + le_swap( data, data + len, data ); ret = ofproxy ( 12, (void *)handle, (char *)data, (void *)len, NULL ); le_swap( data, data + len, data ); + return ret; } @@ -105,14 +107,75 @@ ofproxy( 28, (void *)num, NULL, NULL, NULL ); } +int ofw_open( const char *name ) { + int ret, len; + + len = strlen(name); + le_swap( name, name + len, name ); + ret = ofproxy( 32, (char *)name, NULL, NULL, NULL ); + le_swap( name, name + len, name ); + return ret; +} + +int ofw_child( int package ) { + return ofproxy( 36, (void *)package, NULL, NULL, NULL ); +} + +int ofw_peer( int package ) { + return ofproxy( 40, (void *)package, NULL, NULL, NULL ); +} + +int ofw_seek( int handle, long long location ) { + return ofproxy( 44, (void *)handle, (void *)(int)(location >> 32), (void *)(int)location, NULL ); +} + void PpcPutChar( int ch ) { char buf[3]; - if( ch == 0x0a ) { buf[0] = 0x0d; buf[1] = 0x0a; } + if( ch == 0x0a ) { buf[0] = 0x0d; buf[1] = 0x0a; } else { buf[0] = ch; buf[1] = 0; } buf[2] = 0; ofw_print_string( buf ); } +int PpcFindDevice( int depth, int parent, char *devname, int *nth ) { + static char buf[256]; + int next = 0; + int gotname = 0; + int match = 0; + int i; + + next = ofw_child( parent ); + + //printf( "next = %x\n", next ); + + gotname = ofw_getprop(parent, "name", buf, 256); + + //printf( "gotname = %d\n", gotname ); + + match = !strncmp(buf, devname, strlen(devname)); + + if( !nth && match ) return parent; + else if( match ) *nth--; + + for( i = 0; i < depth; i++ ) PpcPutChar( ' ' ); + + if( depth == 1 ) { + if( gotname > 0 ) { + printf( "%c Name: %s\n", match ? '*' : ' ', buf ); + } else { + printf( "- No name attribute for %x\n", parent ); + } + } + + while( !match && next ) { + i = PpcFindDevice( depth+1, next, devname, nth ); + if( i ) return i; + next = ofw_peer( next ); + } + + return 0; +} + BOOL PpcConsKbHit() { return TRUE; } @@ -167,12 +230,12 @@ return FALSE; } -VOID PpcVideoSetPaletteColor( UCHAR Color, +VOID PpcVideoSetPaletteColor( UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue ) { printf( "SetPaletteColor(%x,%x,%x,%x)\n", Color, Red, Green, Blue ); } -VOID PpcVideoGetPaletteColor( UCHAR Color, +VOID PpcVideoGetPaletteColor( UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue ) { printf( "GetPaletteColor(%x)\n", Color); } @@ -198,16 +261,74 @@ BiosMemoryMap[0].BaseAddress = 0; BiosMemoryMap[0].Length = 32 * 1024 * 1024; /* Assume 32 meg for now */ - printf( "Returning memory map (%dk total)\n", + printf( "Returning memory map (%dk total)\n", (int)BiosMemoryMap[0].Length / 1024 ); return 1; } +/* Strategy: + * + * For now, it'll be easy enough to use the boot command line as our boot path. + * Treat it as the path of a disk partition. We might even be able to get + * away with grabbing a partition image by tftp in this scenario. + */ + +BOOL PpcDiskGetBootVolume( PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType ) { + *DriveNumber = 0; + *StartSector = 0; + *SectorCount = 0; + *FsType = FS_FAT; + return TRUE; +} + +BOOL PpcDiskGetSystemVolume( char *SystemPath, + char *RemainingPath, + PULONG Device, + PULONG DriveNumber, + PULONGLONG StartSector, + PULONGLONG SectorCount, + int *FsType ) { + return FALSE; +} + +BOOL PpcDiskGetBootPath( char *OutBootPath, unsigned Size ) { + strncpy( OutBootPath, BootPath, Size ); + return TRUE; +} + +VOID PpcDiskGetBootDevice( PULONG BootDevice ) { + BootDevice[0] = BootDevice[1] = 0; +} + +BOOL PpcDiskBootingFromFloppy(VOID) { + return FALSE; +} + BOOL PpcDiskReadLogicalSectors( ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer ) { - printf("DiskReadLogicalSectors\n"); - return FALSE; + int rlen = 0; + + if( part_handle == -1 ) { + part_handle = ofw_open( BootPart ); + + if( part_handle == -1 ) { + printf("Could not open any disk devices we know about\n"); + return FALSE; + } + } + + if( part_handle == -1 ) { + printf("Got partition handle %x\n", part_handle); + return FALSE; + } + + if( ofw_seek( part_handle, SectorNumber * 512 ) ) { + printf("Seek to %x failed\n", SectorNumber * 512); + return FALSE; + } + rlen = ofw_read( part_handle, Buffer, SectorCount * 512 ); + return rlen > 0; } BOOL PpcDiskGetPartitionEntry( ULONG DriveNumber, ULONG PartitionNumber, @@ -218,24 +339,32 @@ BOOL PpcDiskGetDriveGeometry( ULONG DriveNumber, PGEOMETRY DriveGeometry ) { printf("GetGeometry(%d)\n", DriveNumber); - return FALSE; + DriveGeometry->BytesPerSector = 512; + DriveGeometry->Heads = 16; + DriveGeometry->Sectors = 63; + return TRUE; } ULONG PpcDiskGetCacheableBlockCount( ULONG DriveNumber ) { printf("GetCacheableBlockCount\n"); - return 0; + return 1; } -VOID PpcRTCGetCurrentDateTime( PULONG Hear, PULONG Month, PULONG Day, +VOID PpcRTCGetCurrentDateTime( PULONG Hear, PULONG Month, PULONG Day, PULONG Hour, PULONG Minute, PULONG Second ) { printf("RTCGeturrentDateTime\n"); } VOID PpcHwDetect() { + printf("PpcHwDetect\n"); } +typedef unsigned int uint32_t; + void PpcInit( of_proxy the_ofproxy ) { + int len; ofproxy = the_ofproxy; + chosen_package = ofw_finddevice( "/chosen" ); ofw_getprop( chosen_package, "stdin", @@ -246,9 +375,9 @@ MachVtbl.ConsPutChar = PpcPutChar; MachVtbl.ConsKbHit = PpcConsKbHit; MachVtbl.ConsGetCh = PpcConsGetCh; + + printf( "stdin_handle is %x\n", stdin_handle ); - printf("chosen_package = %x\n", chosen_package); - MachVtbl.VideoClearScreen = PpcVideoClearScreen; MachVtbl.VideoSetDisplayMode = PpcVideoSetDisplayMode; MachVtbl.VideoGetDisplaySize = PpcVideoGetDisplaySize; @@ -256,7 +385,7 @@ MachVtbl.VideoSetTextCursorPosition = PpcVideoSetTextCursorPosition; MachVtbl.VideoHideShowTextCursor = PpcVideoHideShowTextCursor; MachVtbl.VideoPutChar = PpcVideoPutChar; - MachVtbl.VideoCopyOffScreenBufferToVRAM = + MachVtbl.VideoCopyOffScreenBufferToVRAM = PpcVideoCopyOffScreenBufferToVRAM; MachVtbl.VideoIsPaletteFixed = PpcVideoIsPaletteFixed; MachVtbl.VideoSetPaletteColor = PpcVideoSetPaletteColor; @@ -266,6 +395,11 @@ MachVtbl.GetMemoryMap = PpcGetMemoryMap; + MachVtbl.DiskGetBootVolume = PpcDiskGetBootVolume; + MachVtbl.DiskGetSystemVolume = PpcDiskGetSystemVolume; + MachVtbl.DiskGetBootPath = PpcDiskGetBootPath; + MachVtbl.DiskGetBootDevice = PpcDiskGetBootDevice; + MachVtbl.DiskBootingFromFloppy = PpcDiskBootingFromFloppy; MachVtbl.DiskReadLogicalSectors = PpcDiskReadLogicalSectors; MachVtbl.DiskGetPartitionEntry = PpcDiskGetPartitionEntry; MachVtbl.DiskGetDriveGeometry = PpcDiskGetDriveGeometry; @@ -276,24 +410,57 @@ MachVtbl.HwDetect = PpcHwDetect; printf( "FreeLDR version [%s]\n", GetFreeLoaderVersionString() ); - BootMain("freeldr-ppc"); -} -void MachInit(const char *CmdLine) { - int len; - printf( "Determining boot device:\n" ); - len = ofw_getprop(chosen_package, "bootpath", - BootPath, sizeof(BootPath)); - printf( "Got %d bytes of path\n", len ); - BootPath[len] = 0; - printf( "Boot Path: %s\n", BootPath ); + len = ofw_getprop(chosen_package, "bootargs", + CmdLine, sizeof(CmdLine)); - printf( "FreeLDR starting\n" ); + if( len < 0 ) len = 0; + CmdLine[len] = 0; + + BootMain( CmdLine ); } -void FrLdrSetupPageDirectory() { +void MachInit(char *CmdLine) { + int len, i; + char *sep; + + BootPart[0] = 0; + BootPath[0] = 0; + + printf( "Determining boot device: [%s]\n", CmdLine ); + + printf( "Boot Args: %s\n", CmdLine ); + sep = NULL; + for( i = 0; i < strlen(CmdLine); i++ ) { + if( strncmp(CmdLine + i, "boot=", 5) == 0) { + strcpy(BootPart, CmdLine + i + 5); + sep = strchr(BootPart, ' '); + if( sep ) + *sep = 0; + break; + } + } + + if( strlen(BootPart) == 0 ) { + len = ofw_getprop(chosen_package, "bootpath", + BootPath, sizeof(BootPath)); + + if( len < 0 ) len = 0; + BootPath[len] = 0; + printf( "Boot Path: %s\n", BootPath ); + + sep = strrchr(BootPath, ','); + + strcpy(BootPart, BootPath); + if( sep ) { + BootPart[sep - BootPath] = 0; + } + } + + printf( "FreeLDR starting (boot partition: %s)\n", BootPart ); } +/* Compatibility functions that don't do much */ void beep() { } @@ -303,3 +470,18 @@ void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value) { } + +void DiskStopFloppyMotor() { +} + +void BootOldLinuxKernel( unsigned long size ) { + ofw_exit(); +} + +void BootNewLinuxKernel() { + ofw_exit(); +} + +void ChainLoadBiosBootSectorCode() { + ofw_exit(); +} _____ Added: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c --- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c 2005-12-04 12:07:08 UTC (rev 19856) +++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c 2005-12-04 12:13:48 UTC (rev 19857) @@ -0,0 +1,661 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: Freeloader + * FILE: boot/freeldr/freeldr/multiboot.c + * PURPOSE: ReactOS Loader + * PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net) + * Hartmut Birr - SMP/PAE Code + */ + +#include <freeldr.h> +#include <internal/powerpc/ke.h> + +#define NDEBUG +#include <debug.h> + +/* Base Addres of Kernel in Physical Memory */ +#define KERNEL_BASE_PHYS 0x200000 + +/* Bits to shift to convert a Virtual Address into an Offset in the Page Table */ +#define PFN_SHIFT 12 + +/* Bits to shift to convert a Virtual Address into an Offset in the Page Directory */ +#define PDE_SHIFT 20 +#define PDE_SHIFT_PAE 18 + + +/* Converts a Relative Address read from the Kernel into a Physical Address */ +#define RaToPa(p) \ + (ULONG_PTR)((ULONG_PTR)p + KERNEL_BASE_PHYS) + +/* Converts a Phsyical Address Pointer into a Page Frame Number */ +#define PaPtrToPfn(p) \ + (((ULONG_PTR)&p) >> PFN_SHIFT) + +/* Converts a Phsyical Address into a Page Frame Number */ +#define PaToPfn(p) \ + ((p) >> PFN_SHIFT) + +#define STARTUP_BASE 0xF0000000 +#define HYPERSPACE_BASE 0xF0800000 +#define APIC_BASE 0xFEC00000 +#define KPCR_BASE 0xFF000000 + +#define LowMemPageTableIndex 0 +#define StartupPageTableIndex (STARTUP_BASE >> 20) / sizeof(HARDWARE_PTE_X86) +#define HyperspacePageTableIndex (HYPERSPACE_BASE >> 20) / sizeof(HARDWARE_PTE_X86) +#define KpcrPageTableIndex (KPCR_BASE >> 20) / sizeof(HARDWARE_PTE_X86) +#define ApicPageTableIndex (APIC_BASE >> 20) / sizeof(HARDWARE_PTE_X86) + +#define LowMemPageTableIndexPae 0 +#define StartupPageTableIndexPae (STARTUP_BASE >> 21) +#define HyperspacePageTableIndexPae (HYPERSPACE_BASE >> 21) +#define KpcrPageTableIndexPae (KPCR_BASE >> 21) +#define ApicPageTableIndexPae (APIC_BASE >> 21) + + +#define KernelEntryPoint (KernelEntry - KERNEL_BASE_PHYS) + KernelBase + +/* Load Address of Next Module */ +ULONG_PTR NextModuleBase = 0; + +/* Currently Opened Module */ +PFRLDR_MODULE CurrentModule = NULL; + +/* Unrelocated Kernel Base in Virtual Memory */ +ULONG_PTR KernelBase; + +/* Wether PAE is to be used or not */ +BOOLEAN PaeModeEnabled; + +/* Kernel Entrypoint in Physical Memory */ +ULONG_PTR KernelEntry; + +/* FUNCTIONS *****************************************************************/ + +/*++ + * FrLdrStartup + * INTERNAL + * + * Prepares the system for loading the Kernel. + * + * Params: + * Magic - Multiboot Magic + * + * Returns: + * None. + * + * Remarks: + * None. + * + *--*/ +VOID +STDCALL +FrLdrStartup(ULONG Magic) +{ +#if 0 + /* Disable Interrupts */ + KeArchDisableInterrupts(); + + /* Re-initalize EFLAGS */ + KeArchEraseFlags(); + + /* Initialize the page directory */ + FrLdrSetupPageDirectory(); +#endif +} + +/*++ + * FrLdrGetKernelBase + * INTERNAL + * + * Gets the Kernel Base to use. + * + * Params: + * + * Returns: + * None. + * + * Remarks: + * Sets both the FreeLdr internal variable as well as the one which + * will be used by the Kernel. + * + *--*/ +VOID +FASTCALL +FrLdrGetKernelBase(VOID) +{ + PCHAR p; + + /* Read Command Line */ + p = (PCHAR)LoaderBlock.CommandLine; + while ((p = strchr(p, '/')) != NULL) { + + /* Find "/3GB" */ + if (!strnicmp(p + 1, "3GB", 3)) { + + /* Make sure there's nothing following it */ + if (p[4] == ' ' || p[4] == 0) { + + /* Use 3GB */ + KernelBase = 0xC0000000; + } + } + + p++; + } + + /* Set KernelBase */ + LoaderBlock.KernelBase = KernelBase; +} + +/*++ + * FrLdrSetupPageDirectory + * INTERNAL + * + * Sets up the ReactOS Startup Page Directory. + * + * Params: + * None. + * + * Returns: + * None. + * + * Remarks: + * We are setting PDEs, but using the equvivalent (for our purpose) PTE structure. + * As such, please note that PageFrameNumber == PageEntryNumber. + * + *--*/ +VOID +FASTCALL +FrLdrSetupPageDirectory(VOID) +{ +#if 0 + PPAGE_DIRECTORY_X86 PageDir; + PPAGE_DIRECTORY_TABLE_X64 PageDirTablePae; + PPAGE_DIRECTORY_X64 PageDirPae; + ULONG KernelPageTableIndex; + ULONG i; + + if (PaeModeEnabled) { + + /* Get the Kernel Table Index */ + KernelPageTableIndex = (KernelBase >> 21); + + /* Get the Startup Page Directory Table */ + PageDirTablePae = (PPAGE_DIRECTORY_TABLE_X64)&startup_pagedirectorytable_pae; + + /* Get the Startup Page Directory */ + PageDirPae = (PPAGE_DIRECTORY_X64)&startup_pagedirectory_pae; + + /* Set the Startup page directory table */ + for (i = 0; i < 4; i++) + { + PageDirTablePae->Pde[i].Valid = 1; + PageDirTablePae->Pde[i].PageFrameNumber = PaPtrToPfn(startup_pagedirectory_pae) + i; + } + + /* Set up the Low Memory PDE */ + for (i = 0; i < 2; i++) + { + PageDirPae->Pde[LowMemPageTableIndexPae + i].Valid = 1; + PageDirPae->Pde[LowMemPageTableIndexPae + i].Write = 1; + PageDirPae->Pde[LowMemPageTableIndexPae + i].PageFrameNumber = PaPtrToPfn(lowmem_pagetable_pae) + i; + } + + /* Set up the Kernel PDEs */ + for (i = 0; i < 3; i++) + { + PageDirPae->Pde[KernelPageTableIndex + i].Valid = 1; + PageDirPae->Pde[KernelPageTableIndex + i].Write = 1; + PageDirPae->Pde[KernelPageTableIndex + i].PageFrameNumber = PaPtrToPfn(kernel_pagetable_pae) + i; + } + + /* Set up the Startup PDE */ + for (i = 0; i < 4; i++) + { + PageDirPae->Pde[StartupPageTableIndexPae + i].Valid = 1; + PageDirPae->Pde[StartupPageTableIndexPae + i].Write = 1; + PageDirPae->Pde[StartupPageTableIndexPae + i].PageFrameNumber = PaPtrToPfn(startup_pagedirectory_pae) + i; + } + + /* Set up the Hyperspace PDE */ + for (i = 0; i < 2; i++) + { + PageDirPae->Pde[HyperspacePageTableIndexPae + i].Valid = 1; + PageDirPae->Pde[HyperspacePageTableIndexPae + i].Write = 1; + PageDirPae->Pde[HyperspacePageTableIndexPae + i].PageFrameNumber = PaPtrToPfn(hyperspace_pagetable_pae) + i; + } + + /* Set up the Apic PDE */ + for (i = 0; i < 2; i++) + { + PageDirPae->Pde[ApicPageTableIndexPae + i].Valid = 1; + PageDirPae->Pde[ApicPageTableIndexPae + i].Write = 1; + PageDirPae->Pde[ApicPageTableIndexPae + i].PageFrameNumber = PaPtrToPfn(apic_pagetable_pae) + i; + } + + /* Set up the KPCR PDE */ + PageDirPae->Pde[KpcrPageTableIndexPae].Valid = 1; + PageDirPae->Pde[KpcrPageTableIndexPae].Write = 1; + PageDirPae->Pde[KpcrPageTableIndexPae].PageFrameNumber = PaPtrToPfn(kpcr_pagetable_pae); + + /* Set up Low Memory PTEs */ + PageDirPae = (PPAGE_DIRECTORY_X64)&lowmem_pagetable_pae; + for (i=0; i<1024; i++) { + + PageDirPae->Pde[i].Valid = 1; + PageDirPae->Pde[i].Write = 1; + PageDirPae->Pde[i].Owner = 1; + PageDirPae->Pde[i].PageFrameNumber = i; + } + + /* Set up Kernel PTEs */ + PageDirPae = (PPAGE_DIRECTORY_X64)&kernel_pagetable_pae; + for (i=0; i<1536; i++) { + + PageDirPae->Pde[i].Valid = 1; + PageDirPae->Pde[i].Write = 1; [truncated at 1000 lines; 403 more skipped]
19 years
1
0
0
0
← Newer
1
...
61
62
63
64
65
66
67
...
71
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Results per page:
10
25
50
100
200