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
April 2005
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
26 participants
477 discussions
Start a n
N
ew thread
[ekohl] 14482: Support marshalling of 'unique' strings.
by ekohl@svn.reactos.com
Support marshalling of 'unique' strings. Modified: trunk/reactos/lib/rpcrt4/ndr_marshall.c _____ Modified: trunk/reactos/lib/rpcrt4/ndr_marshall.c --- trunk/reactos/lib/rpcrt4/ndr_marshall.c 2005-04-03 19:06:49 UTC (rev 14481) +++ trunk/reactos/lib/rpcrt4/ndr_marshall.c 2005-04-03 19:15:14 UTC (rev 14482) @@ -388,8 +388,13 @@ TRACE("(pStubMsg == ^%p, pszMessage == ^%p, pFormat == ^%p)\n", pStubMsg, pszMessage, pFormat); assert(pFormat); - if (*pFormat == RPC_FC_C_CSTRING) { + if (pszMessage == NULL) { TRACE("string=%s\n", debugstr_a(pszMessage)); + len = 0; + esize = 0; + } + else if (*pFormat == RPC_FC_C_CSTRING) { + TRACE("string=%s\n", debugstr_a(pszMessage)); len = strlen(pszMessage)+1; esize = 1; } @@ -416,8 +421,10 @@ c += 8; /* offset: 0 */ NDR_LOCAL_UINT32_WRITE(c, len); /* actual length: (same) */ c += 4; - memcpy(c, pszMessage, len*esize); /* the string itself */ - c += len*esize; + if (len != 0) { + memcpy(c, pszMessage, len*esize); /* the string itself */ + c += len*esize; + } pStubMsg->Buffer = c; STD_OVERFLOW_CHECK(pStubMsg); @@ -435,7 +442,12 @@ TRACE("(pStubMsg == ^%p, pMemory == ^%p, pFormat == ^%p)\n", pStubMsg, pMemory, pFormat); assert(pFormat); - if (*pFormat == RPC_FC_C_CSTRING) { + if (pMemory == NULL) { + /* we need 12 octets for the [maxlen, offset, len] DWORDS */ + TRACE("string=NULL\n"); + pStubMsg->BufferLength += 12 + BUFFER_PARANOIA; + } + else if (*pFormat == RPC_FC_C_CSTRING) { /* we need 12 octets for the [maxlen, offset, len] DWORDS, + 1 octet for '\0' */ TRACE("string=%s\n", debugstr_a(pMemory)); pStubMsg->BufferLength += strlen(pMemory) + 13 + BUFFER_PARANOIA; @@ -528,6 +540,11 @@ /* for clients, memory should be provided by caller */ } + if (len == 0) { + *ppMemory = NULL; + return NULL; + } + pMem = *ppMemory + ofs*esize; if (pMem != pStubMsg->Buffer) @@ -572,6 +589,8 @@ switch (type) { case RPC_FC_RP: /* ref pointer (always non-null) */ break; + case RPC_FC_UP: /* unique pointer */ + break; default: FIXME("unhandled ptr type=%02x\n", type); } @@ -609,6 +628,8 @@ switch (type) { case RPC_FC_RP: /* ref pointer (always non-null) */ break; + case RPC_FC_UP: /* unique pointer */ + break; default: FIXME("unhandled ptr type=%02x\n", type); } @@ -645,6 +666,8 @@ switch (type) { case RPC_FC_RP: /* ref pointer (always non-null) */ break; + case RPC_FC_UP: /* unique pointer */ + break; default: FIXME("unhandled ptr type=%02x\n", type); }
19 years, 7 months
1
0
0
0
[frik85] 14481: ReactOS Package Manager
by frik85@svn.reactos.com
ReactOS Package Manager More information:
http://reactos.com/wiki/index.php/ReactOS_Package_Manager
* Maarten Bosma (Dr. Fred) * Klemens Friedl (frik85) Added: trunk/rosapps/packmgr/ Added: trunk/rosapps/packmgr/gui/ Added: trunk/rosapps/packmgr/gui/en.rc Added: trunk/rosapps/packmgr/gui/generic.rc Added: trunk/rosapps/packmgr/gui/main.cpp Added: trunk/rosapps/packmgr/gui/main.h Added: trunk/rosapps/packmgr/gui/makefile Added: trunk/rosapps/packmgr/gui/packmgr.rc Added: trunk/rosapps/packmgr/gui/res/ Added: trunk/rosapps/packmgr/gui/res/blank.ico Added: trunk/rosapps/packmgr/gui/res/development.ico Added: trunk/rosapps/packmgr/gui/res/games.ico Added: trunk/rosapps/packmgr/gui/res/graphics.ico Added: trunk/rosapps/packmgr/gui/res/inet.ico Added: trunk/rosapps/packmgr/gui/res/install.ico Added: trunk/rosapps/packmgr/gui/res/installed.ico Added: trunk/rosapps/packmgr/gui/res/installsource.ico Added: trunk/rosapps/packmgr/gui/res/multimedia.ico Added: trunk/rosapps/packmgr/gui/res/office.ico Added: trunk/rosapps/packmgr/gui/res/others.ico Added: trunk/rosapps/packmgr/gui/res/packetmanager.ico Added: trunk/rosapps/packmgr/gui/res/toolbar.bmp Added: trunk/rosapps/packmgr/gui/res/tools.ico Added: trunk/rosapps/packmgr/gui/res/uninstall.ico Added: trunk/rosapps/packmgr/gui/res/update.ico Added: trunk/rosapps/packmgr/gui/resource.h Added: trunk/rosapps/packmgr/help.txt Added: trunk/rosapps/packmgr/lib/ Added: trunk/rosapps/packmgr/lib/download.cpp Added: trunk/rosapps/packmgr/lib/en.rc Added: trunk/rosapps/packmgr/lib/error.h Added: trunk/rosapps/packmgr/lib/expat.h Added: trunk/rosapps/packmgr/lib/functions.cpp Added: trunk/rosapps/packmgr/lib/log.cpp Added: trunk/rosapps/packmgr/lib/log.h Added: trunk/rosapps/packmgr/lib/main.cpp Added: trunk/rosapps/packmgr/lib/makefile Added: trunk/rosapps/packmgr/lib/package.cpp Added: trunk/rosapps/packmgr/lib/package.def Added: trunk/rosapps/packmgr/lib/package.hpp Added: trunk/rosapps/packmgr/lib/package.rc Added: trunk/rosapps/packmgr/lib/script.cpp Added: trunk/rosapps/packmgr/lib/script.h Added: trunk/rosapps/packmgr/lib/tree.cpp Added: trunk/rosapps/packmgr/makefile Added: trunk/rosapps/packmgr/tree/ Added: trunk/rosapps/packmgr/tree/abiword.inst.rps Added: trunk/rosapps/packmgr/tree/abiword.xml Added: trunk/rosapps/packmgr/tree/mozcontrol.xml Added: trunk/rosapps/packmgr/tree/mozillacontrol.inst.rps Added: trunk/rosapps/packmgr/tree/tree.xml _____ Added: trunk/rosapps/packmgr/gui/en.rc --- trunk/rosapps/packmgr/gui/en.rc 2005-04-03 15:47:15 UTC (rev 14480) +++ trunk/rosapps/packmgr/gui/en.rc 2005-04-03 19:06:49 UTC (rev 14481) @@ -0,0 +1,43 @@ + +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +/* Dialogs */ +IDD_OPTIONS DIALOG DISCARDABLE 0, 0, 180, 200 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Options" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "There are no options yet.", 0, 50, 95, 80, 8 +END + +IDD_DOIT DIALOG DISCARDABLE 0, 0, 180, 100 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Performing Operations" +FONT 8, "MS Sans Serif" +BEGIN + + CTEXT "{Status}", IDC_TSTATUS, 0, 10, 180, 8 + + CONTROL "", IDC_STATUS1, "msctls_progress32", PBS_SMOOTH, 20, 25, 140, 15 + + CONTROL "", IDC_STATUS2, "msctls_progress32", PBS_SMOOTH, 20, 45, 140, 15 + + PUSHBUTTON "Abort", IDC_CANCEL, 65, 70, 50, 14, WS_DISABLED +END + +IDR_POPUP MENU DISCARDABLE +BEGIN + POPUP "PopUp", MENUBARBREAK + BEGIN + MENUITEM "No Action", 1, GRAYED + MENUITEM "Install (recommended)", 2, GRAYED + MENUITEM "Install from Source", 3, GRAYED + MENUITEM "Update", 4, GRAYED + MENUITEM "Unnstall", 5, GRAYED + MENUITEM SEPARATOR + MENUITEM "Options", 8 + MENUITEM SEPARATOR + MENUITEM "DoIt", 6 + END +END + _____ Added: trunk/rosapps/packmgr/gui/generic.rc --- trunk/rosapps/packmgr/gui/generic.rc 2005-04-03 15:47:15 UTC (rev 14480) +++ trunk/rosapps/packmgr/gui/generic.rc 2005-04-03 19:06:49 UTC (rev 14481) @@ -0,0 +1,24 @@ + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL + +IDI_MAIN ICON DISCARDABLE "res/packetmanager.ico" +IDB_TOOLBAR BITMAP DISCARDABLE "res/toolbar.bmp" + +/* TreeIcons - Categories */ +1 ICON DISCARDABLE "res/blank.ico" +2 ICON DISCARDABLE "res/inet.ico" +3 ICON DISCARDABLE "res/office.ico" +4 ICON DISCARDABLE "res/graphics.ico" +5 ICON DISCARDABLE "res/multimedia.ico" +6 ICON DISCARDABLE "res/development.ico" +7 ICON DISCARDABLE "res/games.ico" +8 ICON DISCARDABLE "res/tools.ico" +9 ICON DISCARDABLE "res/others.ico" +10 ICON DISCARDABLE "res/installed.ico" + +/* TreeIcons - Actions */ +11 ICON DISCARDABLE "res/install.ico" +12 ICON DISCARDABLE "res/installsource.ico" +13 ICON DISCARDABLE "res/update.ico" +14 ICON DISCARDABLE "res/uninstall.ico" + _____ Added: trunk/rosapps/packmgr/gui/main.cpp --- trunk/rosapps/packmgr/gui/main.cpp 2005-04-03 15:47:15 UTC (rev 14480) +++ trunk/rosapps/packmgr/gui/main.cpp 2005-04-03 19:06:49 UTC (rev 14481) @@ -0,0 +1,401 @@ +//////////////////////////////////////////////////////// +// +// main.cpp +// +// Implementation of the Package Manager GUI +// +// +// Maarten Bosma, 09.01.2004 +// maarten.paul(a)bosma.de +// +//////////////////////////////////////////////////////////////////// + +#include "main.h" + + +// Application's Entry Point +int WINAPI WinMain (HINSTANCE hinst, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) +{ + HWND hwnd; + MSG msg; + WNDCLASSEX wc = {0}; + + // Window creation + wc.cbSize = sizeof(WNDCLASSEX); + wc.lpszClassName = L"pgkmgr"; + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = (WNDPROC)WndProc; + wc.hInstance = hinst; + wc.hIcon = LoadIcon(hinst, MAKEINTRESOURCE(IDI_MAIN)); + wc.hbrBackground = (HBRUSH)(COLOR_SCROLLBAR); + + RegisterClassEx(&wc); + + hwnd = CreateWindow(L"pgkmgr", + L"ReactOS - Package Manager v0.3", + WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, + CW_USEDEFAULT, + 500, 600, + NULL, NULL, + hinst, + NULL); + + + // Toolbar creation + InitCommonControls(); + + hTBar = CreateToolbarEx(hwnd, WS_CHILD|WS_VISIBLE|TBSTYLE_FLAT, 0, 8, hinst, IDB_TOOLBAR, + Buttons, sizeof(Buttons)/sizeof(TBBUTTON), TBSIZE, TBSIZE, TBSIZE, TBSIZE, sizeof(TBBUTTON)); + + // Show the windows + ShowWindow(hwnd, SW_SHOW); + UpdateWindow(hwnd); + + // Load the tree + int error = PML_LoadTree(&tree, "tree.xml", AddItem); + + if(error) + { + MessageBox(0,PML_TransError(error),0,0); + return 0; + } + + // Read the help + Help(); + + // Start getting messages + while(GetMessage(&msg,NULL,0,0)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + + // Close our handle + PML_CloseTree (tree); + + return 0; +} + +// Add a item to our tree +int AddItem (int id, const char* name, int parent, int icon) +{ + TV_INSERTSTRUCT tvins; + + tvins.item.lParam = (UINT)id; + tvins.item.mask = TVIF_TEXT|TVIF_PARAM; + tvins.item.pszText = (WCHAR*)name; //that is ok + tvins.item.cchTextMax = strlen(name); + tvins.hInsertAfter = TVI_LAST; + + if(icon) + { + tvins.item.iImage = icon; + tvins.item.iSelectedImage = icon; + tvins.item.mask |= TVIF_IMAGE | TVIF_SELECTEDIMAGE; + } + + if (parent==0) + tvins.hParent = TVI_ROOT; + else + tvins.hParent = nodes[parent]; + + nodes[id] = (HTREEITEM)SendMessage(hTree, TVM_INSERTITEMA, 0, (LPARAM)&tvins); + + return 0; +} + +// Load the Help from file and display it +void Help (void) +{ + string source; + + ifstream file("help.txt", ios_base::in); + getline(file, source, '\0'); + + SetText(source.c_str()); +} + +// Create our Controls +void InitControls (HWND hwnd) +{ + + HINSTANCE hinst = GetModuleHandle(NULL); + + // Create the controls + hTree = CreateWindowEx(0, WC_TREEVIEW, L"TreeView", WS_CHILD|WS_VISIBLE|WS_BORDER|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTON S, + 0, 0, 0, 0, hwnd, NULL, hinst, NULL); + + hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, L"edit", PML_TransError(IDS_LOAD), WS_CHILD|WS_VISIBLE|ES_MULTILINE, + 0, 0, 100, 100, hwnd, NULL, hinst, NULL); + + hPopup = LoadMenu(hinst, MAKEINTRESOURCE(IDR_POPUP)); + + // Create Tree Icons + HIMAGELIST hIcon = ImageList_Create(16,16,ILC_COLOR32,1,1); + SendMessage(hTree, TVM_SETIMAGELIST, TVSIL_NORMAL, (LPARAM)(HIMAGELIST)hIcon); + + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(1))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(11))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(12))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(13))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(14))); + + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(2))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(3))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(4))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(5))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(6))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(7))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(8))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(9))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(10))); + + // Setup Hotkeys + RegisterHotKey(hwnd, 1, MOD_CONTROL, VK_1); + RegisterHotKey(hwnd, 2, MOD_CONTROL, VK_2); + RegisterHotKey(hwnd, 3, MOD_CONTROL, VK_3); + RegisterHotKey(hwnd, 4, MOD_CONTROL, VK_4); + RegisterHotKey(hwnd, 0, MOD_CONTROL, VK_0); +} + +// Set the Icons +int SetIcon (int id, int icon) +{ + TVITEMEX item; + + item.hItem = nodes[id]; + item.iImage = icon; + item.iSelectedImage = icon; + item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE; + + TreeView_SetItem(hTree, &item); + + return 1; +} + +// En- or Disable a Button inside of the toolbar and the Context Menu +int SetButton (DWORD id, BOOL state) +{ + // Change the Toorbar Button + TBBUTTONINFO ti; + + ti.cbSize = sizeof (ti); + ti.dwMask = TBIF_STATE; + + if(state) + ti.fsState = TBSTATE_ENABLED; + else + ti.fsState = TBSTATE_INDETERMINATE; + + SendMessage (hTBar, TB_SETBUTTONINFO, id, (LPARAM)&ti); + + // Change the Context Menu item + MENUITEMINFO mi; + + mi.cbSize = sizeof (mi); + mi.fMask = MIIM_STATE; + + if(state) + mi.fState = MFS_ENABLED; + + else + mi.fState = MFS_GRAYED; + + SetMenuItemInfo(hPopup, id, FALSE, &mi); + + return 1; +} + +// Set the text of the text box +int SetText (const char* text) +{ + int i = 0; + string source = text; + + // the windows does not need "\n" + // for new lines but "\r\n" + for(i=0; source[i]; i++) + if(source[i]=='\n' && source[i]!='\r') + source.insert (i++, "\r"); + + SetWindowTextA(hEdit, source.c_str()); + + return 0; +} + +// Windows Message Callback (this is where most things happen) +LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + // at the very beginning ... + case WM_CREATE: + { + InitControls(hwnd); + } + break; + + // calculate the size of the controls + case WM_SIZE: + { + RECT rcl; + SendMessage(hTBar, TB_AUTOSIZE, 0L, 0L); + GetWindowRect(hTBar, &rcl); + + int win_top = rcl.bottom - rcl.top; + int win_hight = HIWORD(lParam) - win_top; + + MoveWindow(hTree, 0, win_top, LOWORD(lParam), splitter_pos*win_hight/100, TRUE); + MoveWindow(hEdit, 0, (splitter_pos*win_hight/100)+win_top, LOWORD(lParam), win_hight, TRUE); + } + break; + + // for the treeview + case WM_NOTIFY: + { + if(((LPNMHDR)lParam)->code == TVN_SELCHANGED) + { + selected = ((LPNMTREEVIEW)lParam)->itemNew.lParam; + PML_LoadPackage (tree, selected, SetButton, SetText); + } + + else if ((int)(((LPNMHDR)lParam)->code) == NM_RCLICK) // <= ahhh LISP + { + // which item has been click on + HTREEITEM item = TreeView_GetDropHilight(hTree); + + if(item != NULL) + { + // mark the one as seleacted + SendMessage (hTree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)item); + TreeView_EnsureVisible (hTree, item); + } + + // create the context menu + if(selected != 0) + { + POINT pt; + GetCursorPos (&pt); + TrackPopupMenu (GetSubMenu(hPopup, 0), 0, (UINT)pt.x, (UINT)pt.y, 0, hwnd, NULL); + } + } + } + break; + + // for the toolbar + case WM_COMMAND: + { + // All Actions + if(LOWORD(wParam) <= 5 && LOWORD(wParam) >= 1) + { + if(selected) + if(PML_SetAction(tree, selected, LOWORD(wParam)-1, SetIcon) == ERR_OK) + break; + + MessageBeep(MB_ICONHAND); + } + + // DoIt + else if(LOWORD(wParam)==6) + { + if(PML_DoIt(tree, SetStatus) == ERR_OK) + DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DOIT), hwnd, StatusProc); + else + MessageBeep(MB_ICONHAND); + } + + // Help + else if(LOWORD(wParam)==7) + Help(); + + // Options + else if(LOWORD(wParam)==8) + DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_OPTIONS), hwnd, OptionsProc); + + else + MessageBox(0,0,0,0); + } + break; + + // prozess hotkeys + case WM_HOTKEY: + { + if(PML_SetAction(tree, selected, wParam, SetIcon) != ERR_OK) + MessageBeep(MB_ICONHAND); + } + break; + + // ... at the very end + case WM_DESTROY: + { + PostQuitMessage(0); + return 0; + } + } + + return DefWindowProc (hwnd, message, wParam, lParam); +} + +// Warning: This function is called from another thread +int SetStatus (int status1, int status2, WCHAR* text) +{ + // Set the Rage to 1000 + SendMessage(GetDlgItem(hStatus, IDC_STATUS1), PBM_SETRANGE32, 0, 1000); + SendMessage(GetDlgItem(hStatus, IDC_STATUS2), PBM_SETRANGE32, 0, 1000); + + // The prozessbars and the text filds + if(text) + SetDlgItemText(hStatus, IDC_TSTATUS, text); + + if(status1!=-1) + SendMessage(GetDlgItem(hStatus, IDC_STATUS1), PBM_SETPOS, status1, 0); + + if(status2!=-1) + SendMessage(GetDlgItem(hStatus, IDC_STATUS2), PBM_SETPOS, status2, 0); + + // If the Status is 1000 very thing is done + if(status1==1000) + { + EndDialog(hStatus, TRUE); + MessageBox(0,PML_TransError(status2),0,0); + } + + return 0; +} + +// Callback for the Status Dialog +INT_PTR CALLBACK StatusProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) + { + case WM_INITDIALOG: + { + hStatus = hwnd; + + } break; + + case WM_COMMAND: // can only be the about button + case WM_CLOSE: // the close-window-[x] + { + PML_Abort(); + EndDialog(hwnd, TRUE); + return 0; + } + } + + return 0; +} + +// Callback for the Options Dialog +INT_PTR CALLBACK OptionsProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) + { + case WM_CLOSE: + EndDialog(hwnd, TRUE); + return 0; + } + + return 0; +} _____ Added: trunk/rosapps/packmgr/gui/main.h --- trunk/rosapps/packmgr/gui/main.h 2005-04-03 15:47:15 UTC (rev 14480) +++ trunk/rosapps/packmgr/gui/main.h 2005-04-03 19:06:49 UTC (rev 14481) @@ -0,0 +1,62 @@ +/////////////////////////////////////////////////// +// +// main.h +// main.cpp's lumber room :) +/////////////////////////////////////////////////// + +#include <windows.h> +#include <ntos/keyboard.h> +#include <commctrl.h> +#include <iostream> +#include <fstream> + +#include <package.hpp> +#include "resource.h" + +/* Some Variables */ + +int selected, splitter_pos = 50; + +pTree tree; +HMENU hPopup; +HWND hTBar, hTree, hEdit, hStatus; +HTREEITEM nodes [MAXNODES]; + +/* Window Callbacks */ + +LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); +INT_PTR CALLBACK StatusProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK OptionsProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); + +/* Prototypes */ + +void Help (void); + +int AddItem (int id, const char* name, int parent, int icon); +int SetText (const char* text); +int SetStatus (int status1, int status2, WCHAR* text); + +/* Toolbar Releated */ + +#define TBSTYLE_FLAT 2048 + +// This is the struct where the toolbar is defined +TBBUTTON Buttons [] = +{ + {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0L, 0}, + + {0, 1, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON, 0L, 0}, // No Action + {1, 2, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON, 0L, 0}, // Install + {2, 3, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON, 0L, 0}, // Install from source + {3, 4, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON, 0L, 0}, // Update + {4, 5, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON, 0L, 0}, // Unistall + + {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0L, 0}, + {5, 6, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0}, // DoIt (tm) + {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0L, 0}, + + {6, 7, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0}, // Help + {7, 8, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0}, // Options + + {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0L, 0}, +}; _____ Added: trunk/rosapps/packmgr/gui/makefile --- trunk/rosapps/packmgr/gui/makefile 2005-04-03 15:47:15 UTC (rev 14480) +++ trunk/rosapps/packmgr/gui/makefile 2005-04-03 19:06:49 UTC (rev 14481) @@ -0,0 +1,24 @@ + +TARGET_NAME = packmgr +TARGET_TYPE = program +TARGET_APPTYPE = windows +PATH_TO_TOP = ../../../reactos + +TARGET_SDKLIBS = kernel32.a user32.a package.a gdi32.a comctl32.a shell32.a + +TARGET_GCCLIBS = stdc++ uuid + +TARGET_OBJECTS = main.o + + +TARGET_CFLAGS = \ + -D__USE_W32API -DWIN32 -D_ROS_ \ + -D_WIN32_IE=0x0501 -D_WIN32_WINNT=0x0501 \ + -DUNICODE -Wall -I../lib + +TARGET_CPPFLAGS = $(TARGET_CFLAGS) +TARGET_RCFLAGS = -D__USE_W32API -DNDEBUG -DWIN32 -D_ROS_ -D__WINDRES__ -DUNICODE + +include $(PATH_TO_TOP)/rules.mak +include $(TOOLS_PATH)/helper.mk +include $(TOOLS_PATH)/depend.mk _____ Added: trunk/rosapps/packmgr/gui/packmgr.rc --- trunk/rosapps/packmgr/gui/packmgr.rc 2005-04-03 15:47:15 UTC (rev 14480) +++ trunk/rosapps/packmgr/gui/packmgr.rc 2005-04-03 19:06:49 UTC (rev 14481) @@ -0,0 +1,18 @@ + +#include <windows.h> +#include "resource.h" + +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Package Manager\0" +#define REACTOS_STR_INTERNAL_NAME "packmgr\0" +#define REACTOS_STR_ORIGINAL_FILENAME "packmgr.exe\0" + +#include <reactos/version.rc> + +/* For all langs */ +#include "generic.rc" + +/* Language specific */ + +#include "en.rc" + +/* EOF */ _____ Added: trunk/rosapps/packmgr/gui/res/blank.ico (Binary files differ) Property changes on: trunk/rosapps/packmgr/gui/res/blank.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream _____ Added: trunk/rosapps/packmgr/gui/res/development.ico (Binary files differ) Property changes on: trunk/rosapps/packmgr/gui/res/development.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream _____ Added: trunk/rosapps/packmgr/gui/res/games.ico (Binary files differ) Property changes on: trunk/rosapps/packmgr/gui/res/games.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream _____ Added: trunk/rosapps/packmgr/gui/res/graphics.ico (Binary files differ) Property changes on: trunk/rosapps/packmgr/gui/res/graphics.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream _____ Added: trunk/rosapps/packmgr/gui/res/inet.ico (Binary files differ) Property changes on: trunk/rosapps/packmgr/gui/res/inet.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream _____ Added: trunk/rosapps/packmgr/gui/res/install.ico (Binary files differ) Property changes on: trunk/rosapps/packmgr/gui/res/install.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream _____ Added: trunk/rosapps/packmgr/gui/res/installed.ico (Binary files differ) Property changes on: trunk/rosapps/packmgr/gui/res/installed.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream _____ Added: trunk/rosapps/packmgr/gui/res/installsource.ico (Binary files differ) Property changes on: trunk/rosapps/packmgr/gui/res/installsource.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream _____ Added: trunk/rosapps/packmgr/gui/res/multimedia.ico (Binary files differ) Property changes on: trunk/rosapps/packmgr/gui/res/multimedia.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream _____ Added: trunk/rosapps/packmgr/gui/res/office.ico (Binary files differ) Property changes on: trunk/rosapps/packmgr/gui/res/office.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream _____ Added: trunk/rosapps/packmgr/gui/res/others.ico (Binary files differ) Property changes on: trunk/rosapps/packmgr/gui/res/others.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream _____ Added: trunk/rosapps/packmgr/gui/res/packetmanager.ico (Binary files differ) Property changes on: trunk/rosapps/packmgr/gui/res/packetmanager.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream _____ Added: trunk/rosapps/packmgr/gui/res/toolbar.bmp (Binary files differ) Property changes on: trunk/rosapps/packmgr/gui/res/toolbar.bmp ___________________________________________________________________ Name: svn:mime-type + application/octet-stream _____ Added: trunk/rosapps/packmgr/gui/res/tools.ico (Binary files differ) Property changes on: trunk/rosapps/packmgr/gui/res/tools.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream _____ Added: trunk/rosapps/packmgr/gui/res/uninstall.ico (Binary files differ) Property changes on: trunk/rosapps/packmgr/gui/res/uninstall.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream _____ Added: trunk/rosapps/packmgr/gui/res/update.ico (Binary files differ) Property changes on: trunk/rosapps/packmgr/gui/res/update.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream _____ Added: trunk/rosapps/packmgr/gui/resource.h --- trunk/rosapps/packmgr/gui/resource.h 2005-04-03 15:47:15 UTC (rev 14480) +++ trunk/rosapps/packmgr/gui/resource.h 2005-04-03 19:06:49 UTC (rev 14481) @@ -0,0 +1,14 @@ +#include "../lib/error.h" + +#define IDI_MAIN 0 + +#define TBSIZE 32 +#define IDB_TOOLBAR 0x102 +#define IDD_OPTIONS 0x103 +#define IDD_DOIT 0x104 +#define IDR_POPUP 0x105 + +#define IDC_STATUS1 0x110 +#define IDC_STATUS2 0x111 +#define IDC_CANCEL 0x112 +#define IDC_TSTATUS 0x113 _____ Added: trunk/rosapps/packmgr/help.txt --- trunk/rosapps/packmgr/help.txt 2005-04-03 15:47:15 UTC (rev 14480) +++ trunk/rosapps/packmgr/help.txt 2005-04-03 19:06:49 UTC (rev 14481) @@ -0,0 +1,9 @@ +Welcome to ReactOS's Package Manager ! + +WARNING: This is still pre-alfa software you can't do much with it yet. + +This is the online help. You can show it at any time by clicking on the the Questionmark Icon above. + +You can use this package manager like this: click on the +You can also use the Buttons [ctrl] + [0] to [4] to set the action. + _____ Added: trunk/rosapps/packmgr/lib/download.cpp --- trunk/rosapps/packmgr/lib/download.cpp 2005-04-03 15:47:15 UTC (rev 14480) +++ trunk/rosapps/packmgr/lib/download.cpp 2005-04-03 19:06:49 UTC (rev 14481) @@ -0,0 +1,117 @@ +//////////////////////////////////////////////////////// +// +// download.cpp +// +// Stuff related to downloading +// +// +// Maarten Bosma, 09.01.2004 +// maarten.paul(a)bosma.de +// +//////////////////////////////////////////////////////// + +#include "package.hpp" +#include "expat.h" +#include "log.h" +#include <wine/urlmon.h> + +// Server there all the files lie +const char* tree_server = "
http://svn.reactos.com/viewcvs/*checkout*/trunk/rosapps/packmgr/tree/
"; + +HRESULT WINAPI URLDownloadToFileA( + LPUNKNOWN pCaller, + LPCSTR szURL, + LPCSTR szFileName, + DWORD dwReserved, + LPBINDSTATUSCALLBACK lpfnCB +); + + +// Download a file +char* PML_Download (const char* name, const char* local_name = "packmgr.txt", const char* server = tree_server, BOOL totemp = TRUE) +{ + char url [MAX_PATH]; + static char path [MAX_PATH]; + + // get temp dir + if(totemp) + GetTempPathA (200, path); + + // create the local file name + if(local_name) + strcat(path, local_name); + else + strcat(path, "tmp.tmp"); + + // get the url + if(server) strcpy(url, server); + strcat(url, name); + + // make sure there is no old file + DeleteFileA (path); + + // download the file + if(URLDownloadToFileA (NULL, url, path, 0, NULL) != S_OK) + { + Log("! ERROR: Unable to download "); + LogAdd(url); + + return NULL; + } + + return path; +} + +// Download and prozess a xml file +int PML_XmlDownload (const char* url, void* usrdata, XML_StartElementHandler start, + XML_EndElementHandler end, XML_CharacterDataHandler text) +{ + char buffer[255]; + int done = 0; + + // logging + Log("* prozess the xml file: "); + LogAdd(url); + + // download the file + char* filename = PML_Download(url); + + if(!filename) + { + Log("! ERROR: Could not download the xml file"); + return ERR_DOWNL; + } + + // open the file + FILE* file = fopen(filename, "r"); + if(!file) + { + Log("! ERROR: Could not open the xml file"); + return ERR_GENERIC; + } + + // parse the xml file + XML_Parser parser = XML_ParserCreate(NULL); + XML_SetUserData (parser, usrdata); + XML_SetElementHandler(parser, start, end); + XML_SetCharacterDataHandler(parser, text); + + while (!done) + { + size_t len = fread (buffer, 1, sizeof(buffer), file); + done = len < sizeof(buffer); + + buffer[len] = 0; + if(!XML_Parse(parser, buffer, len, done)) + { + Log("! ERROR: Could not parse the xml file"); + return ERR_GENERIC; + } + } + + XML_ParserFree(parser); + fclose(file); + + return ERR_OK; +} + _____ Added: trunk/rosapps/packmgr/lib/en.rc --- trunk/rosapps/packmgr/lib/en.rc 2005-04-03 15:47:15 UTC (rev 14480) +++ trunk/rosapps/packmgr/lib/en.rc 2005-04-03 19:06:49 UTC (rev 14481) @@ -0,0 +1,19 @@ + +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +/* String Tables */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_LOAD "Loading ..." + ERR_OK "Operation done." + ERR_PACK "Not all packages could be installed\n\nPlease have a look at the log file for details." + ERR_GENERIC "An error occured. \nFor more information please have a look at the log file." + ERR_DOWNL "A needed file could not be downloaded!\nFor more information please have a look at the log file." + ERR_FILE "Error while Script Execution.\nFile could not be opened." + + ERR_SYNATX "Error while Script Execution.\nWrong Synatx." + ERR_CALL "Error while Script Execution.\nCould not find function." + ERR_PARAMETER "Error while Script Execution.\nWrong Parameter(s)." +END + +/* EOF */ _____ Added: trunk/rosapps/packmgr/lib/error.h --- trunk/rosapps/packmgr/lib/error.h 2005-04-03 15:47:15 UTC (rev 14480) +++ trunk/rosapps/packmgr/lib/error.h 2005-04-03 19:06:49 UTC (rev 14481) @@ -0,0 +1,16 @@ +// error.h + +#define ERR_OK 0x000 +#define ERR_GENERIC 0x001 +#define ERR_DOWNL 0x002 +#define ERR_NOTODO 0x003 // without text yet +#define ERR_PACK 0x004 + +// Script +#define ERR_SYNATX 0x011 +#define ERR_CALL 0x012 +#define ERR_PARAMETER 0x013 +#define ERR_FILE 0x014 + +#define IDS_LOAD 0x254 +#define NOTFOUND -1 _____ Added: trunk/rosapps/packmgr/lib/expat.h --- trunk/rosapps/packmgr/lib/expat.h 2005-04-03 15:47:15 UTC (rev 14480) +++ trunk/rosapps/packmgr/lib/expat.h 2005-04-03 19:06:49 UTC (rev 14481) @@ -0,0 +1,1081 @@ +/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd + See the file COPYING for copying permission. +*/ + +#ifndef XmlParse_INCLUDED +#define XmlParse_INCLUDED 1 + +#ifdef __VMS +/* 0 1 2 3 0 1 2 3 + 1234567890123456789012345678901 1234567890123456789012345678901 */ +#define XML_SetProcessingInstructionHandler XML_SetProcessingInstrHandler +#define XML_SetUnparsedEntityDeclHandler XML_SetUnparsedEntDeclHandler +#define XML_SetStartNamespaceDeclHandler XML_SetStartNamespcDeclHandler +#define XML_SetExternalEntityRefHandlerArg XML_SetExternalEntRefHandlerArg +#endif + +#include <stdlib.h> + +#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) +#define XML_USE_MSC_EXTENSIONS 1 +#endif + +/* Expat tries very hard to make the API boundary very specifically + defined. There are two macros defined to control this boundary; + each of these can be defined before including this header to + achieve some different behavior, but doing so it not recommended or + tested frequently. + + XMLCALL - The calling convention to use for all calls across the + "library boundary." This will default to cdecl, and + try really hard to tell the compiler that's what we + want. + + XMLIMPORT - Whatever magic is needed to note that a function is + to be imported from a dynamically loaded library + (.dll, .so, or .sl, depending on your platform). + + The XMLCALL macro was added in Expat 1.95.7. The only one which is + expected to be directly useful in client code is XMLCALL. + + Note that on at least some Unix versions, the Expat library must be + compiled with the cdecl calling convention as the default since + system headers may assume the cdecl convention. +*/ +#ifndef XMLCALL +#if defined(XML_USE_MSC_EXTENSIONS) +#define XMLCALL __cdecl +#elif defined(__GNUC__) && defined(__i386) +//MF#define XMLCALL __attribute__((cdecl)) +#define XMLCALL//MF +#else +/* For any platform which uses this definition and supports more than + one calling convention, we need to extend this definition to + declare the convention used on that platform, if it's possible to + do so. + + If this is the case for your platform, please file a bug report + with information on how to identify your platform via the C + pre-processor and how to specify the same calling convention as the + platform's malloc() implementation. +*/ +#define XMLCALL +#endif +#endif /* not defined XMLCALL */ + + +#if !defined(XML_STATIC) && !defined(XMLIMPORT) +#ifndef XML_BUILDING_EXPAT +/* using Expat from an application */ + +#ifdef XML_USE_MSC_EXTENSIONS +#define XMLIMPORT __declspec(dllimport) +#endif + +#endif +#endif /* not defined XML_STATIC */ + +/* If we didn't define it above, define it away: */ +#ifndef XMLIMPORT +#define XMLIMPORT +#endif [truncated at 1000 lines; 2399 more skipped]
19 years, 7 months
1
0
0
0
[hbirr] 14480: Removed some calls to NtOpenProcess. They aren't necessary because the process data structure contains already a process handle.
by hbirr@svn.reactos.com
Removed some calls to NtOpenProcess. They aren't necessary because the process data structure contains already a process handle. Modified: trunk/reactos/subsys/csrss/api/process.c Modified: trunk/reactos/subsys/csrss/win32csr/conio.c _____ Modified: trunk/reactos/subsys/csrss/api/process.c --- trunk/reactos/subsys/csrss/api/process.c 2005-04-03 14:38:42 UTC (rev 14479) +++ trunk/reactos/subsys/csrss/api/process.c 2005-04-03 15:47:15 UTC (rev 14480) @@ -95,7 +95,7 @@ /* using OpenProcess is not optimal due to HANDLE vs. DWORD PIDs... */ Status = NtOpenProcess(&pProcessData->Process, PROCESS_DUP_HANDLE | PROCESS_VM_OPERATION | - PROCESS_VM_WRITE | PROCESS_CREATE_THREAD, + PROCESS_VM_WRITE | PROCESS_CREATE_THREAD | SYNCHRONIZE, &ObjectAttributes, &ClientId); if (!NT_SUCCESS(Status)) @@ -195,7 +195,6 @@ { PCSRSS_PROCESS_DATA NewProcessData; NTSTATUS Status; - HANDLE Process; CSRSS_API_REQUEST ApiRequest; CSRSS_API_REPLY ApiReply; @@ -240,8 +239,6 @@ } else { - CLIENT_ID ClientId; - NewProcessData->Console = ProcessData->Console; InterlockedIncrement( &(ProcessData->Console->Header.ReferenceCount) ); CsrInsertObject(NewProcessData, @@ -253,27 +250,15 @@ &(NewProcessData->Console->ActiveBuffer->Header) ); RtlLeaveCriticalSection(&ProcessDataLock); - ClientId.UniqueProcess = (HANDLE)NewProcessData->ProcessId; - Status = NtOpenProcess( &Process, PROCESS_DUP_HANDLE, 0, &ClientId ); + Status = NtDuplicateObject( NtCurrentProcess(), NewProcessData->Console->ActiveEvent, NewProcessData->Process, &NewProcessData->ConsoleEvent, SYNCHRONIZE, FALSE, 0 ); if( !NT_SUCCESS( Status ) ) { - DbgPrint( "CSR: NtOpenProcess() failed for handle duplication\n" ); - InterlockedDecrement( &(NewProcessData->Console->Header.ReferenceCount) ); - CsrFreeProcessData( NewProcessData->ProcessId ); - Reply->Status = Status; - return Status; - } - Status = NtDuplicateObject( NtCurrentProcess(), NewProcessData->Console->ActiveEvent, Process, &NewProcessData->ConsoleEvent, SYNCHRONIZE, FALSE, 0 ); - if( !NT_SUCCESS( Status ) ) - { DbgPrint( "CSR: NtDuplicateObject() failed: %x\n", Status ); - NtClose( Process ); InterlockedDecrement( &(NewProcessData->Console->Header.ReferenceCount) ); CsrFreeProcessData( NewProcessData->ProcessId ); Reply->Status = Status; return Status; } - NtClose( Process ); NewProcessData->CtrlDispatcher = Request->Data.CreateProcessRequest.CtrlDispatcher; RtlEnterCriticalSection(&ProcessDataLock ); InsertHeadList(&NewProcessData->Console->ProcessList, &NewProcessData->ProcessEntry); _____ Modified: trunk/reactos/subsys/csrss/win32csr/conio.c --- trunk/reactos/subsys/csrss/win32csr/conio.c 2005-04-03 14:38:42 UTC (rev 14479) +++ trunk/reactos/subsys/csrss/win32csr/conio.c 2005-04-03 15:47:15 UTC (rev 14480) @@ -238,9 +238,6 @@ CSR_API(CsrAllocConsole) { PCSRSS_CONSOLE Console; - OBJECT_ATTRIBUTES ObjectAttributes; - CLIENT_ID ClientId; - HANDLE Process; NTSTATUS Status; DPRINT("CsrAllocConsole\n"); @@ -293,35 +290,10 @@ return Reply->Status = Status; } - ClientId.UniqueThread = NULL; - ClientId.UniqueProcess = ProcessData->ProcessId; - InitializeObjectAttributes(&ObjectAttributes, - NULL, - 0, - NULL, - NULL); - - /* using OpenProcess is not optimal due to HANDLE vs. DWORD PIDs... */ - Status = NtOpenProcess(&Process, - PROCESS_DUP_HANDLE, - &ObjectAttributes, - &ClientId); - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtOpenProcess() failed for handle duplication, Status: 0x%x\n", Status); - Console->Header.ReferenceCount--; - ProcessData->Console = 0; - Win32CsrReleaseObject(ProcessData, Reply->Data.AllocConsoleReply.OutputHandle); - Win32CsrReleaseObject(ProcessData, Reply->Data.AllocConsoleReply.InputHandle); - Reply->Status = Status; - return Status; - } - if (! DuplicateHandle(GetCurrentProcess(), ProcessData->Console->ActiveEvent, - Process, &ProcessData->ConsoleEvent, EVENT_ALL_ACCESS, FALSE, 0)) + ProcessData->Process, &ProcessData->ConsoleEvent, EVENT_ALL_ACCESS, FALSE, 0)) { DPRINT1("DuplicateHandle() failed: %d\n", GetLastError); - CloseHandle(Process); Console->Header.ReferenceCount--; Win32CsrReleaseObject(ProcessData, Reply->Data.AllocConsoleReply.OutputHandle); Win32CsrReleaseObject(ProcessData, Reply->Data.AllocConsoleReply.InputHandle); @@ -329,7 +301,6 @@ Reply->Status = Status; return Status; } - CloseHandle(Process); ProcessData->CtrlDispatcher = Request->Data.AllocConsoleRequest.CtrlDispatcher; DPRINT("CSRSS:CtrlDispatcher address: %x\n", ProcessData->CtrlDispatcher); InsertHeadList(&ProcessData->Console->ProcessList, &ProcessData->ProcessEntry);
19 years, 7 months
1
0
0
0
[ea] 14479: WinTrust.dll: Update EXPORTS table
by ea@svn.reactos.com
WinTrust.dll: Update EXPORTS table Modified: trunk/reactos/lib/wintrust/wintrust.def _____ Modified: trunk/reactos/lib/wintrust/wintrust.def --- trunk/reactos/lib/wintrust/wintrust.def 2005-04-03 14:32:47 UTC (rev 14478) +++ trunk/reactos/lib/wintrust/wintrust.def 2005-04-03 14:38:42 UTC (rev 14479) @@ -1,3 +1,131 @@ - LIBRARY wintrust.dll +EXPORTS +;CryptCATVerifyMember +;CryptSIPGetInfo +;CryptSIPGetRegWorkingFlags +;GenericChainCertificateTrust +;GenericChainFinalProv +;HTTPSCertificateTrust +;SoftpubDefCertInit +;SoftpubFreeDefUsageCallData +;SoftpubLoadDefUsageCallData +;WTHelperCertFindIssuerCertificate +;AddPersonalTrustDBPages +;CatalogCompactHashDatabase +;CryptCATAdminAcquireContext +;CryptCATAdminAddCatalog +;CryptCATAdminCalcHashFromFileHandle +;CryptCATAdminEnumCatalogFromHash +;CryptCATAdminPauseServiceForBackup +;CryptCATAdminReleaseCatalogContext +;CryptCATAdminReleaseContext +;CryptCATAdminRemoveCatalog +;CryptCATAdminResolveCatalogPath +;CryptCATCDFClose +;CryptCATCDFEnumAttributes +;CryptCATCDFEnumAttributesWithCDFTag +;CryptCATCDFEnumCatAttributes +;CryptCATCDFEnumMembers +;CryptCATCDFEnumMembersByCDFTag +;CryptCATCDFEnumMembersByCDFTagEx +;CryptCATCDFOpen +;CryptCATCatalogInfoFromContext +;CryptCATClose +;CryptCATEnumerateAttr +;CryptCATEnumerateCatAttr +;CryptCATEnumerateMember +;CryptCATGetAttrInfo +;CryptCATGetCatAttrInfo +;CryptCATGetMemberInfo +;CryptCATHandleFromStore +;CryptCATOpen +;CryptCATPersistStore +;CryptCATPutAttrInfo +;CryptCATPutCatAttrInfo +;CryptCATPutMemberInfo +;CryptCATStoreFromHandle +;CryptSIPCreateIndirectData +;CryptSIPGetSignedDataMsg +;CryptSIPPutSignedDataMsg +;CryptSIPRemoveSignedDataMsg +;CryptSIPVerifyIndirectData +;DllRegisterServer +;DllUnregisterServer +;DriverCleanupPolicy +;DriverFinalPolicy +;DriverInitializePolicy +;FindCertsByIssuer +;HTTPSFinalProv +;I_CryptCatAdminMigrateToNewCatDB +;IsCatalogFile +;MsCatConstructHashTag +;MsCatFreeHashTag +;OfficeCleanupPolicy +;OfficeInitializePolicy +;OpenPersonalTrustDBDialog +;OpenPersonalTrustDBDialogEx +;SoftpubAuthenticode +;SoftpubCheckCert +;SoftpubCleanup +;SoftpubDllRegisterServer +;SoftpubDllUnregisterServer +;SoftpubDumpStructure +;SoftpubInitialize +;SoftpubLoadMessage +;SoftpubLoadSignature +;TrustDecode +;TrustFindIssuerCertificate +;TrustFreeDecode +;TrustIsCertificateSelfSigned +;TrustOpenStores +;WTHelperCertCheckValidSignature +;WTHelperCertIsSelfSigned +;WTHelperCheckCertUsage +;WTHelperGetAgencyInfo +;WTHelperGetFileHandle +;WTHelperGetFileHash +;WTHelperGetFileName +;WTHelperGetKnownUsages +;WTHelperGetProvCertFromChain +;WTHelperGetProvPrivateDataFromChain +;WTHelperGetProvSignerFromChain +;WTHelperIsInRootStore +;WTHelperOpenKnownStores +;WTHelperProvDataFromStateData +;WVTAsn1CatMemberInfoDecode +;WVTAsn1CatMemberInfoEncode +;WVTAsn1CatNameValueDecode +;WVTAsn1CatNameValueEncode +;WVTAsn1SpcFinancialCriteriaInfoDecode +;WVTAsn1SpcFinancialCriteriaInfoEncode +;WVTAsn1SpcIndirectDataContentDecode +;WVTAsn1SpcIndirectDataContentEncode +;WVTAsn1SpcLinkDecode +;WVTAsn1SpcLinkEncode +;WVTAsn1SpcMinimalCriteriaInfoDecode +;WVTAsn1SpcMinimalCriteriaInfoEncode +;WVTAsn1SpcPeImageDataDecode +;WVTAsn1SpcPeImageDataEncode +;WVTAsn1SpcSigInfoDecode +;WVTAsn1SpcSigInfoEncode +;WVTAsn1SpcSpAgencyInfoDecode +;WVTAsn1SpcSpAgencyInfoEncode +;WVTAsn1SpcSpOpusInfoDecode +;WVTAsn1SpcSpOpusInfoEncode +;WVTAsn1SpcStatementTypeDecode +;WVTAsn1SpcStatementTypeEncode +WinVerifyTrust@12 +;WinVerifyTrustEx +WintrustAddActionID +;WintrustAddDefaultForUsage +;WintrustCertificateTrust +;WintrustGetDefaultForUsage +;WintrustGetRegPolicyFlags +;WintrustLoadFunctionPointers +;WintrustRemoveActionID +;WintrustSetRegPolicyFlags +;mscat32DllRegisterServer +;mscat32DllUnregisterServer +;mssip32DllRegisterServer +;mssip32DllUnregisterServer ; EOF
19 years, 7 months
1
0
0
0
[mf] 14478: activate printer folder menu
by mf@svn.reactos.com
activate printer folder menu Modified: trunk/reactos/subsys/system/explorer/shell/entries.cpp Modified: trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp Modified: trunk/reactos/subsys/system/explorer/shell/shellfs.cpp Modified: trunk/reactos/subsys/system/explorer/taskbar/desktopbar.h Modified: trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp _____ Modified: trunk/reactos/subsys/system/explorer/shell/entries.cpp --- trunk/reactos/subsys/system/explorer/shell/entries.cpp 2005-04-03 13:45:23 UTC (rev 14477) +++ trunk/reactos/subsys/system/explorer/shell/entries.cpp 2005-04-03 14:32:47 UTC (rev 14478) @@ -323,7 +323,7 @@ ICON_ID icon_id = ICID_NONE; - if (get_path(path)) + if (get_path(path) && _tcsncmp(path,TEXT("::{"),3)) icon_id = g_Globals._icon_cache.extract(path); if (icon_id == ICID_NONE) { _____ Modified: trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp --- trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp 2005-04-03 13:45:23 UTC (rev 14477) +++ trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp 2005-04-03 14:32:47 UTC (rev 14478) @@ -485,6 +485,9 @@ _shellpath_info(info) //@@ copies info -> no referenz to _create_info ! { /**todo Conversion of shell path into path string -> store into URL history + const String& path = GetDesktopFolder().get_name(info._shell_path, SHGDN_FORADDRESSBAR); + const String& parsingpath = GetDesktopFolder().get_name(info._shell_path, SHGDN_FORPARSING); + // store path into history if (info._path && *info._path) _url_history.push(info._path); _____ Modified: trunk/reactos/subsys/system/explorer/shell/shellfs.cpp --- trunk/reactos/subsys/system/explorer/shell/shellfs.cpp 2005-04-03 13:45:23 UTC (rev 14477) +++ trunk/reactos/subsys/system/explorer/shell/shellfs.cpp 2005-04-03 14:32:47 UTC (rev 14478) @@ -235,7 +235,7 @@ TCHAR buffer[MAX_PATH]; - if ((scan_flags&SCAN_FILESYSTEM) && get_path(buffer)) { + if ((scan_flags&SCAN_FILESYSTEM) && get_path(buffer) && _tcsncmp(buffer,TEXT("::{"),3)) { Entry* entry = NULL; // eliminate useless GCC warning by initializing entry LPTSTR p = buffer + _tcslen(buffer); _____ Modified: trunk/reactos/subsys/system/explorer/taskbar/desktopbar.h --- trunk/reactos/subsys/system/explorer/taskbar/desktopbar.h 2005-04-03 13:45:23 UTC (rev 14477) +++ trunk/reactos/subsys/system/explorer/taskbar/desktopbar.h 2005-04-03 14:32:47 UTC (rev 14478) @@ -50,13 +50,14 @@ #define IDC_NETWORK 0x100E #define IDC_CONNECTIONS 0x100F #define IDC_DRIVES 0x1010 -#define IDC_SETTINGS_MENU 0x1011 -#define IDC_CONTROL_PANEL 0x1012 +#define IDC_CONTROL_PANEL 0x1011 +#define IDC_SETTINGS_MENU 0x1012 #define IDC_PRINTERS 0x1013 -#define IDC_BROWSE 0x1014 -#define IDC_SEARCH_PROGRAM 0x1015 -#define IDC_SEARCH 0x1016 -#define IDC_TERMINATE 0x1017 +#define IDC_PRINTERS_MENU 0x1014 +#define IDC_BROWSE 0x1015 +#define IDC_SEARCH_PROGRAM 0x1016 +#define IDC_SEARCH 0x1017 +#define IDC_TERMINATE 0x1018 #define IDC_FIRST_MENU 0x3000 _____ Modified: trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp --- trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp 2005-04-03 13:45:23 UTC (rev 14477) +++ trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp 2005-04-03 14:32:47 UTC (rev 14478) @@ -1854,31 +1854,52 @@ ExplorerPropertySheet(g_Globals._hwndDesktopBar); break; + case IDC_CONTROL_PANEL: { + CloseStartMenu(id); +#ifndef _NO_MDI + XMLPos explorer_options = g_Globals.get_cfg("general/explorer"); + bool mdi = XMLBool(explorer_options, "mdi", true); + + if (mdi) + MDIMainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{ 21EC2020-3AEA-1069-A2DD-08002B30309D}"), 0); + else +#endif + SDIMainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{ 21EC2020-3AEA-1069-A2DD-08002B30309D}"), 0); + break;} + case IDC_SETTINGS_MENU: CreateSubmenu(id, CSIDL_CONTROLS, ResString(IDS_SETTINGS_MENU)); break; - case IDC_PRINTERS: + case IDC_PRINTERS: { + CloseStartMenu(id); #ifdef _ROS_ // to be removed when printer folder will be implemented MessageBox(0, TEXT("printer folder not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK); #else - CreateSubmenu(id, CSIDL_PRINTERS, CSIDL_PRINTHOOD, ResString(IDS_PRINTERS)); -#endif - break; - - case IDC_CONTROL_PANEL: { - CloseStartMenu(id); #ifndef _NO_MDI XMLPos explorer_options = g_Globals.get_cfg("general/explorer"); bool mdi = XMLBool(explorer_options, "mdi", true); if (mdi) - MDIMainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{ 21EC2020-3AEA-1069-A2DD-08002B30309D}"), 0); + MDIMainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{ 21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{2227A280-3AEA-1069-A2DE-08002B 30309D}"), 0); else #endif - SDIMainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{ 21EC2020-3AEA-1069-A2DD-08002B30309D}"), 0); + SDIMainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{ 21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{2227A280-3AEA-1069-A2DE-08002B 30309D}"), 0); +#endif break;} + case IDC_PRINTERS_MENU: + CreateSubmenu(id, CSIDL_PRINTERS, CSIDL_PRINTHOOD, ResString(IDS_PRINTERS)); +/* StartMenuFolders new_folders; + + try { + new_folders.push_back(ShellPath(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B3 0309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{2227A280-3AEA-1069- A2DE-08002B30309D}"))); + } catch(COMException&) { + } + + CreateSubmenu(id, new_folders, ResString(IDS_PRINTERS));*/ + break; + case IDC_ADMIN: CreateSubmenu(id, CSIDL_COMMON_ADMINTOOLS, CSIDL_ADMINTOOLS, ResString(IDS_ADMIN)); break; @@ -2009,16 +2030,11 @@ { super::AddEntries(); -#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) - if (!g_Globals._SHRestricted || !SHRestricted(REST_NOCONTROLPANEL)) -#endif - AddButton(ResString(IDS_CONTROL_PANEL), ICID_CONFIG, false, IDC_CONTROL_PANEL); - #ifdef _ROS_ // to be removed when printer/network will be implemented - AddButton(ResString(IDS_PRINTERS), ICID_PRINTER, false, IDC_PRINTERS); + AddButton(ResString(IDS_PRINTERS), ICID_PRINTER, false, IDC_PRINTERS_MENU); AddButton(ResString(IDS_CONNECTIONS), ICID_NETWORK, false, IDC_CONNECTIONS); #else - AddButton(ResString(IDS_PRINTERS), ICID_PRINTER, true, IDC_PRINTERS); + AddButton(ResString(IDS_PRINTERS), ICID_PRINTER, true, IDC_PRINTERS_MENU); AddButton(ResString(IDS_CONNECTIONS), ICID_NETWORK, true, IDC_CONNECTIONS); #endif AddButton(ResString(IDS_ADMIN), ICID_CONFIG, true, IDC_ADMIN); @@ -2029,6 +2045,13 @@ AddButton(ResString(IDS_SETTINGS_MENU), ICID_CONFIG, true, IDC_SETTINGS_MENU); AddButton(ResString(IDS_DESKTOPBAR_SETTINGS), ICID_CONFIG, false, ID_DESKTOPBAR_SETTINGS); + + AddButton(ResString(IDS_PRINTERS), ICID_PRINTER, false, IDC_PRINTERS); + +#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) + if (!g_Globals._SHRestricted || !SHRestricted(REST_NOCONTROLPANEL)) +#endif + AddButton(ResString(IDS_CONTROL_PANEL), ICID_CONFIG, false, IDC_CONTROL_PANEL); } void BrowseMenu::AddEntries()
19 years, 7 months
1
0
0
0
[greatlrd] 14477: minor change that I did forget
by greatlrd@svn.reactos.com
minor change that I did forget Modified: trunk/reactos/subsys/system/cmd/En.rc _____ Modified: trunk/reactos/subsys/system/cmd/En.rc --- trunk/reactos/subsys/system/cmd/En.rc 2005-04-03 13:40:15 UTC (rev 14476) +++ trunk/reactos/subsys/system/cmd/En.rc 2005-04-03 13:45:23 UTC (rev 14477) @@ -147,7 +147,7 @@ /%c Yes. Kill even *.* without asking.\n \ /%c Zap. Delete hidden, read-only and system files).\n" -STRING_DEL_HELP3, " %lu file%s deleted\n" +STRING_DEL_HELP3, " %lu file deleted\n" STRING_DEL_HELP4, " %lu files deleted\n"
19 years, 7 months
1
0
0
0
[greatlrd] 14476: Remove more hardcode string to En.rc
by greatlrd@svn.reactos.com
Remove more hardcode string to En.rc Modified: trunk/reactos/subsys/system/cmd/En.rc Modified: trunk/reactos/subsys/system/cmd/color.c Modified: trunk/reactos/subsys/system/cmd/copy.c Modified: trunk/reactos/subsys/system/cmd/del.c Modified: trunk/reactos/subsys/system/cmd/resource.h _____ Modified: trunk/reactos/subsys/system/cmd/En.rc --- trunk/reactos/subsys/system/cmd/En.rc 2005-04-03 13:04:10 UTC (rev 14475) +++ trunk/reactos/subsys/system/cmd/En.rc 2005-04-03 13:40:15 UTC (rev 14476) @@ -134,6 +134,23 @@ Type DATE without parameters to display the current date setting and\n \ a prompt for a new one. Press ENTER to keep the same date." +STRING_DEL_HELP1, "Deletes one or more files.\n\n \ +DEL [/%c /%c /%c /%c /%c /%c /%c] file ...\n \ +DELETE [/%c /%c /%c /%c /%c /%c /%c] file ...\n \ +ERASE [/%c /%c /%c /%c /%c /%c /%c] file ...\n\n \ + file Specifies the file(s) to delete.\n\n \ + /%c Nothing.\n \ + /%c Prompt. Ask before deleting each file.\n \ + /%c Total. Display total number of deleted files and freed disk space.\n \ + /%c Quiet.\n \ + /%c Wipe. Overwrite the file with random numbers before deleting it.\n \ + /%c Yes. Kill even *.* without asking.\n \ + /%c Zap. Delete hidden, read-only and system files).\n" + +STRING_DEL_HELP3, " %lu file%s deleted\n" + +STRING_DEL_HELP4, " %lu files deleted\n" + STRING_EXIT_HELP, "Exits the command line interpreter.\n\nEXIT" STRING_MKDIR_HELP, "Creates a directory.\n\n \ @@ -144,14 +161,18 @@ STRING_REM_HELP, "Starts a comment line in a batch file.\n\nREM [Comment]" +STRING_DEL_HELP2, "All files in the directory will be deleted!\nAre you sure (Y/N)?" + + STRING_CHOICE_OPTION, "YN" STRING_COPY_OPTION, "YNA" +STRING_DEL_OPTION, "AENPQSTWXYZ" STRING_ALIAS_ERROR, "Command line too long after alias expansion!\n" @@ -168,12 +189,24 @@ STRING_CMD_ERROR3, "Can't redirect to file %s\n" STRING_CMD_ERROR4, "Running %s...\n" STRING_CMD_ERROR5, "Running cmdexit.bat...\n" +STRING_COLOR_ERROR1, "Same colors error! (Background and foreground can't be the same color)" +STRING_COLOR_ERROR2, "error in color specification" +STRING_COLOR_ERROR3, "Color %x\n" +STRING_COLOR_ERROR4, "same colors error!" STRING_CONSOLE_ERROR, "Unknown error: %d\n" STRING_COPY_ERROR1, "Error: Cannot open source - %s!\n" STRING_COPY_ERROR2, "Error: Can't copy onto itself!\n" STRING_COPY_ERROR3, "Error writing destination!\n" STRING_COPY_ERROR4, "Error: Not implemented yet!\n" STRING_DATE_ERROR, "Invalid date." +STRING_DEL_ERROR1, "Wildcards!\n\n" +STRING_DEL_ERROR2, "Full path: %s\n" +STRING_DEL_ERROR3, "File part: %s\n" +STRING_DEL_ERROR4, "Full filename: %s\n" +STRING_DEL_ERROR5, "The file %s will be deleted! " +STRING_DEL_ERROR6, "Are you sure (Y/N)?" +STRING_DEL_ERROR7, "Deleting: %s\n" +STRING_DEL_ERROR8, "No Wildcards!\n" STRING_PARAM_ERROR, "Required parameter missing\n" _____ Modified: trunk/reactos/subsys/system/cmd/color.c --- trunk/reactos/subsys/system/cmd/color.c 2005-04-03 13:04:10 UTC (rev 14475) +++ trunk/reactos/subsys/system/cmd/color.c 2005-04-03 13:40:15 UTC (rev 14476) @@ -41,10 +41,12 @@ DWORD dwWritten; CONSOLE_SCREEN_BUFFER_INFO csbi; COORD coPos; + WCHAR szMsg[RC_STRING_MAX_SIZE]; if ((wColor & 0xF) == (wColor &0xF0) >> 4) { - ConErrPuts (_T("Same colors error! (Background and foreground can't be the same color)")); + LoadString( GetModuleHandle(NULL), STRING_COLOR_ERROR1, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPuts (_T((LPTSTR)szMsg)); } else { @@ -72,6 +74,8 @@ */ INT CommandColor (LPTSTR first, LPTSTR rest) { + WCHAR szMsg[RC_STRING_MAX_SIZE]; + if (_tcsncmp (rest, _T("/?"), 2) == 0) { ColorHelp (); @@ -88,15 +92,18 @@ if (StringToColor (&wColor, &rest) == FALSE) { - ConErrPuts(_T("error in color specification")); + LoadString( GetModuleHandle(NULL), STRING_COLOR_ERROR2, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPuts (_T((LPTSTR)szMsg)); return 1; } - ConErrPrintf (_T("Color %x\n"), wColor); + LoadString( GetModuleHandle(NULL), STRING_COLOR_ERROR3, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPrintf (_T((LPTSTR)szMsg), wColor); if ((wColor & 0xF) == (wColor &0xF0) >> 4) { - ConErrPuts (_T("same colors error!")); + LoadString( GetModuleHandle(NULL), STRING_COLOR_ERROR4, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPrintf (_T((LPTSTR)szMsg), wColor); return 1; } _____ Modified: trunk/reactos/subsys/system/cmd/copy.c --- trunk/reactos/subsys/system/cmd/copy.c 2005-04-03 13:04:10 UTC (rev 14475) +++ trunk/reactos/subsys/system/cmd/copy.c 2005-04-03 13:40:15 UTC (rev 14476) @@ -303,7 +303,7 @@ TCHAR Options[3]; WCHAR szMsg[RC_STRING_MAX_SIZE]; - LoadString( GetModuleHandle(NULL), STRING_COPY_OPTION, (LPTSTR) Options,sizeof(lpOptions)); + LoadString( GetModuleHandle(NULL), STRING_COPY_OPTION, (LPTSTR) Options,sizeof(Options)+sizeof(WCHAR)); lpOptions = _T(Options); LoadString( GetModuleHandle(NULL), STRING_COPY_HELP1, (LPTSTR) szMsg,sizeof(szMsg)); _____ Modified: trunk/reactos/subsys/system/cmd/del.c --- trunk/reactos/subsys/system/cmd/del.c 2005-04-03 13:04:10 UTC (rev 14475) +++ trunk/reactos/subsys/system/cmd/del.c 2005-04-03 13:40:15 UTC (rev 14476) @@ -35,6 +35,7 @@ */ #include "precomp.h" +#include "resource.h" #ifdef INCLUDE_CMD_DEL @@ -108,29 +109,30 @@ HANDLE hFile; WIN32_FIND_DATA f; + LPTSTR lpOptions; + TCHAR Options[11]; + WCHAR szMsg[RC_STRING_MAX_SIZE]; + LONG ch; + + + + LoadString( GetModuleHandle(NULL), STRING_DEL_OPTION, (LPTSTR) Options,sizeof(Options)+sizeof(WCHAR)); + lpOptions = _T(Options); + if (!_tcsncmp (param, _T("/?"), 2)) { - ConOutPuts (_T("Deletes one or more files.\n" - "\n" - "DEL [/N /P /T /Q /W /Y /Z] file ...\n" - "DELETE [/N /P /T /Q /W /Y /Z] file ...\n" - "ERASE [/N /P /T /Q /W /Y /Z] file ...\n" - "\n" - " file Specifies the file(s) to delete.\n" - "\n" - " /N Nothing.\n" - " /P Prompt. Ask before deleting each file.\n" - " /T Total. Display total number of deleted files and freed disk space.\n" - " /Q Quiet.\n" - " /W Wipe. Overwrite the file with random numbers before deleting it.\n" - " /Y Yes. Kill even *.* without asking.\n" - " /Z Zap. Delete hidden, read-only and system files).\n")); - + LoadString( GetModuleHandle(NULL), STRING_DEL_HELP1, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPrintf (_T((LPTSTR)szMsg), + lpOptions[2],Options[3],lpOptions[6],lpOptions[4],lpOptions[7],lpOptions [9],lpOptions[10], + lpOptions[2],Options[3],lpOptions[6],lpOptions[4],lpOptions[7],lpOptions [9],lpOptions[10], + lpOptions[2],Options[3],lpOptions[6],lpOptions[4],lpOptions[7],lpOptions [9],lpOptions[10], + lpOptions[2],Options[3],lpOptions[6],lpOptions[4],lpOptions[7],lpOptions [9],lpOptions[10] + ); return 0; } arg = split (param, &args, FALSE); - + if (args > 0) { /* check for options anywhere in command line */ @@ -140,39 +142,49 @@ { if (_tcslen (arg[i]) >= 2) { - switch (_totupper (arg[i][1])) - { - case _T('N'): - dwFlags |= DEL_NOTHING; - break; + + ch = _totupper (arg[i][1]); + + if (_totupper (lpOptions[2]) == ch) + { + dwFlags |= DEL_NOTHING; + } - case _T('P'): - dwFlags |= DEL_PROMPT; - break; + else if (_totupper (lpOptions[3]) == ch) + { + dwFlags |= DEL_PROMPT; + } + + else if (_totupper (lpOptions[4]) == ch) + { + dwFlags |= DEL_QUIET; + } - case _T('Q'): - dwFlags |= DEL_QUIET; - break; + else if (_totupper (lpOptions[5]) == ch) + { + dwFlags |= DEL_SUBDIR; + } - case _T('S'): - dwFlags |= DEL_SUBDIR; - break; + else if (_totupper (lpOptions[6]) == ch) + { + dwFlags |= DEL_TOTAL; + } - case _T('T'): - dwFlags |= DEL_TOTAL; - break; + else if (_totupper (lpOptions[7]) == ch) + { + dwFlags |= DEL_WIPE; + } - case _T('W'): - dwFlags |= DEL_WIPE; - break; - case _T('Y'): - dwFlags |= DEL_YES; - break; - case _T('Z'): - dwFlags |= DEL_ZAP; - break; - } + else if (_totupper (lpOptions[9]) == ch) + { + dwFlags |= DEL_YES; + } + else if (_totupper (lpOptions[10]) == ch) + { + dwFlags |= DEL_ZAP; + } + } nEvalArgs++; @@ -199,9 +211,11 @@ { if (!((dwFlags & DEL_YES) || (dwFlags & DEL_QUIET) || (dwFlags & DEL_PROMPT))) { - res = FilePromptYN (_T("All files in the directory will be deleted!\n" - "Are you sure (Y/N)?")); + + LoadString( GetModuleHandle(NULL), STRING_DEL_HELP2, (LPTSTR) szMsg,sizeof(szMsg)); + res = FilePromptYN (_T( (LPTSTR) szMsg)); + if ((res == PROMPT_NO) || (res == PROMPT_BREAK)) break; } @@ -217,7 +231,8 @@ { /* wildcards in filespec */ #ifdef _DEBUG - ConErrPrintf (_T("Wildcards!\n\n")); + LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR1, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPrintf (_T((LPTSTR)szMsg)); #endif GetFullPathName (arg[i], @@ -226,8 +241,12 @@ &pFilePart); #ifdef _DEBUG - ConErrPrintf (_T("Full path: %s\n"), szFullPath); - ConErrPrintf (_T("File part: %s\n"), pFilePart); + LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR2, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPrintf (_T((LPTSTR)szMsg), szFullPath); + + LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR3, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPrintf (_T((LPTSTR)szMsg), pFilePart); + #endif hFile = FindFirstFile (szFullPath, &f); @@ -249,13 +268,18 @@ _tcscpy (pFilePart, f.cFileName); #ifdef _DEBUG - ConErrPrintf (_T("Full filename: %s\n"), szFullPath); + LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR4, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPrintf (_T((LPTSTR)szMsg)); + #endif /* ask for deleting */ if (dwFlags & DEL_PROMPT) - { - ConErrPrintf (_T("The file %s will be deleted! "), szFullPath); - res = FilePromptYN (_T("Are you sure (Y/N)?")); + { + LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR5, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPrintf (_T((LPTSTR)szMsg), szFullPath); + + LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR6, (LPTSTR) szMsg,sizeof(szMsg)); + res = FilePromptYN (_T((LPTSTR)szMsg)); if ((res == PROMPT_NO) || (res == PROMPT_BREAK)) { @@ -264,7 +288,10 @@ } if (!(dwFlags & DEL_QUIET) && !(dwFlags & DEL_TOTAL)) - ConErrPrintf (_T("Deleting: %s\n"), szFullPath); + { + LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR7, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPrintf (_T((LPTSTR)szMsg), szFullPath); + } /* delete the file */ if (!(dwFlags & DEL_NOTHING)) @@ -307,7 +334,8 @@ { /* no wildcards in filespec */ #ifdef _DEBUG - ConErrPrintf (_T("No Wildcards!\n")); + LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR8, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPrintf (_T((LPTSTR)szMsg)); #endif GetFullPathName (arg[i], MAX_PATH, @@ -317,8 +345,11 @@ /*ask for deleting */ if((dwFlags & DEL_PROMPT) && (FindFirstFile(szFullPath, &f) != INVALID_HANDLE_VALUE)) //Don't ask if the file doesn't exist, the following code will make the error-msg { - ConErrPrintf (_T("The file %s will be deleted! "), szFullPath); - res = FilePromptYN (_T("Are you sure (Y/N)?")); + LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR5, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPrintf (_T((LPTSTR)szMsg), szFullPath); + + LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR6, (LPTSTR) szMsg,sizeof(szMsg)); + res = FilePromptYN (_T((LPTSTR)szMsg)); if ((res == PROMPT_NO) || (res == PROMPT_BREAK)) { @@ -327,10 +358,14 @@ } #ifdef _DEBUG - ConErrPrintf (_T("Full path: %s\n"), szFullPath); + LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR3, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPrintf (_T((LPTSTR)szMsg), szFullPath); #endif if (!(dwFlags & DEL_QUIET) && !(dwFlags & DEL_TOTAL)) - ConOutPrintf (_T("Deleting %s\n"), szFullPath); + { + LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR7, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPrintf (_T((LPTSTR)szMsg), szFullPath); + } if (!(dwFlags & DEL_NOTHING)) { @@ -380,12 +415,16 @@ if (!(dwFlags & DEL_QUIET)) { - if (dwFiles == 0) - ConOutPrintf (_T(" 0 files deleted\n")); + if (dwFiles < 2) + { + LoadString( GetModuleHandle(NULL), STRING_DEL_HELP3, (LPTSTR) szMsg,sizeof(szMsg)); + } else - ConOutPrintf (_T(" %lu file%s deleted\n"), - dwFiles, - (dwFiles == 1) ? _T("") : _T("s")); + { + LoadString( GetModuleHandle(NULL), STRING_DEL_HELP4, (LPTSTR) szMsg,sizeof(szMsg)); + } + + ConOutPrintf (_T((LPTSTR)szMsg), dwFiles); } return 0; _____ Modified: trunk/reactos/subsys/system/cmd/resource.h --- trunk/reactos/subsys/system/cmd/resource.h 2005-04-03 13:04:10 UTC (rev 14475) +++ trunk/reactos/subsys/system/cmd/resource.h 2005-04-03 13:40:15 UTC (rev 14476) @@ -2,8 +2,8 @@ #define STRING_CHOICE_OPTION 200 #define STRING_COPY_OPTION 201 +#define STRING_DEL_OPTION 202 - #define STRING_ALIAS_ERROR 300 #define STRING_BATCH_ERROR 301 #define STRING_CHCP_ERROR1 302 @@ -18,13 +18,25 @@ #define STRING_CMD_ERROR3 311 #define STRING_CMD_ERROR4 312 #define STRING_CMD_ERROR5 313 -#define STRING_CONSOLE_ERROR 314 -#define STRING_COPY_ERROR1 315 -#define STRING_COPY_ERROR2 316 -#define STRING_COPY_ERROR3 317 -#define STRING_COPY_ERROR4 318 -#define STRING_DATE_ERROR 319 -#define STRING_PARAM_ERROR 320 +#define STRING_COLOR_ERROR1 314 +#define STRING_COLOR_ERROR2 315 +#define STRING_COLOR_ERROR3 316 +#define STRING_COLOR_ERROR4 317 +#define STRING_CONSOLE_ERROR 318 +#define STRING_COPY_ERROR1 319 +#define STRING_COPY_ERROR2 320 +#define STRING_COPY_ERROR3 321 +#define STRING_COPY_ERROR4 322 +#define STRING_DATE_ERROR 323 +#define STRING_DEL_ERROR1 324 +#define STRING_DEL_ERROR2 325 +#define STRING_DEL_ERROR3 326 +#define STRING_DEL_ERROR4 327 +#define STRING_DEL_ERROR5 328 +#define STRING_DEL_ERROR6 329 +#define STRING_DEL_ERROR7 330 +#define STRING_DEL_ERROR8 331 +#define STRING_PARAM_ERROR 332 #define STRING_ATTRIB_HELP 400 #define STRING_ALIAS_HELP 401 @@ -49,10 +61,14 @@ #define STRING_DATE_HELP2 420 #define STRING_DATE_HELP3 421 #define STRING_DATE_HELP4 422 -#define STRING_EXIT_HELP 423 -#define STRING_MKDIR_HELP 424 -#define STRING_RMDIR_HELP 425 -#define STRING_REM_HELP 426 +#define STRING_DEL_HELP1 423 +#define STRING_DEL_HELP2 424 +#define STRING_DEL_HELP3 425 +#define STRING_DEL_HELP4 426 +#define STRING_EXIT_HELP 427 +#define STRING_MKDIR_HELP 428 +#define STRING_RMDIR_HELP 429 +#define STRING_REM_HELP 430
19 years, 7 months
1
0
0
0
[hbirr] 14475: Since a process id is only unique if the associated process is not deleted,
by hbirr@svn.reactos.com
Since a process id is only unique if the associated process is not deleted, we must prevent the deleting of the process. An opened handle does this. Modified: trunk/reactos/subsys/csrss/api/process.c Modified: trunk/reactos/subsys/csrss/include/api.h Modified: trunk/reactos/subsys/csrss/win32csr/conio.c _____ Modified: trunk/reactos/subsys/csrss/api/process.c --- trunk/reactos/subsys/csrss/api/process.c 2005-04-03 12:49:25 UTC (rev 14474) +++ trunk/reactos/subsys/csrss/api/process.c 2005-04-03 13:04:10 UTC (rev 14475) @@ -59,6 +59,9 @@ { ULONG hash; PCSRSS_PROCESS_DATA pProcessData; + OBJECT_ATTRIBUTES ObjectAttributes; + CLIENT_ID ClientId; + NTSTATUS Status; hash = (ULONG_PTR)ProcessId % (sizeof(ProcessData) / sizeof(*ProcessData)); @@ -80,6 +83,27 @@ pProcessData->ProcessId = ProcessId; pProcessData->next = ProcessData[hash]; ProcessData[hash] = pProcessData; + + ClientId.UniqueThread = NULL; + ClientId.UniqueProcess = pProcessData->ProcessId; + InitializeObjectAttributes(&ObjectAttributes, + NULL, + 0, + NULL, + NULL); + + /* using OpenProcess is not optimal due to HANDLE vs. DWORD PIDs... */ + Status = NtOpenProcess(&pProcessData->Process, + PROCESS_DUP_HANDLE | PROCESS_VM_OPERATION | + PROCESS_VM_WRITE | PROCESS_CREATE_THREAD, + &ObjectAttributes, + &ClientId); + if (!NT_SUCCESS(Status)) + { + ProcessData[hash] = pProcessData->next; + RtlFreeHeap(CsrssApiHeap, 0, pProcessData); + pProcessData = NULL; + } } } else @@ -115,6 +139,10 @@ if (pProcessData) { DPRINT("CsrFreeProcessData pid: %d\n", Pid); + if (pProcessData->Process) + { + NtClose(pProcessData->Process); + } if (pProcessData->Console) { RtlEnterCriticalSection(&ProcessDataLock); _____ Modified: trunk/reactos/subsys/csrss/include/api.h --- trunk/reactos/subsys/csrss/include/api.h 2005-04-03 12:49:25 UTC (rev 14474) +++ trunk/reactos/subsys/csrss/include/api.h 2005-04-03 13:04:10 UTC (rev 14475) @@ -37,6 +37,7 @@ ULONG HandleTableSize; Object_t ** HandleTable; HANDLE ProcessId; + HANDLE Process; ULONG ShutdownLevel; ULONG ShutdownFlags; HANDLE ConsoleEvent; _____ Modified: trunk/reactos/subsys/csrss/win32csr/conio.c --- trunk/reactos/subsys/csrss/win32csr/conio.c 2005-04-03 12:49:25 UTC (rev 14474) +++ trunk/reactos/subsys/csrss/win32csr/conio.c 2005-04-03 13:04:10 UTC (rev 14475) @@ -74,49 +74,22 @@ VOID FASTCALL ConioConsoleCtrlEvent(DWORD Event, PCSRSS_PROCESS_DATA ProcessData) { - HANDLE Process, Thread; + HANDLE Thread; DPRINT("ConioConsoleCtrlEvent Parent ProcessId = %x\n", ProcessData->ProcessId); if (ProcessData->CtrlDispatcher) { - OBJECT_ATTRIBUTES ObjectAttributes; - CLIENT_ID ClientId; - NTSTATUS Status; - - ClientId.UniqueThread = NULL; - ClientId.UniqueProcess = ProcessData->ProcessId; - InitializeObjectAttributes(&ObjectAttributes, - NULL, - 0, - NULL, - NULL); - /* using OpenProcess is not optimal due to HANDLE vs. DWORD PIDs... */ - Status = NtOpenProcess(&Process, - PROCESS_DUP_HANDLE | PROCESS_VM_OPERATION | - PROCESS_VM_WRITE | PROCESS_CREATE_THREAD, - &ObjectAttributes, - &ClientId); - if (!NT_SUCCESS(Status)) - { - DPRINT1("Failed for handle duplication, Status: 0x%x\n", Status); - return; - } - - DPRINT("ConioConsoleCtrlEvent Process Handle = %x\n", Process); - - Thread = CreateRemoteThread(Process, NULL, 0, + Thread = CreateRemoteThread(ProcessData->Process, NULL, 0, (LPTHREAD_START_ROUTINE) ProcessData->CtrlDispatcher, (PVOID) Event, 0, NULL); if (NULL == Thread) { DPRINT1("Failed thread creation (Error: 0x%x)\n", GetLastError()); - CloseHandle(Process); return; } CloseHandle(Thread); - CloseHandle(Process); } }
19 years, 7 months
1
0
0
0
[ekohl] 14474: Support 'ref' and 'unique' attributes for pointers.
by ekohl@svn.reactos.com
Support 'ref' and 'unique' attributes for pointers. Modified: trunk/reactos/tools/widl/ChangeLog Modified: trunk/reactos/tools/widl/client.c Modified: trunk/reactos/tools/widl/lex.yy.c Modified: trunk/reactos/tools/widl/parser.l Modified: trunk/reactos/tools/widl/parser.y Modified: trunk/reactos/tools/widl/server.c Modified: trunk/reactos/tools/widl/widltypes.h Modified: trunk/reactos/tools/widl/y.tab.c Modified: trunk/reactos/tools/widl/y.tab.h _____ Modified: trunk/reactos/tools/widl/ChangeLog --- trunk/reactos/tools/widl/ChangeLog 2005-04-03 12:14:30 UTC (rev 14473) +++ trunk/reactos/tools/widl/ChangeLog 2005-04-03 12:49:25 UTC (rev 14474) @@ -1,5 +1,15 @@ ChangeLog +2005-04-03 ekohl + + tools/widl/client.c + tools/widl/parser.l + tools/widl/parser.y + tools/widl/server.c + tools/widl/widltypes.h + +Support 'ref' and 'unique' attributes for pointers. + 2005-03-27 Jacek Caban (from WINE) tools/widl/parser.y _____ Modified: trunk/reactos/tools/widl/client.c --- trunk/reactos/tools/widl/client.c 2005-04-03 12:14:30 UTC (rev 14473) +++ trunk/reactos/tools/widl/client.c 2005-04-03 12:49:25 UTC (rev 14474) @@ -187,6 +187,7 @@ var_t *var; int out_attr; int string_attr; + int ptr_attr, ref_attr, unique_attr; print_client("static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =\n"); print_client("{\n"); @@ -217,12 +218,27 @@ if (var->ptr_level == 1) { + ptr_attr = is_attr(var->attrs, ATTR_PTR); + ref_attr = is_attr(var->attrs, ATTR_REF); + unique_attr = is_attr(var->attrs, ATTR_UNIQUE); + + if (ptr_attr + ref_attr + unique_attr == 0) + ref_attr = 1; + if (is_base_type(var->type)) { if (out_attr) print_client("0x11, 0x0c, /* FC_RP [allocated_on_stack] [simple_pointer] */\n"); else - print_client("0x11, 0x08, /* FC_RP [simple_pointer] */\n"); + { + if (ptr_attr) + print_client("0x14, 0x08, /* FC_FP [simple_pointer] */\n"); + else if (ref_attr) + print_client("0x11, 0x08, /* FC_RP [simple_pointer] */\n"); + else if (unique_attr) + print_client("0x12, 0x08, /* FC_UP [simple_pointer] */\n"); + } + if (string_attr) { if (var->type->type == RPC_FC_CHAR) @@ -268,6 +284,7 @@ int out_attr; int string_attr; int nothing_printed = 1; + int ptr_attr, ref_attr, unique_attr; var_t *var; unsigned int local_type_offset = *type_offset; @@ -286,19 +303,104 @@ if (!out_attr && !in_attr) in_attr = 1; + ptr_attr = is_attr(var->attrs, ATTR_PTR); + ref_attr = is_attr(var->attrs, ATTR_REF); + unique_attr = is_attr(var->attrs, ATTR_UNIQUE); + + /* default to 'ref' attribute */ + if (ptr_attr + ref_attr + unique_attr == 0) + ref_attr = 1; + if (!in_attr) continue; - if (var->ptr_level == 1 && - string_attr && - (var->type->type == RPC_FC_CHAR || var->type->type == RPC_FC_WCHAR)) + if (var->ptr_level == 1) { - size = 12; - alignment = 0; - if (last_size != -1) - fprintf(client, " +"); - fprintf(client, " %dU", (size == 0) ? 0 : size + alignment); - nothing_printed = 0; + if (unique_attr) + { + if (string_attr && + (var->type->type == RPC_FC_CHAR || var->type->type == RPC_FC_WCHAR)) + { + size = 16; + alignment = 0; + if (last_size != -1) + fprintf(client, " +"); + fprintf(client, " %dU", (size == 0) ? 0 : size + alignment); + nothing_printed = 0; + } + else + { + size = 8; + alignment = 0; + if (last_size != -1) + fprintf(client, " +"); + fprintf(client, " %dU", (size == 0) ? 0 : size + alignment); + nothing_printed = 0; + } + } + else if (ref_attr) + { + if (string_attr && + (var->type->type == RPC_FC_CHAR || var->type->type == RPC_FC_WCHAR)) + { + size = 12; + alignment = 0; + if (last_size != -1) + fprintf(client, " +"); + fprintf(client, " %dU", (size == 0) ? 0 : size + alignment); + nothing_printed = 0; + } + else + { + alignment = 0; + switch (var->type->type) + { + case RPC_FC_BYTE: + case RPC_FC_CHAR: + case RPC_FC_SMALL: + size = 1; + alignment = 0; + break; + + case RPC_FC_WCHAR: + case RPC_FC_USHORT: + case RPC_FC_SHORT: + size = 2; + if (last_size > 0 && last_size < 2) + alignment += (2 - last_size); + break; + + case RPC_FC_ULONG: + case RPC_FC_LONG: + case RPC_FC_FLOAT: + size = 4; + if (last_size > 0 && last_size < 4) + alignment += (4 - last_size); + break; + + case RPC_FC_HYPER: + case RPC_FC_DOUBLE: + size = 8; + if (last_size > 0 && last_size < 4) + alignment += (4 - last_size); + break; + + case RPC_FC_IGNORE: + size = 0; + break; + + default: + error("%s:%d Unknown/unsupported type 0x%x\n", + __FUNCTION__,__LINE__, var->type->type); + return; + } + + if (last_size != -1) + fprintf(client, " +"); + fprintf(client, " %dU", (size == 0) ? 0 : size + alignment); + nothing_printed = 0; + } + } } else { @@ -377,20 +479,46 @@ if (!out_attr && !in_attr) in_attr = 1; + ptr_attr = is_attr(var->attrs, ATTR_PTR); + ref_attr = is_attr(var->attrs, ATTR_REF); + unique_attr = is_attr(var->attrs, ATTR_UNIQUE); + + /* default to 'ref' attribute */ + if (ptr_attr + ref_attr + unique_attr == 0) + ref_attr = 1; + if (in_attr) { if (var->ptr_level == 1 && string_attr && (var->type->type == RPC_FC_CHAR || var->type->type == RPC_FC_WCHAR)) { - print_client("NdrConformantStringBufferSize(\n"); - indent++; - print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_client("(unsigned char __RPC_FAR *)%s,\n", var->name); - print_client("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", - local_type_offset + 2); - nothing_printed = 1; - indent--; + if (ptr_attr) + { + /* FIXME: not supported yet */ + } + if (ref_attr) + { + print_client("NdrConformantStringBufferSize(\n"); + indent++; + print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); + print_client("(unsigned char __RPC_FAR *)%s,\n", var->name); + print_client("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", + local_type_offset + 2); + nothing_printed = 1; + indent--; + } + else if (unique_attr) + { + print_client("NdrPointerBufferSize(\n"); + indent++; + print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); + print_client("(unsigned char __RPC_FAR *)%s,\n", var->name); + print_client("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", + local_type_offset); + nothing_printed = 1; + indent--; + } } } @@ -415,6 +543,7 @@ int in_attr; int out_attr; int string_attr; + int ptr_attr, ref_attr, unique_attr; var_t *var; if (!func->args) @@ -441,17 +570,103 @@ return; } - if (var->ptr_level == 1 && - string_attr && - (var->type->type == RPC_FC_CHAR || var->type->type == RPC_FC_WCHAR)) + if (var->ptr_level == 1) { - print_client("NdrConformantStringMarshall(\n"); - indent++; - print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_client("(unsigned char __RPC_FAR *)%s,\n", var->name); - print_client("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", *type_offset + 2); - indent--; - fprintf(client, "\n"); + ptr_attr = is_attr(var->attrs, ATTR_PTR); + ref_attr = is_attr(var->attrs, ATTR_REF); + unique_attr = is_attr(var->attrs, ATTR_UNIQUE); + if (ptr_attr + ref_attr + unique_attr == 0) + ref_attr = 1; + + if (ref_attr) + { + if (string_attr && + (var->type->type == RPC_FC_CHAR || var->type->type == RPC_FC_WCHAR)) + { + print_client("NdrConformantStringMarshall(\n"); + indent++; + print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); + print_client("(unsigned char __RPC_FAR *)%s,\n", var->name); + print_client("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", *type_offset + 2); + indent--; + fprintf(client, "\n"); + } + else + { + alignment = 0; + switch (var->type->type) + { + case RPC_FC_BYTE: + case RPC_FC_CHAR: + case RPC_FC_SMALL: + size = 1; + alignment = 0; + break; + + case RPC_FC_WCHAR: + case RPC_FC_USHORT: + case RPC_FC_SHORT: + size = 2; + if (last_size > 0 && last_size < 2) + alignment = (2 - last_size); + break; + + case RPC_FC_ULONG: + case RPC_FC_LONG: + case RPC_FC_FLOAT: + size = 4; + if (last_size > 0 && last_size < 4) + alignment = (4 - last_size); + break; + + case RPC_FC_HYPER: + case RPC_FC_DOUBLE: + size = 8; + if (last_size > 0 && last_size < 4) + alignment = (4 - last_size); + break; + + case RPC_FC_IGNORE: + size = 0; + break; + + default: + error("%s:%d Unknown/unsupported type 0x%x\n", + __FUNCTION__,__LINE__, var->type->type); + return; + } + + if (size != 0) + { + if (alignment != 0) + print_client("_StubMsg.Buffer += %u;\n", alignment); + + print_client("*(("); + write_type(client, var->type, NULL, var->tname); + fprintf(client, " __RPC_FAR*)_StubMsg.Buffer) = "); + if (var->ptr_level == 1) + fprintf(client, "*"); + write_name(client, var); + fprintf(client, ";\n"); + print_client("_StubMsg.Buffer += sizeof("); + write_type(client, var->type, NULL, var->tname); + fprintf(client, ");\n"); + fprintf(client, "\n"); + + last_size = size; + } + } + } + else if (unique_attr) + { + print_client("NdrPointerMarshall(\n"); + indent++; + print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); + print_client("(unsigned char __RPC_FAR *)%s,\n", var->name); + print_client("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u]);\n", *type_offset); + indent--; + fprintf(client, "\n"); + } } else { @@ -675,6 +890,9 @@ static void check_pointers(func_t *func) { var_t *var; + int ptr_attr; + int ref_attr; + int unique_attr; if (!func->args) return; @@ -683,20 +901,50 @@ while (NEXT_LINK(var)) var = NEXT_LINK(var); while (var) { - if (var->ptr_level == 1) + ptr_attr = is_attr(var->attrs, ATTR_PTR); + ref_attr = is_attr(var->attrs, ATTR_REF); + unique_attr = is_attr(var->attrs, ATTR_UNIQUE); + + if (var->ptr_level == 0) { - print_client("if (!%s)\n", var->name); - print_client("{\n"); - indent++; - print_client("RpcRaiseException(RPC_X_NULL_REF_POINTER);\n"); - indent--; - print_client("}\n"); - fprintf(client, "\n"); + if (ptr_attr + ref_attr + unique_attr != 0) + { + error("The attributes [ptr], [ref] and [unique] can only be used for pointers!\n"); + return; + } } - else if (var->ptr_level > 1) + else { - error("Pointer level %d not supported!\n", var->ptr_level); - return; + /* default to 'ref' attribute */ + if (ptr_attr + ref_attr + unique_attr == 0) + { + ref_attr = 1; + } + + if (ptr_attr + ref_attr + unique_attr > 1) + { + error("The attributes [ptr], [ref] and [unique] are mutually exclusive!\n"); + return; + } + + if (var->ptr_level == 1) + { + if (ref_attr) + { + print_client("if (!%s)\n", var->name); + print_client("{\n"); + indent++; + print_client("RpcRaiseException(RPC_X_NULL_REF_POINTER);\n"); + indent--; + print_client("}\n"); + fprintf(client, "\n"); + } + } + else if (var->ptr_level > 1) + { + error("Pointer level %d not supported!\n", var->ptr_level); + return; + } } var = PREV_LINK(var); _____ Modified: trunk/reactos/tools/widl/lex.yy.c --- trunk/reactos/tools/widl/lex.yy.c 2005-04-03 12:14:30 UTC (rev 14473) +++ trunk/reactos/tools/widl/lex.yy.c 2005-04-03 12:49:25 UTC (rev 14474) @@ -4555,6 +4555,7 @@ {"propput", tPROPPUT}, {"propputref", tPROPPUTREF}, /* ... */ + {"ptr", tPTR}, {"public", tPUBLIC}, /* ... */ {"readonly", tREADONLY}, @@ -4579,8 +4580,8 @@ /* ... */ {"transmit_as", tTRANSMITAS}, {"typedef", tTYPEDEF}, +/* ... */ {"union", tUNION}, -/* ... */ {"unique", tUNIQUE}, {"unsigned", tUNSIGNED}, /* ... */ _____ Modified: trunk/reactos/tools/widl/parser.l --- trunk/reactos/tools/widl/parser.l 2005-04-03 12:14:30 UTC (rev 14473) +++ trunk/reactos/tools/widl/parser.l 2005-04-03 12:49:25 UTC (rev 14474) @@ -275,6 +275,7 @@ {"propput", tPROPPUT}, {"propputref", tPROPPUTREF}, /* ... */ + {"ptr", tPTR}, {"public", tPUBLIC}, /* ... */ {"readonly", tREADONLY}, @@ -299,8 +300,8 @@ /* ... */ {"transmit_as", tTRANSMITAS}, {"typedef", tTYPEDEF}, +/* ... */ {"union", tUNION}, -/* ... */ {"unique", tUNIQUE}, {"unsigned", tUNSIGNED}, /* ... */ _____ Modified: trunk/reactos/tools/widl/parser.y --- trunk/reactos/tools/widl/parser.y 2005-04-03 12:14:30 UTC (rev 14473) +++ trunk/reactos/tools/widl/parser.y 2005-04-03 12:49:25 UTC (rev 14474) @@ -162,6 +162,7 @@ %token tPOINTERDEFAULT %token tPROPERTIES %token tPROPGET tPROPPUT tPROPPUTREF +%token tPTR %token tPUBLIC %token tREADONLY tREF %token tRESTRICTED @@ -373,8 +374,10 @@ | tPROPGET { $$ = make_attr(ATTR_PROPGET); } | tPROPPUT { $$ = make_attr(ATTR_PROPPUT); } | tPROPPUTREF { $$ = make_attr(ATTR_PROPPUTREF); } + | tPTR { $$ = make_attr(ATTR_PTR); } | tPUBLIC { $$ = make_attr(ATTR_PUBLIC); } | tREADONLY { $$ = make_attr(ATTR_READONLY); } + | tREF { $$ = make_attr(ATTR_REF); } | tRESTRICTED { $$ = make_attr(ATTR_RESTRICTED); } | tRETVAL { $$ = make_attr(ATTR_RETVAL); } | tSIZEIS '(' m_exprs ')' { $$ = make_attrp(ATTR_SIZEIS, $3); } @@ -383,6 +386,7 @@ | tSWITCHIS '(' expr ')' { $$ = make_attrp(ATTR_SWITCHIS, $3); } | tSWITCHTYPE '(' type ')' { $$ = make_attrp(ATTR_SWITCHTYPE, type_ref($3)); } | tTRANSMITAS '(' type ')' { $$ = make_attrp(ATTR_TRANSMITAS, type_ref($3)); } + | tUNIQUE { $$ = make_attr(ATTR_UNIQUE); } | tUUID '(' aUUID ')' { $$ = make_attrp(ATTR_UUID, $3); } | tV1ENUM { $$ = make_attr(ATTR_V1ENUM); } | tVARARG { $$ = make_attr(ATTR_VARARG); } _____ Modified: trunk/reactos/tools/widl/server.c --- trunk/reactos/tools/widl/server.c 2005-04-03 12:14:30 UTC (rev 14473) +++ trunk/reactos/tools/widl/server.c 2005-04-03 12:49:25 UTC (rev 14474) @@ -192,6 +192,7 @@ var_t *var; int out_attr; int string_attr; + int ptr_attr, ref_attr, unique_attr; print_server("static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =\n"); print_server("{\n"); @@ -222,12 +223,27 @@ if (var->ptr_level == 1) { + ptr_attr = is_attr(var->attrs, ATTR_PTR); + ref_attr = is_attr(var->attrs, ATTR_REF); + unique_attr = is_attr(var->attrs, ATTR_UNIQUE); + + if (ptr_attr + ref_attr + unique_attr == 0) + ref_attr = 1; + if (is_base_type(var->type)) { if (out_attr) print_server("0x11, 0x0c, /* FC_RP [allocated_on_stack] [simple_pointer] */\n"); else - print_server("0x11, 0x08, /* FC_RP [simple_pointer] */\n"); + { + if (ptr_attr) + print_server("0x14, 0x08, /* FC_FP [simple_pointer] */\n"); + else if (ref_attr) + print_server("0x11, 0x08, /* FC_RP [simple_pointer] */\n"); + else if (unique_attr) + print_server("0x12, 0x08, /* FC_UP [simple_pointer] */\n"); + } + if (string_attr) { if (var->type->type == RPC_FC_CHAR) @@ -439,9 +455,9 @@ unsigned int size; unsigned int last_size = 0; var_t *var; - int in_attr; - int out_attr; + int in_attr, out_attr; int string_attr; + int ptr_attr, ref_attr, unique_attr; if (!func->args) return; @@ -460,18 +476,104 @@ if (in_attr) { - if (var->ptr_level == 1 && - string_attr && - (var->type->type == RPC_FC_CHAR || var->type->type == RPC_FC_WCHAR)) + if (var->ptr_level == 1) { - print_server("NdrConformantStringUnmarshall(\n"); - indent++; - print_server("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_server("(unsigned char __RPC_FAR * __RPC_FAR *)&%s,\n", var->name); - print_server("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u],\n", *type_offset + 2); - print_server("(unsigned char)0);\n"); - indent--; - fprintf(server, "\n"); + ptr_attr = is_attr(var->attrs, ATTR_PTR); + ref_attr = is_attr(var->attrs, ATTR_REF); + unique_attr = is_attr(var->attrs, ATTR_UNIQUE); + if (ptr_attr + ref_attr + unique_attr == 0) + ref_attr = 1; + + if (ref_attr) + { + if (string_attr && + (var->type->type == RPC_FC_CHAR || var->type->type == RPC_FC_WCHAR)) + { + print_server("NdrConformantStringUnmarshall(\n"); + indent++; + print_server("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); + print_server("(unsigned char __RPC_FAR * __RPC_FAR *)&%s,\n", var->name); + print_server("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u],\n", *type_offset + 2); + print_server("(unsigned char)0);\n"); + indent--; + fprintf(server, "\n"); + } + else + { + alignment = 0; + switch (var->type->type) + { + case RPC_FC_BYTE: + case RPC_FC_CHAR: + case RPC_FC_SMALL: + size = 1; + alignment = 0; + break; + + case RPC_FC_WCHAR: + case RPC_FC_USHORT: + case RPC_FC_SHORT: + size = 2; + if (last_size != 0 && last_size < 2) + alignment = (2 - last_size); + break; + + case RPC_FC_ULONG: + case RPC_FC_LONG: + case RPC_FC_FLOAT: + size = 4; + if (last_size != 0 && last_size < 4) + alignment = (4 - last_size); + break; + + case RPC_FC_HYPER: + case RPC_FC_DOUBLE: + size = 8; + if (last_size != 0 && last_size < 4) + alignment = (4 - last_size); + break; + + case RPC_FC_IGNORE: + size = 0; + break; + + default: + error("%s:%d Unknown/unsupported type 0x%x\n", + __FUNCTION__,__LINE__, var->type->type); + return; + } + + if (size != 0) + { + if (alignment != 0) + print_server("_StubMsg.Buffer += %u;\n", alignment); + + print_server(""); + write_name(server, var); + fprintf(server, " = ("); + write_type(server, var->type, NULL, var->tname); + fprintf(server, " __RPC_FAR*)_StubMsg.Buffer;\n"); + print_server("_StubMsg.Buffer += sizeof("); + write_type(server, var->type, NULL, var->tname); + fprintf(server, ");\n"); + fprintf(server, "\n"); + + last_size = size; + } + } + } + else if (unique_attr) + { + print_server("NdrPointerUnmarshall(\n"); + indent++; + print_server("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); + print_server("(unsigned char __RPC_FAR * __RPC_FAR *)&%s,\n", var->name); + print_server("(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%u],\n", *type_offset); + print_server("(unsigned char)0);\n"); + indent--; + fprintf(server, "\n"); + } + } else { @@ -523,35 +625,15 @@ if (alignment != 0) print_server("_StubMsg.Buffer += %u;\n", alignment); - if (var->ptr_level == 0) - { - print_server(""); - write_name(server, var); - fprintf(server, " = *(("); - write_type(server, var->type, NULL, var->tname); - fprintf(server, " __RPC_FAR*)_StubMsg.Buffer);\n"); - print_server("_StubMsg.Buffer += sizeof("); - write_type(server, var->type, NULL, var->tname); - fprintf(server, ");\n"); - fprintf(server, "\n"); - } - else if (var->ptr_level == 1) - { - print_server(""); - write_name(server, var); - fprintf(server, " = ("); - write_type(server, var->type, NULL, var->tname); - fprintf(server, " __RPC_FAR*)_StubMsg.Buffer;\n"); - print_server("_StubMsg.Buffer += sizeof("); - write_type(server, var->type, NULL, var->tname); - fprintf(server, ");\n"); - fprintf(server, "\n"); - } - else - { - error("Pointer level %d is not supported!\n", var->ptr_level); - return; - } + print_server(""); + write_name(server, var); + fprintf(server, " = *(("); + write_type(server, var->type, NULL, var->tname); + fprintf(server, " __RPC_FAR*)_StubMsg.Buffer);\n"); + print_server("_StubMsg.Buffer += sizeof("); + write_type(server, var->type, NULL, var->tname); + fprintf(server, ");\n"); + fprintf(server, "\n"); last_size = size; } _____ Modified: trunk/reactos/tools/widl/widltypes.h --- trunk/reactos/tools/widl/widltypes.h 2005-04-03 12:14:30 UTC (rev 14473) +++ trunk/reactos/tools/widl/widltypes.h 2005-04-03 12:49:25 UTC (rev 14474) @@ -98,8 +98,10 @@ ATTR_PROPGET, ATTR_PROPPUT, ATTR_PROPPUTREF, + ATTR_PTR, ATTR_PUBLIC, ATTR_READONLY, + ATTR_REF, ATTR_RESTRICTED, ATTR_RETVAL, ATTR_SIZEIS, @@ -108,6 +110,7 @@ ATTR_SWITCHIS, ATTR_SWITCHTYPE, ATTR_TRANSMITAS, + ATTR_UNIQUE, ATTR_UUID, ATTR_V1ENUM, ATTR_VARARG, _____ Modified: trunk/reactos/tools/widl/y.tab.c --- trunk/reactos/tools/widl/y.tab.c 2005-04-03 12:14:30 UTC (rev 14473) +++ trunk/reactos/tools/widl/y.tab.c 2005-04-03 12:49:25 UTC (rev 14474) @@ -91,40 +91,41 @@ #define tPROPGET 341 #define tPROPPUT 342 #define tPROPPUTREF 343 -#define tPUBLIC 344 -#define tREADONLY 345 -#define tREF 346 -#define tRESTRICTED 347 -#define tRETVAL 348 -#define tSHORT 349 -#define tSIGNED 350 -#define tSIZEIS 351 -#define tSIZEOF 352 -#define tSMALL 353 -#define tSOURCE 354 -#define tSTDCALL 355 -#define tSTRING 356 -#define tSTRUCT 357 -#define tSWITCH 358 -#define tSWITCHIS 359 -#define tSWITCHTYPE 360 -#define tTRANSMITAS 361 -#define tTYPEDEF 362 -#define tUNION 363 -#define tUNIQUE 364 -#define tUNSIGNED 365 -#define tUUID 366 -#define tV1ENUM 367 -#define tVARARG 368 -#define tVERSION 369 -#define tVOID 370 -#define tWCHAR 371 -#define tWIREMARSHAL 372 -#define tPOINTERTYPE 373 -#define COND 374 -#define CAST 375 -#define PPTR 376 -#define NEG 377 +#define tPTR 344 +#define tPUBLIC 345 +#define tREADONLY 346 +#define tREF 347 +#define tRESTRICTED 348 +#define tRETVAL 349 +#define tSHORT 350 +#define tSIGNED 351 +#define tSIZEIS 352 +#define tSIZEOF 353 +#define tSMALL 354 +#define tSOURCE 355 +#define tSTDCALL 356 +#define tSTRING 357 +#define tSTRUCT 358 +#define tSWITCH 359 +#define tSWITCHIS 360 +#define tSWITCHTYPE 361 +#define tTRANSMITAS 362 +#define tTYPEDEF 363 +#define tUNION 364 +#define tUNIQUE 365 +#define tUNSIGNED 366 +#define tUUID 367 +#define tV1ENUM 368 +#define tVARARG 369 +#define tVERSION 370 +#define tVOID 371 +#define tWCHAR 372 +#define tWIREMARSHAL 373 +#define tPOINTERTYPE 374 +#define COND 375 +#define CAST 376 +#define PPTR 377 +#define NEG 378 #line 1 "parser.y" @@ -256,26 +257,26 @@ -#define YYFINAL 459 +#define YYFINAL 462 #define YYFLAG -32768 -#define YYNTBASE 143 +#define YYNTBASE 144 -#define YYTRANSLATE(x) ((unsigned)(x) <= 377 ? yytranslate[x] : 215) +#define YYTRANSLATE(x) ((unsigned)(x) <= 378 ? yytranslate[x] : 216) static const short yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 123, 2, 133, - 134, 126, 125, 120, 124, 142, 127, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 139, 132, 2, - 140, 2, 141, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 124, 2, 134, + 135, 127, 126, 121, 125, 143, 128, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 140, 133, 2, + 141, 2, 142, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 137, 2, 138, 2, 2, 2, 2, 2, 2, 2, + 138, 2, 139, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 135, 122, 136, 128, 2, 2, 2, 2, + 2, 2, 136, 123, 137, 129, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -300,7 +301,7 @@ 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 121, 129, 130, 131 + 117, 118, 119, 120, 122, 130, 131, 132 }; #if YYDEBUG != 0 @@ -315,132 +316,133 @@ 222, 224, 226, 231, 236, 241, 246, 251, 253, 258, 260, 265, 271, 273, 275, 280, 282, 284, 286, 288, 290, 292, 294, 299, 301, 303, 305, 307, 309, 311, - 313, 318, 320, 322, 327, 332, 337, 342, 344, 346, - 351, 356, 358, 359, 361, 362, 365, 370, 374, 380, - 381, 384, 386, 388, 392, 396, 398, 404, 406, 410, - 411, 413, 415, 417, 419, 425, 429, 433, 437, 441, - 445, 449, 453, 457, 460, 463, 466, 471, 476, 480, - 482, 486, 488, 493, 494, 497, 500, 504, 507, 509, - 514, 522, 523, 525, 526, 528, 530, 532, 534, 536, - 538, 540, 542, 544, 546, 549, 552, 554, 556, 558, - 560, 562, 564, 565, 567, 569, 572, 575, 578, 581, - 583, 585, 588, 591, 594, 599, 600, 603, 606, 609, - 612, 615, 618, 622, 625, 629, 635, 636, 639, 642, - 645, 648, 654, 662, 664, 667, 670, 673, 676, 679, - 684, 687, 690, 692, 694, 698, 700, 704, 706, 708, - 714, 716, 718, 720, 723, 725, 728, 730, 733, 735, - 738, 743, 749, 760, 762 + 313, 315, 317, 322, 324, 326, 331, 336, 341, 343, + 348, 350, 352, 357, 362, 364, 365, 367, 368, 371, + 376, 380, 386, 387, 390, 392, 394, 398, 402, 404, + 410, 412, 416, 417, 419, 421, 423, 425, 431, 435, + 439, 443, 447, 451, 455, 459, 463, 466, 469, 472, + 477, 482, 486, 488, 492, 494, 499, 500, 503, 506, + 510, 513, 515, 520, 528, 529, 531, 532, 534, 536, + 538, 540, 542, 544, 546, 548, 550, 552, 555, 558, + 560, 562, 564, 566, 568, 570, 571, 573, 575, 578, + 581, 584, 587, 589, 591, 594, 597, 600, 605, 606, + 609, 612, 615, 618, 621, 624, 628, 631, 635, 641, + 642, 645, 648, 651, 654, 660, 668, 670, 673, 676, + 679, 682, 685, 690, 693, 696, 698, 700, 704, 706, + 710, 712, 714, 720, 722, 724, 726, 729, 731, 734, + 736, 739, 741, 744, 749, 755, 766, 768 }; -static const short yyrhs[] = { 144, - 0, 0, 144, 202, 0, 144, 201, 0, 144, 190, - 0, 144, 205, 0, 144, 153, 0, 144, 147, 0, - 0, 145, 202, 0, 145, 201, 0, 145, 190, 0, - 145, 205, 0, 145, 147, 0, 0, 146, 181, 132, - 0, 146, 147, 0, 132, 0, 167, 132, 0, 148, - 0, 171, 132, 0, 177, 132, 0, 150, 0, 210, - 132, 0, 212, 132, 0, 213, 132, 0, 37, 133, - 7, 134, 0, 64, 7, 132, 0, 149, 145, 9, - 0, 74, 3, 0, 161, 151, 135, 0, 152, 145, - 136, 0, 0, 156, 0, 116, 0, 157, 0, 156, - 120, 157, 0, 155, 0, 161, 211, 207, 158, 0, - 211, 207, 158, 0, 161, 211, 207, 133, 154, 134, - 0, 211, 207, 133, 154, 134, 0, 0, 137, 159, - 138, 0, 137, 126, 138, 0, 173, 0, 159, 120, - 174, 0, 159, 138, 137, 174, 0, 0, 161, 0, - 137, 162, 138, 0, 163, 0, 162, 120, 163, 0, - 162, 138, 137, 163, 0, 16, 0, 18, 0, 24, - 133, 184, 134, 0, 26, 133, 175, 134, 0, 33, +static const short yyrhs[] = { 145, + 0, 0, 145, 203, 0, 145, 202, 0, 145, 191, + 0, 145, 206, 0, 145, 154, 0, 145, 148, 0, + 0, 146, 203, 0, 146, 202, 0, 146, 191, 0, + 146, 206, 0, 146, 148, 0, 0, 147, 182, 133, + 0, 147, 148, 0, 133, 0, 168, 133, 0, 149, + 0, 172, 133, 0, 178, 133, 0, 151, 0, 211, + 133, 0, 213, 133, 0, 214, 133, 0, 37, 134, + 7, 135, 0, 64, 7, 133, 0, 150, 146, 9, + 0, 74, 3, 0, 162, 152, 136, 0, 153, 146, + 137, 0, 0, 157, 0, 117, 0, 158, 0, 157, + 121, 158, 0, 156, 0, 162, 212, 208, 159, 0, + 212, 208, 159, 0, 162, 212, 208, 134, 155, 135, + 0, 212, 208, 134, 155, 135, 0, 0, 138, 160, + 139, 0, 138, 127, 139, 0, 174, 0, 160, 121, + 175, 0, 160, 139, 138, 175, 0, 0, 162, 0, + 138, 163, 139, 0, 164, 0, 163, 121, 164, 0, + 163, 139, 138, 164, 0, 16, 0, 18, 0, 24, + 134, 185, 135, 0, 26, 134, 176, 135, 0, 33, 0, 34, 0, 35, 0, 36, 0, 38, 0, 39, - 133, 176, 134, 0, 39, 133, 7, 134, 0, 41, - 133, 7, 134, 0, 43, 0, 44, 133, 7, 134, - 0, 45, 133, 7, 134, 0, 45, 133, 176, 134, - 0, 48, 0, 51, 0, 53, 133, 176, 134, 0, - 54, 133, 7, 134, 0, 55, 133, 7, 134, 0, - 56, 133, 176, 134, 0, 57, 133, 7, 134, 0, - 58, 0, 60, 133, 176, 134, 0, 61, 0, 62, - 133, 184, 134, 0, 63, 133, 52, 3, 134, 0, - 66, 0, 69, 0, 73, 133, 172, 134, 0, 75, + 134, 177, 135, 0, 39, 134, 7, 135, 0, 41, + 134, 7, 135, 0, 43, 0, 44, 134, 7, 135, + 0, 45, 134, 7, 135, 0, 45, 134, 177, 135, + 0, 48, 0, 51, 0, 53, 134, 177, 135, 0, + 54, 134, 7, 135, 0, 55, 134, 7, 135, 0, + 56, 134, 177, 135, 0, 57, 134, 7, 135, 0, + 58, 0, 60, 134, 177, 135, 0, 61, 0, 62, + 134, 185, 135, 0, 63, 134, 52, 3, 135, 0, + 66, 0, 69, 0, 73, 134, 173, 135, 0, 75, 0, 79, 0, 80, 0, 81, 0, 82, 0, 83, - 0, 84, 0, 85, 133, 209, 134, 0, 87, 0, - 88, 0, 89, 0, 90, 0, 91, 0, 93, 0, - 94, 0, 97, 133, 172, 134, 0, 100, 0, 102, - 0, 105, 133, 174, 134, 0, 106, 133, 211, 134, - 0, 107, 133, 211, 134, 0, 112, 133, 8, 134, - 0, 113, 0, 114, 0, 115, 133, 214, 134, 0, - 118, 133, 211, 134, 0, 209, 0, 0, 101, 0, - 0, 165, 166, 0, 26, 174, 139, 179, 0, 38, - 139, 179, 0, 32, 211, 184, 140, 176, 0, 0, - 169, 120, 0, 169, 0, 170, 0, 169, 120, 170, - 0, 184, 140, 176, 0, 184, 0, 46, 183, 135, - 168, 136, 0, 173, 0, 172, 120, 173, 0, 0, - 174, 0, 5, 0, 6, 0, 3, 0, 174, 141, - 174, 139, 174, 0, 174, 122, 174, 0, 174, 123, - 174, 0, 174, 125, 174, 0, 174, 124, 174, 0, - 174, 126, 174, 0, 174, 127, 174, 0, 174, 10, - 174, 0, 174, 11, 174, 0, 128, 174, 0, 124, - 174, 0, 126, 174, 0, 133, 211, 134, 174, 0, - 98, 133, 211, 134, 0, 133, 174, 134, 0, 176, - 0, 175, 120, 176, 0, 174, 0, 49, 32, 211, - 184, 0, 0, 178, 179, 0, 180, 132, 0, 160, - 213, 132, 0, 161, 132, 0, 132, 0, 160, 211, - 207, 158, 0, 160, 211, 164, 207, 133, 154, 134, - 0, 0, 184, 0, 0, 3, 0, 4, 0, 3, - 0, 4, 0, 60, 0, 94, 0, 115, 0, 22, - 0, 117, 0, 187, 0, 96, 187, 0, 111, 187, - 0, 111, 0, 50, 0, 42, 0, 20, 0, 47, - 0, 52, 0, 0, 70, 0, 70, 0, 99, 186, - 0, 95, 186, 0, 76, 186, 0, 59, 186, 0, - 71, 0, 28, 0, 29, 3, 0, 29, 4, 0, - 161, 188, 0, 189, 135, 191, 136, 0, 0, 191, - 192, 0, 160, 202, 0, 40, 3, 0, 40, 4, - 0, 161, 193, 0, 86, 139, 0, 195, 180, 132, - 0, 77, 139, 0, 196, 181, 132, 0, 194, 135, - 195, 196, 136, 0, 0, 139, 4, 0, 72, 3, - 0, 72, 4, 0, 161, 199, 0, 200, 198, 135, - 146, 136, 0, 200, 139, 3, 135, 150, 146, 136, [truncated at 1000 lines; 2291 more skipped]
19 years, 7 months
1
0
0
0
[mf] 14473: protect system image list
by mf@svn.reactos.com
protect system image list Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp Modified: trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp --- branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp 2005-04-03 11:58:31 UTC (rev 14472) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp 2005-04-03 12:14:30 UTC (rev 14473) @@ -69,6 +69,8 @@ ShellBrowserChild::~ShellBrowserChild() { + TreeView_SetImageList(_left_hwnd, 0, TVSIL_NORMAL); + if (_pShellView) _pShellView->Release(); @@ -102,7 +104,7 @@ InitDragDrop(); } - const String& root_name = GetDesktopFolder().get_name(_create_info._root_shell_path, SHGDN_FORPARSING); + const String& root_name = GetDesktopFolder().get_name(_create_info._root_shell_path, SHGDN_FORADDRESSBAR); _root._drive_type = DRIVE_UNKNOWN; lstrcpy(_root._volname, root_name); _____ Modified: trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp --- trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp 2005-04-03 11:58:31 UTC (rev 14472) +++ trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp 2005-04-03 12:14:30 UTC (rev 14473) @@ -50,6 +50,8 @@ ShellBrowser::~ShellBrowser() { + TreeView_SetImageList(_left_hwnd, 0, TVSIL_NORMAL); + if (_pShellView) _pShellView->Release();
19 years, 7 months
1
0
0
0
← Newer
1
...
37
38
39
40
41
42
43
...
48
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
Results per page:
10
25
50
100
200