ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
October 2005
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
26 participants
737 discussions
Start a n
N
ew thread
[turner] 18889: Add a new function to return a path with correct casing. Remove the get[short/long]pathname hack that was there before to do it.
by turner@svn.reactos.com
Add a new function to return a path with correct casing. Remove the get[short/long]pathname hack that was there before to do it. Modified: trunk/reactos/subsys/system/cmd/cmd.h Modified: trunk/reactos/subsys/system/cmd/internal.c Modified: trunk/reactos/subsys/system/cmd/misc.c _____ Modified: trunk/reactos/subsys/system/cmd/cmd.h --- trunk/reactos/subsys/system/cmd/cmd.h 2005-10-30 17:30:53 UTC (rev 18888) +++ trunk/reactos/subsys/system/cmd/cmd.h 2005-10-30 17:50:03 UTC (rev 18889) @@ -300,6 +300,7 @@ BOOL IsExistingFile (LPCTSTR); BOOL IsExistingDirectory (LPCTSTR); BOOL FileGetString (HANDLE, LPTSTR, INT); +VOID GetPathCase(TCHAR *, TCHAR *); #define PROMPT_NO 0 #define PROMPT_YES 1 _____ Modified: trunk/reactos/subsys/system/cmd/internal.c --- trunk/reactos/subsys/system/cmd/internal.c 2005-10-30 17:30:53 UTC (rev 18888) +++ trunk/reactos/subsys/system/cmd/internal.c 2005-10-30 17:50:03 UTC (rev 18889) @@ -241,8 +241,8 @@ /* The use of both of these together will correct the case of a path where as one alone or GetFullPath will not. Exameple: c:\windows\SYSTEM32 => C:\WINDOWS\system32 */ - GetShortPathName(OutPathTemp, OutPathTemp2, MAX_PATH); - GetLongPathName(OutPathTemp2, OutPath, MAX_PATH); + GetFullPathName(OutPathTemp, MAX_PATH, OutPathTemp2, NULL); + GetPathCase(OutPathTemp2, OutPath); fail = SetCurrentDirectory(OutPath); if (!fail) @@ -395,19 +395,19 @@ _tcscat(szFinalPath,f.cFileName); if ((f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY) - { + { if(!SetRootPath(szFinalPath)) { /* Change for /D */ if(bChangeDrive) - { - _tcsupr(szFinalPath); - GetLongPathName(szFinalPath, szPath, MAX_PATH); - SetCurrentDirectory(szPath); - } + { + _tcsupr(szFinalPath); + GetPathCase(szFinalPath, szPath); + SetCurrentDirectory(szPath); + } return 0; } - + } }while(FindNextFile (hFile, &f)); _____ Modified: trunk/reactos/subsys/system/cmd/misc.c --- trunk/reactos/subsys/system/cmd/misc.c 2005-10-30 17:30:53 UTC (rev 18888) +++ trunk/reactos/subsys/system/cmd/misc.c 2005-10-30 17:50:03 UTC (rev 18889) @@ -68,7 +68,47 @@ #endif /* _UNICODE */ } +/* + * Takes a path in and returns it with the correct case of the letters + */ +VOID GetPathCase( TCHAR * Path, TCHAR * OutPath) +{ + INT i = 0; + _tcscpy(OutPath, _T("")); + TCHAR TempPath[MAX_PATH]; + WIN32_FIND_DATA FindFileData; + HANDLE hFind; + _tcscpy(TempPath, _T("")); + + for(i = 0; i < _tcslen(Path); i++) + { + if(Path[i] != _T('\\')) + { + _tcsncat(TempPath, &Path[i], 1); + if(i != _tcslen(Path) - 1) + continue; + } + /* Handle the base part of the path different. + Because if you put it into findfirstfile, it will + return your current folder */ + if(_tcslen(TempPath) == 2 && TempPath[1] == _T(':')) + { + _tcscat(OutPath, TempPath); + _tcscat(OutPath, _T("\\")); + _tcscat(TempPath, _T("\\")); + } + else + { + hFind = FindFirstFile(TempPath,&FindFileData); + _tcscat(TempPath, _T("\\")); + _tcscat(OutPath, FindFileData.cFileName); + _tcscat(OutPath, _T("\\")); + CloseHandle(hFind); + } + } +} + /* * Check if Ctrl-Break was pressed during the last calls */
19 years, 1 month
1
0
0
0
[weiden] 18888: fixed difference in signedness warnings
by weiden@svn.reactos.com
fixed difference in signedness warnings Modified: trunk/reactos/lib/ddraw/main/clipper_main.c Modified: trunk/reactos/lib/ddraw/main/color_main.c Modified: trunk/reactos/lib/ddraw/main/gamma_main.c Modified: trunk/reactos/lib/ddraw/main/palette_main.c Modified: trunk/reactos/lib/ddraw/main/surface_main.c _____ Modified: trunk/reactos/lib/ddraw/main/clipper_main.c --- trunk/reactos/lib/ddraw/main/clipper_main.c 2005-10-30 16:14:42 UTC (rev 18887) +++ trunk/reactos/lib/ddraw/main/clipper_main.c 2005-10-30 17:30:53 UTC (rev 18888) @@ -14,7 +14,7 @@ ULONG WINAPI Main_DirectDrawClipper_Release(LPDIRECTDRAWCLIPPER iface) { IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - ULONG ref = InterlockedDecrement(&This->DirectDrawGlobal.dwRefCnt); + ULONG ref = InterlockedDecrement((PLONG)&This->DirectDrawGlobal.dwRefCnt); if (ref == 0) HeapFree(GetProcessHeap(), 0, This); _____ Modified: trunk/reactos/lib/ddraw/main/color_main.c --- trunk/reactos/lib/ddraw/main/color_main.c 2005-10-30 16:14:42 UTC (rev 18887) +++ trunk/reactos/lib/ddraw/main/color_main.c 2005-10-30 17:30:53 UTC (rev 18888) @@ -23,7 +23,7 @@ Main_DirectDrawColorControl_Release(LPDIRECTDRAWCOLORCONTROL iface) { IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - ULONG ref = InterlockedDecrement(&This->DirectDrawGlobal.dwRefCnt); + ULONG ref = InterlockedDecrement((PLONG)&This->DirectDrawGlobal.dwRefCnt); if (ref == 0) HeapFree(GetProcessHeap(), 0, This); _____ Modified: trunk/reactos/lib/ddraw/main/gamma_main.c --- trunk/reactos/lib/ddraw/main/gamma_main.c 2005-10-30 16:14:42 UTC (rev 18887) +++ trunk/reactos/lib/ddraw/main/gamma_main.c 2005-10-30 17:30:53 UTC (rev 18888) @@ -23,7 +23,7 @@ Main_DirectDrawGammaControl_Release(LPDIRECTDRAWGAMMACONTROL iface) { IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - ULONG ref = InterlockedDecrement(&This->DirectDrawGlobal.dwRefCnt); + ULONG ref = InterlockedDecrement((PLONG)&This->DirectDrawGlobal.dwRefCnt); if (ref == 0) HeapFree(GetProcessHeap(), 0, This); _____ Modified: trunk/reactos/lib/ddraw/main/palette_main.c --- trunk/reactos/lib/ddraw/main/palette_main.c 2005-10-30 16:14:42 UTC (rev 18887) +++ trunk/reactos/lib/ddraw/main/palette_main.c 2005-10-30 17:30:53 UTC (rev 18888) @@ -22,7 +22,7 @@ ULONG WINAPI Main_DirectDrawPalette_AddRef(LPDIRECTDRAWPALETTE iface) { IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - ULONG ref = InterlockedDecrement(&This->DirectDrawGlobal.dwRefCnt); + ULONG ref = InterlockedDecrement((PLONG)&This->DirectDrawGlobal.dwRefCnt); if (ref == 0) HeapFree(GetProcessHeap(), 0, This); _____ Modified: trunk/reactos/lib/ddraw/main/surface_main.c --- trunk/reactos/lib/ddraw/main/surface_main.c 2005-10-30 16:14:42 UTC (rev 18887) +++ trunk/reactos/lib/ddraw/main/surface_main.c 2005-10-30 17:30:53 UTC (rev 18888) @@ -95,13 +95,13 @@ { IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; - return InterlockedIncrement(&This->owner->DirectDrawGlobal.dsList->dwIntRefCnt) ; + return InterlockedIncrement((PLONG)&This->owner->DirectDrawGlobal.dsList->dwInt RefCnt); } ULONG WINAPI Main_DDrawSurface_Release(LPDIRECTDRAWSURFACE7 iface) { IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; - ULONG ref = InterlockedDecrement(&This->owner->DirectDrawGlobal.dsList->dwIntRefCnt) ; + ULONG ref = InterlockedDecrement((PLONG)&This->owner->DirectDrawGlobal.dsList->dwInt RefCnt); if (ref == 0) HeapFree(GetProcessHeap(), 0, This);
19 years, 1 month
1
0
0
0
[greatlrd] 18887: Fix broke SVN after me, thx to it I found wrong ref was release in different place fixed
by greatlrd@svn.reactos.com
Fix broke SVN after me, thx to it I found wrong ref was release in different place fixed Modified: trunk/reactos/lib/ddraw/main/clipper_main.c Modified: trunk/reactos/lib/ddraw/main/color_main.c Modified: trunk/reactos/lib/ddraw/main/gamma_main.c Modified: trunk/reactos/lib/ddraw/main/palette_main.c Modified: trunk/reactos/lib/ddraw/main/surface_main.c Modified: trunk/reactos/lib/ddraw/rosdraw.h _____ Modified: trunk/reactos/lib/ddraw/main/clipper_main.c --- trunk/reactos/lib/ddraw/main/clipper_main.c 2005-10-30 15:45:40 UTC (rev 18886) +++ trunk/reactos/lib/ddraw/main/clipper_main.c 2005-10-30 16:14:42 UTC (rev 18887) @@ -13,8 +13,8 @@ ULONG WINAPI Main_DirectDrawClipper_Release(LPDIRECTDRAWCLIPPER iface) { - IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; - ULONG ref = InterlockedDecrement(&This->ref); + IDirectDrawImpl* This = (IDirectDrawImpl*)iface; + ULONG ref = InterlockedDecrement(&This->DirectDrawGlobal.dwRefCnt); if (ref == 0) HeapFree(GetProcessHeap(), 0, This); _____ Modified: trunk/reactos/lib/ddraw/main/color_main.c --- trunk/reactos/lib/ddraw/main/color_main.c 2005-10-30 15:45:40 UTC (rev 18886) +++ trunk/reactos/lib/ddraw/main/color_main.c 2005-10-30 16:14:42 UTC (rev 18887) @@ -22,8 +22,8 @@ ULONG WINAPI Main_DirectDrawColorControl_Release(LPDIRECTDRAWCOLORCONTROL iface) { - IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; - ULONG ref = InterlockedDecrement(&This->ref); + IDirectDrawImpl* This = (IDirectDrawImpl*)iface; + ULONG ref = InterlockedDecrement(&This->DirectDrawGlobal.dwRefCnt); if (ref == 0) HeapFree(GetProcessHeap(), 0, This); _____ Modified: trunk/reactos/lib/ddraw/main/gamma_main.c --- trunk/reactos/lib/ddraw/main/gamma_main.c 2005-10-30 15:45:40 UTC (rev 18886) +++ trunk/reactos/lib/ddraw/main/gamma_main.c 2005-10-30 16:14:42 UTC (rev 18887) @@ -22,8 +22,8 @@ ULONG WINAPI Main_DirectDrawGammaControl_Release(LPDIRECTDRAWGAMMACONTROL iface) { - IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; - ULONG ref = InterlockedDecrement(&This->ref); + IDirectDrawImpl* This = (IDirectDrawImpl*)iface; + ULONG ref = InterlockedDecrement(&This->DirectDrawGlobal.dwRefCnt); if (ref == 0) HeapFree(GetProcessHeap(), 0, This); _____ Modified: trunk/reactos/lib/ddraw/main/palette_main.c --- trunk/reactos/lib/ddraw/main/palette_main.c 2005-10-30 15:45:40 UTC (rev 18886) +++ trunk/reactos/lib/ddraw/main/palette_main.c 2005-10-30 16:14:42 UTC (rev 18887) @@ -21,8 +21,8 @@ ULONG WINAPI Main_DirectDrawPalette_AddRef(LPDIRECTDRAWPALETTE iface) { - IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; - ULONG ref = InterlockedDecrement(&This->ref); + IDirectDrawImpl* This = (IDirectDrawImpl*)iface; + ULONG ref = InterlockedDecrement(&This->DirectDrawGlobal.dwRefCnt); if (ref == 0) HeapFree(GetProcessHeap(), 0, This); _____ Modified: trunk/reactos/lib/ddraw/main/surface_main.c --- trunk/reactos/lib/ddraw/main/surface_main.c 2005-10-30 15:45:40 UTC (rev 18886) +++ trunk/reactos/lib/ddraw/main/surface_main.c 2005-10-30 16:14:42 UTC (rev 18887) @@ -94,13 +94,14 @@ ULONG WINAPI Main_DDrawSurface_AddRef(LPDIRECTDRAWSURFACE7 iface) { IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; - return InterlockedIncrement(&This->ref); + + return InterlockedIncrement(&This->owner->DirectDrawGlobal.dsList->dwIntRefCnt) ; } ULONG WINAPI Main_DDrawSurface_Release(LPDIRECTDRAWSURFACE7 iface) { IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; - ULONG ref = InterlockedDecrement(&This->ref); + ULONG ref = InterlockedDecrement(&This->owner->DirectDrawGlobal.dsList->dwIntRefCnt) ; if (ref == 0) HeapFree(GetProcessHeap(), 0, This); _____ Modified: trunk/reactos/lib/ddraw/rosdraw.h --- trunk/reactos/lib/ddraw/rosdraw.h 2005-10-30 15:45:40 UTC (rev 18886) +++ trunk/reactos/lib/ddraw/rosdraw.h 2005-10-30 16:14:42 UTC (rev 18887) @@ -41,6 +41,10 @@ IDirectDrawImpl* owner; + DDRAWI_DDRAWSURFACE_GBL Global; + DDRAWI_DDRAWSURFACE_MORE More; + DDRAWI_DDRAWSURFACE_LCL Local; + } IDirectDrawSurfaceImpl; /******** Clipper Object ********/
19 years, 1 month
1
0
0
0
[greatlrd] 18886: adding more stuff for create surface right
by greatlrd@svn.reactos.com
adding more stuff for create surface right Modified: trunk/reactos/lib/ddraw/hal/ddraw_hal.c Modified: trunk/reactos/lib/ddraw/main/ddraw_main.c Modified: trunk/reactos/lib/ddraw/rosdraw.h _____ Modified: trunk/reactos/lib/ddraw/hal/ddraw_hal.c --- trunk/reactos/lib/ddraw/hal/ddraw_hal.c 2005-10-30 15:39:00 UTC (rev 18885) +++ trunk/reactos/lib/ddraw/hal/ddraw_hal.c 2005-10-30 15:45:40 UTC (rev 18886) @@ -319,8 +319,35 @@ + /* */ + /* DWORD dwIntRefCnt; + + LPVOID lpVtbl; + LPDDRAWI_DDRAWSURFACE_LCL lpLcl; + LPDDRAWI_DDRAWSURFACE_INT lpLink; + + } DDRAWI_DDRAWSURFACE_INT; + */ + /* Setting up some part for surface not ever thing are being fill in yet */ + This->DirectDrawGlobal.dsList = (LPDDRAWI_DDRAWSURFACE_INT)HeapAlloc(GetProcessHeap(), 0, + sizeof(DDRAWI_DDRAWSURFACE_INT)); + + This->DirectDrawGlobal.dsList->lpLink = (LPDDRAWI_DDRAWSURFACE_INT) &This->DirectDrawGlobal.dsList; + + This->DirectDrawGlobal.dsList->lpLcl = (LPDDRAWI_DDRAWSURFACE_LCL)HeapAlloc(GetProcessHeap(), 0, + sizeof(DDRAWI_DDRAWSURFACE_LCL)); + + This->DirectDrawGlobal.dsList->lpLcl->lpGbl = + (LPDDRAWI_DDRAWSURFACE_GBL)HeapAlloc(GetProcessHeap(), 0, sizeof(DDRAWI_DDRAWSURFACE_GBL)); + + This->DirectDrawGlobal.dsList->lpLcl->lpGbl->lpDD = &This->DirectDrawGlobal; + + + + + /* Now all setup for HAL is done and we hopply do not have forget anything */ return DD_OK; @@ -328,7 +355,25 @@ HRESULT Hal_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface) { - return DD_OK; + IDirectDrawImpl* This = (IDirectDrawImpl*)iface; + + DDHAL_SETEXCLUSIVEMODEDATA SetExclusiveMode; + + if (!(This->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE)) + { + return DDERR_NODRIVERSUPPORT; + } + + SetExclusiveMode.lpDD = &This->DirectDrawGlobal; + SetExclusiveMode.ddRVal = DDERR_NOTPALETTIZED; + SetExclusiveMode.dwEnterExcl = This->cooperative_level; + + if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.SetExclusiveMode(&SetExclusiveM ode) != DDHAL_DRIVER_HANDLED) + { + return DDERR_NODRIVERSUPPORT; + } + + return SetExclusiveMode.ddRVal; } _____ Modified: trunk/reactos/lib/ddraw/main/ddraw_main.c --- trunk/reactos/lib/ddraw/main/ddraw_main.c 2005-10-30 15:39:00 UTC (rev 18885) +++ trunk/reactos/lib/ddraw/main/ddraw_main.c 2005-10-30 15:45:40 UTC (rev 18886) @@ -16,6 +16,8 @@ IDirectDrawImpl* This = (IDirectDrawImpl*)iface; HRESULT ret; + + // this if it is not called by DirectDrawCreate if(FALSE) return DDERR_ALREADYINITIALIZED; @@ -48,7 +50,6 @@ // - allow more Flags IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - HRESULT ret; // check the parameters if (This->cooperative_level == cooplevel && This->window == hwnd) @@ -72,20 +73,21 @@ This->cooperative_level = cooplevel; + if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE) + { + return Hal_DirectDraw_SetCooperativeLevel (iface); + } - if((ret = Hal_DirectDraw_SetCooperativeLevel (iface)) != DD_OK) - return ret; + return Hel_DirectDraw_SetCooperativeLevel(iface); - if((ret = Hel_DirectDraw_SetCooperativeLevel (iface)) != DD_OK) - return ret; - - return DD_OK; } HRESULT WINAPI Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) { DWORD ret; + + /* FIXME implement hal setMode */ if((ret = Hal_DirectDraw_SetDisplayMode(iface, dwWidth, dwHeight, dwBPP, dwRefreshRate, dwFlags)) == DD_OK) { @@ -174,8 +176,12 @@ That->lpVtbl = &DirectDrawSurface7_Vtable; That->lpVtbl_v3 = &DDRAW_IDDS3_Thunk_VTable; - That->ref = 1; + + That->owner->DirectDrawGlobal.dsList->dwIntRefCnt =1; + /* we alwasy set to use the DirectDrawSurface7_Vtable as internel */ + That->owner->DirectDrawGlobal.dsList->lpVtbl = (PVOID) &DirectDrawSurface7_Vtable; + *ppSurf = (LPDIRECTDRAWSURFACE7)That; // the real surface object creation _____ Modified: trunk/reactos/lib/ddraw/rosdraw.h --- trunk/reactos/lib/ddraw/rosdraw.h 2005-10-30 15:39:00 UTC (rev 18885) +++ trunk/reactos/lib/ddraw/rosdraw.h 2005-10-30 15:45:40 UTC (rev 18886) @@ -38,13 +38,7 @@ { IDirectDrawSurface7Vtbl* lpVtbl; IDirectDrawSurface3Vtbl* lpVtbl_v3; - - LONG ref; - - DDRAWI_DDRAWSURFACE_GBL Global; - DDRAWI_DDRAWSURFACE_MORE More; - DDRAWI_DDRAWSURFACE_LCL Local; - + IDirectDrawImpl* owner; } IDirectDrawSurfaceImpl;
19 years, 1 month
1
0
0
0
[mbosma] 18885: Fix compile
by mbosma@svn.reactos.com
Fix compile Modified: trunk/reactos/lib/ddraw/hal/surface_hal.c Modified: trunk/reactos/lib/ddraw/main/surface_main.c _____ Modified: trunk/reactos/lib/ddraw/hal/surface_hal.c --- trunk/reactos/lib/ddraw/hal/surface_hal.c 2005-10-30 15:34:03 UTC (rev 18884) +++ trunk/reactos/lib/ddraw/hal/surface_hal.c 2005-10-30 15:39:00 UTC (rev 18885) @@ -24,10 +24,10 @@ DDHAL_BLTDATA BltData; BltData.lpDD = &This->owner->DirectDrawGlobal; BltData.dwFlags = dwFlags; - BltData.lpDDDestSurface = This->local; + BltData.lpDDDestSurface = &This->Local; if(rDest) BltData.rDest = *(RECTL*)rDest; if(rSrc) BltData.rSrc = *(RECTL*)rSrc; - if(That) BltData.lpDDSrcSurface = That->local; + if(That) BltData.lpDDSrcSurface = &That->Local; if(lpbltfx) BltData.bltFX = *lpbltfx; if (This->owner->DirectDrawGlobal.lpDDCBtmp->HALDDSurface.Blt(&BltData) != DDHAL_DRIVER_HANDLED) @@ -37,4 +37,3 @@ return BltData.ddRVal; } - _____ Modified: trunk/reactos/lib/ddraw/main/surface_main.c --- trunk/reactos/lib/ddraw/main/surface_main.c 2005-10-30 15:34:03 UTC (rev 18884) +++ trunk/reactos/lib/ddraw/main/surface_main.c 2005-10-30 15:39:00 UTC (rev 18885) @@ -43,7 +43,7 @@ /* surface global struct */ memset(&This->Global, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL)); - This->Global.lpDD = &This->owner->DirectDrawThis->Global; + This->Global.lpDD = &This->owner->DirectDrawGlobal; This->Global.wHeight = This->owner->Height; This->Global.wWidth = This->owner->Width; This->Global.dwLinearSize = This->Global.wWidth * This->owner->Bpp/8;
19 years, 1 month
1
0
0
0
[mbosma] 18884: Implement IDirectDrawSurface::Blt for HAL
by mbosma@svn.reactos.com
Implement IDirectDrawSurface::Blt for HAL Modified: trunk/reactos/lib/ddraw/hal/surface_hal.c Modified: trunk/reactos/lib/ddraw/main/surface_main.c Modified: trunk/reactos/lib/ddraw/rosdraw.h _____ Modified: trunk/reactos/lib/ddraw/hal/surface_hal.c --- trunk/reactos/lib/ddraw/hal/surface_hal.c 2005-10-30 14:51:12 UTC (rev 18883) +++ trunk/reactos/lib/ddraw/hal/surface_hal.c 2005-10-30 15:34:03 UTC (rev 18884) @@ -10,30 +10,31 @@ #include "rosdraw.h" -HRESULT Hal_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst, - LPDIRECTDRAWSURFACE7 src, LPRECT rsrc, DWORD dwFlags, LPDDBLTFX lpbltfx) +HRESULT Hal_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rDest, + LPDIRECTDRAWSURFACE7 src, LPRECT rSrc, DWORD dwFlags, LPDDBLTFX lpbltfx) { - - DDHAL_BLTDATA BltData; - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; + IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; + IDirectDrawSurfaceImpl* That = (IDirectDrawSurfaceImpl*)src; - if (!(This->DirectDrawGlobal.lpDDCBtmp->HALDDSurface.dwFlags & DDHAL_SURFCB32_BLT)) + if (!(This->owner->DirectDrawGlobal.lpDDCBtmp->HALDDSurface.dwFlags & DDHAL_SURFCB32_BLT)) { return DDERR_NODRIVERSUPPORT; } - BltData.lpDD = &This->DirectDrawGlobal; - /* RtlCopyMemory( &BltData.bltFX, lpbltfx,sizeof(DDBLTFX)); */ - BltData.dwFlags = dwFlags; + DDHAL_BLTDATA BltData; + BltData.lpDD = &This->owner->DirectDrawGlobal; + BltData.dwFlags = dwFlags; + BltData.lpDDDestSurface = This->local; + if(rDest) BltData.rDest = *(RECTL*)rDest; + if(rSrc) BltData.rSrc = *(RECTL*)rSrc; + if(That) BltData.lpDDSrcSurface = That->local; + if(lpbltfx) BltData.bltFX = *lpbltfx; - /* FIXME blt is not complete */ - - if (This->DirectDrawGlobal.lpDDCBtmp->HALDDSurface.Blt(&BltData) != DDHAL_DRIVER_HANDLED) + if (This->owner->DirectDrawGlobal.lpDDCBtmp->HALDDSurface.Blt(&BltData) != DDHAL_DRIVER_HANDLED) { return DDERR_NODRIVERSUPPORT; } return BltData.ddRVal; - } _____ Modified: trunk/reactos/lib/ddraw/main/surface_main.c --- trunk/reactos/lib/ddraw/main/surface_main.c 2005-10-30 14:51:12 UTC (rev 18883) +++ trunk/reactos/lib/ddraw/main/surface_main.c 2005-10-30 15:34:03 UTC (rev 18884) @@ -41,38 +41,33 @@ return CanCreateData.ddRVal; } - /* down here we got a crach */ - /* surface global struct */ - DDRAWI_DDRAWSURFACE_GBL Global; - memset(&Global, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL)); - Global.lpDD = &This->owner->DirectDrawGlobal; - Global.wHeight = This->owner->Height; - Global.wWidth = This->owner->Width; - Global.dwLinearSize = Global.wWidth * This->owner->Bpp/8; + memset(&This->Global, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL)); + This->Global.lpDD = &This->owner->DirectDrawThis->Global; + This->Global.wHeight = This->owner->Height; + This->Global.wWidth = This->owner->Width; + This->Global.dwLinearSize = This->Global.wWidth * This->owner->Bpp/8; /* surface more struct */ - DDRAWI_DDRAWSURFACE_MORE More; - memset(&More, 0, sizeof(DDRAWI_DDRAWSURFACE_MORE)); - More.dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE); + memset(&This->More, 0, sizeof(DDRAWI_DDRAWSURFACE_MORE)); + This->More.dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE); /* surface local struct */ - DDRAWI_DDRAWSURFACE_LCL Local; - memset(&Local, 0, sizeof(DDRAWI_DDRAWSURFACE_LCL)); - Local.lpGbl = &Global; - Local.lpSurfMore = &More; - Local.ddsCaps = *(DDSCAPS*)&pDDSD->ddsCaps; + memset(&This->Local, 0, sizeof(DDRAWI_DDRAWSURFACE_LCL)); + This->Local.lpGbl = &This->Global; + This->Local.lpSurfMore = &This->More; + This->Local.ddsCaps = *(DDSCAPS*)&pDDSD->ddsCaps; /* we need to set some flags if we create the primary surface */ if(pDDSD->ddsCaps.dwCaps == DDSCAPS_PRIMARYSURFACE) { - Local.dwFlags |= DDRAWISURF_FRONTBUFFER; - Global.dwGlobalFlags |= DDRAWISURFGBL_ISGDISURFACE; + This->Local.dwFlags |= DDRAWISURF_FRONTBUFFER; + This->Global.dwGlobalFlags |= DDRAWISURFGBL_ISGDISURFACE; } /* for the double pointer below */ DDRAWI_DDRAWSURFACE_LCL *pLocal[2]; - pLocal[0] = &Local; + pLocal[0] = &This->Local; pLocal[1] = NULL; // we need this one for bad written drivers /* the parameter struct */ @@ -84,7 +79,6 @@ CreateData.lplpSList = pLocal; /* this is the call we were waiting for */ - MessageBox(0,0,0,0); if(This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.CreateSurface(&CreateD ata) == DDHAL_DRIVER_NOTHANDLED) return DDERR_INVALIDPARAMS; _____ Modified: trunk/reactos/lib/ddraw/rosdraw.h --- trunk/reactos/lib/ddraw/rosdraw.h 2005-10-30 14:51:12 UTC (rev 18883) +++ trunk/reactos/lib/ddraw/rosdraw.h 2005-10-30 15:34:03 UTC (rev 18884) @@ -41,6 +41,10 @@ LONG ref; + DDRAWI_DDRAWSURFACE_GBL Global; + DDRAWI_DDRAWSURFACE_MORE More; + DDRAWI_DDRAWSURFACE_LCL Local; + IDirectDrawImpl* owner; } IDirectDrawSurfaceImpl;
19 years, 1 month
1
0
0
0
[weiden] 18883: fix some flags calculations and access rights in CreateNamedPipe and CreatePipe
by weiden@svn.reactos.com
fix some flags calculations and access rights in CreateNamedPipe and CreatePipe Modified: trunk/reactos/lib/kernel32/file/npipe.c Modified: trunk/reactos/lib/kernel32/file/pipe.c _____ Modified: trunk/reactos/lib/kernel32/file/npipe.c --- trunk/reactos/lib/kernel32/file/npipe.c 2005-10-30 13:55:28 UTC (rev 18882) +++ trunk/reactos/lib/kernel32/file/npipe.c 2005-10-30 14:51:12 UTC (rev 18883) @@ -15,6 +15,12 @@ #define NDEBUG #include "../include/debug.h" +/* FIXME - defined in ntifs.h */ +#if !defined(FILE_PIPE_BYTE_STREAM_TYPE) && !defined(FILE_PIPE_MESSAGE_TYPE) +#define FILE_PIPE_BYTE_STREAM_TYPE 0x00000000 +#define FILE_PIPE_MESSAGE_TYPE 0x00000001 +#endif + /* FUNCTIONS ****************************************************************/ /* @@ -72,7 +78,6 @@ HANDLE PipeHandle; ACCESS_MASK DesiredAccess; ULONG CreateOptions; - ULONG CreateDisposition; ULONG WriteModeMessage; ULONG ReadModeMessage; ULONG NonBlocking; @@ -80,6 +85,12 @@ ULONG ShareAccess, Attributes; LARGE_INTEGER DefaultTimeOut; PSECURITY_DESCRIPTOR SecurityDescriptor = NULL; + + if (nMaxInstances == 0 || nMaxInstances > PIPE_UNLIMITED_INSTANCES) + { + SetLastError(ERROR_INVALID_PARAMETER); + return INVALID_HANDLE_VALUE; + } Result = RtlDosPathNameToNtPathName_U((LPWSTR)lpName, &NamedPipeName, @@ -108,78 +119,48 @@ NULL, SecurityDescriptor); - DesiredAccess = 0; + DesiredAccess = SYNCHRONIZE | (dwOpenMode & (WRITE_DAC | WRITE_OWNER | ACCESS_SYSTEM_SECURITY)); ShareAccess = 0; - CreateDisposition = FILE_OPEN_IF; CreateOptions = 0; + if (dwOpenMode & FILE_FLAG_WRITE_THROUGH) - { - CreateOptions = CreateOptions | FILE_WRITE_THROUGH; - } + CreateOptions |= FILE_WRITE_THROUGH; if (!(dwOpenMode & FILE_FLAG_OVERLAPPED)) - { - CreateOptions = CreateOptions | FILE_SYNCHRONOUS_IO_NONALERT; - } - if (dwOpenMode & PIPE_ACCESS_DUPLEX) - { - CreateOptions = CreateOptions | FILE_PIPE_FULL_DUPLEX; - DesiredAccess |= (FILE_GENERIC_READ | FILE_GENERIC_WRITE); - } - else if (dwOpenMode & PIPE_ACCESS_INBOUND) - { - CreateOptions = CreateOptions | FILE_PIPE_INBOUND; - DesiredAccess |= FILE_GENERIC_READ; - } - else if (dwOpenMode & PIPE_ACCESS_OUTBOUND) - { - CreateOptions = CreateOptions | FILE_PIPE_OUTBOUND; - DesiredAccess |= FILE_GENERIC_WRITE; - } + CreateOptions |= FILE_SYNCHRONOUS_IO_NONALERT; - if (dwPipeMode & PIPE_TYPE_BYTE) + switch (dwOpenMode & PIPE_ACCESS_DUPLEX) { - WriteModeMessage = FILE_PIPE_BYTE_STREAM_MODE; + case PIPE_ACCESS_INBOUND: + ShareAccess |= FILE_SHARE_WRITE; + DesiredAccess |= GENERIC_READ; + break; + + case PIPE_ACCESS_OUTBOUND: + ShareAccess |= FILE_SHARE_READ; + DesiredAccess |= GENERIC_WRITE; + break; + + case PIPE_ACCESS_DUPLEX: + ShareAccess |= FILE_SHARE_READ | FILE_SHARE_WRITE; + DesiredAccess |= GENERIC_READ | GENERIC_WRITE; + break; } - else if (dwPipeMode & PIPE_TYPE_MESSAGE) - { - WriteModeMessage = FILE_PIPE_MESSAGE_MODE; - } + + if (dwPipeMode & PIPE_TYPE_MESSAGE) + WriteModeMessage = FILE_PIPE_MESSAGE_TYPE; else - { - WriteModeMessage = FILE_PIPE_BYTE_STREAM_MODE; - } + WriteModeMessage = FILE_PIPE_BYTE_STREAM_TYPE; - if (dwPipeMode & PIPE_READMODE_BYTE) - { - ReadModeMessage = FILE_PIPE_BYTE_STREAM_MODE; - } - else if (dwPipeMode & PIPE_READMODE_MESSAGE) - { - ReadModeMessage = FILE_PIPE_MESSAGE_MODE; - } + if (dwPipeMode & PIPE_READMODE_MESSAGE) + ReadModeMessage = FILE_PIPE_MESSAGE_MODE; else - { - ReadModeMessage = FILE_PIPE_BYTE_STREAM_MODE; - } + ReadModeMessage = FILE_PIPE_BYTE_STREAM_MODE; - if (dwPipeMode & PIPE_WAIT) - { - NonBlocking = FILE_PIPE_QUEUE_OPERATION; - } - else if (dwPipeMode & PIPE_NOWAIT) - { - NonBlocking = FILE_PIPE_COMPLETE_OPERATION; - } + if (dwPipeMode & PIPE_NOWAIT) + NonBlocking = FILE_PIPE_COMPLETE_OPERATION; else - { - NonBlocking = FILE_PIPE_QUEUE_OPERATION; - } + NonBlocking = FILE_PIPE_QUEUE_OPERATION; - if (nMaxInstances >= PIPE_UNLIMITED_INSTANCES) - { - nMaxInstances = 0xFFFFFFFF; - } - DefaultTimeOut.QuadPart = nDefaultTimeOut * -10000LL; Status = NtCreateNamedPipeFile(&PipeHandle, @@ -187,7 +168,7 @@ &ObjectAttributes, &Iosb, ShareAccess, - CreateDisposition, + FILE_OPEN_IF, CreateOptions, WriteModeMessage, ReadModeMessage, _____ Modified: trunk/reactos/lib/kernel32/file/pipe.c --- trunk/reactos/lib/kernel32/file/pipe.c 2005-10-30 13:55:28 UTC (rev 18882) +++ trunk/reactos/lib/kernel32/file/pipe.c 2005-10-30 14:51:12 UTC (rev 18883) @@ -59,6 +59,9 @@ Attributes |= OBJ_INHERIT; } + /* use default buffer size if desired */ + if (nSize == 0) nSize = 0x1000; + InitializeObjectAttributes(&ObjectAttributes, &PipeName, Attributes, @@ -66,7 +69,7 @@ SecurityDescriptor); Status = NtCreateNamedPipeFile(&ReadPipeHandle, - FILE_GENERIC_READ, + FILE_GENERIC_READ | FILE_WRITE_ATTRIBUTES | SYNCHRONIZE, &ObjectAttributes, &StatusBlock, FILE_SHARE_READ | FILE_SHARE_WRITE, @@ -86,10 +89,10 @@ } Status = NtOpenFile(&WritePipeHandle, - FILE_GENERIC_WRITE, + FILE_GENERIC_WRITE | SYNCHRONIZE, &ObjectAttributes, &StatusBlock, - 0, + FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE); if (!NT_SUCCESS(Status)) {
19 years, 1 month
1
0
0
0
[hbirr] 18882: Fixed the check for the MEM_TOP_DOWN flag in MmMapViewOfSection.
by hbirr@svn.reactos.com
Fixed the check for the MEM_TOP_DOWN flag in MmMapViewOfSection. Modified: trunk/reactos/ntoskrnl/mm/section.c _____ Modified: trunk/reactos/ntoskrnl/mm/section.c --- trunk/reactos/ntoskrnl/mm/section.c 2005-10-30 13:54:02 UTC (rev 18881) +++ trunk/reactos/ntoskrnl/mm/section.c 2005-10-30 13:55:28 UTC (rev 18882) @@ -4520,7 +4520,7 @@ *ViewSize, Protect, ViewOffset, - (AllocationType & MEM_TOP_DOWN)); + (AllocationType & MEM_TOP_DOWN) == MEM_TOP_DOWN); MmUnlockSectionSegment(Section->Segment); if (!NT_SUCCESS(Status)) {
19 years, 1 month
1
0
0
0
[hbirr] 18881: Map the NLS tables after creating the PEB.
by hbirr@svn.reactos.com
Map the NLS tables after creating the PEB. The top-down mapping of the NLS tables may occupied the region for the PEB. Modified: trunk/reactos/ntoskrnl/mm/process.c _____ Modified: trunk/reactos/ntoskrnl/mm/process.c --- trunk/reactos/ntoskrnl/mm/process.c 2005-10-30 13:13:53 UTC (rev 18880) +++ trunk/reactos/ntoskrnl/mm/process.c 2005-10-30 13:54:02 UTC (rev 18881) @@ -203,6 +203,14 @@ DPRINT("MmCreatePeb\n"); + /* Allocate the PEB */ + Peb = MiCreatePebOrTeb(Process, (PVOID)PEB_BASE); + if (Peb != (PVOID)PEB_BASE) + { + DPRINT1("MiCreatePebOrTeb() returned %x\n", Peb); + return STATUS_UNSUCCESSFUL; + } + /* Map NLS Tables */ DPRINT("Mapping NLS\n"); Status = MmMapViewOfSection(NlsSectionObject, @@ -225,9 +233,6 @@ /* Attach to Process */ KeAttachProcess(&Process->Pcb); - /* Allocate the PEB */ - Peb = MiCreatePebOrTeb(Process, (PVOID)PEB_BASE); - /* Initialize the PEB */ DPRINT("Allocated: %x\n", Peb); RtlZeroMemory(Peb, sizeof(PEB));
19 years, 1 month
1
0
0
0
[ekohl] 18880: - Implement GetServiceDisplayNameW (untested).
by ekohl@svn.reactos.com
- Implement GetServiceDisplayNameW (untested). - SCM must store a services display name. - Some SCM-Calls must fail while the SCM is shutting down. Modified: trunk/reactos/include/idl/svcctl.idl Modified: trunk/reactos/lib/advapi32/service/scm.c Modified: trunk/reactos/subsys/system/services/database.c Modified: trunk/reactos/subsys/system/services/rpcserver.c Modified: trunk/reactos/subsys/system/services/services.c Modified: trunk/reactos/subsys/system/services/services.h _____ Modified: trunk/reactos/include/idl/svcctl.idl --- trunk/reactos/include/idl/svcctl.idl 2005-10-30 12:53:32 UTC (rev 18879) +++ trunk/reactos/include/idl/svcctl.idl 2005-10-30 13:13:53 UTC (rev 18880) @@ -9,7 +9,9 @@ #define BOOL unsigned long #define SC_HANDLE unsigned int #define SC_LOCK unsigned int +#define LPSTR char* #define LPCSTR char* +#define LPWSTR wchar_t* #define LPCWSTR wchar_t* #define LPDWORD unsigned long* @@ -127,6 +129,14 @@ [out] SC_HANDLE *hScm); + /* Function 20 */ + DWORD ScmrGetServiceDisplayNameW([in] handle_t BindingHandle, + [in] SC_HANDLE hSCManager, + [in, string, ref] LPCWSTR lpServiceName, + [out, size_is(*lpcchBuffer), unique] LPWSTR lpDisplayName, + [in, out, ref] LPDWORD lpcchBuffer); + + /* Function 27 */ DWORD ScmrOpenSCManagerA([in] handle_t BindingHandle, [in, string, unique] LPCSTR lpMachineName, _____ Modified: trunk/reactos/lib/advapi32/service/scm.c --- trunk/reactos/lib/advapi32/service/scm.c 2005-10-30 12:53:32 UTC (rev 18879) +++ trunk/reactos/lib/advapi32/service/scm.c 2005-10-30 13:13:53 UTC (rev 18880) @@ -566,19 +566,33 @@ /********************************************************************** * GetServiceDisplayNameW * - * @unimplemented + * @implemented */ -BOOL -STDCALL -GetServiceDisplayNameW( - SC_HANDLE hSCManager, - LPCWSTR lpServiceName, - LPWSTR lpDisplayName, - LPDWORD lpcchBuffer) +BOOL STDCALL +GetServiceDisplayNameW(SC_HANDLE hSCManager, + LPCWSTR lpServiceName, + LPWSTR lpDisplayName, + LPDWORD lpcchBuffer) { - DPRINT1("GetServiceDisplayNameW is unimplemented\n"); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + DWORD dwError; + + DPRINT("GetServiceDisplayNameW() called\n"); + + HandleBind(); + + dwError = ScmrGetServiceDisplayNameW(BindingHandle, + (unsigned int)hSCManager, + (LPWSTR)lpServiceName, + lpDisplayName, + lpcchBuffer); + if (dwError != ERROR_SUCCESS) + { + DPRINT1("ScmrGetServiceDisplayNameW() failed (Error %lu)\n", dwError); + SetLastError(dwError); + return FALSE; + } + + return TRUE; } @@ -606,14 +620,33 @@ * * @unimplemented */ -BOOL -STDCALL -GetServiceKeyNameW( - SC_HANDLE hSCManager, - LPCWSTR lpDisplayName, - LPWSTR lpServiceName, - LPDWORD lpcchBuffer) +BOOL STDCALL +GetServiceKeyNameW(SC_HANDLE hSCManager, + LPCWSTR lpDisplayName, + LPWSTR lpServiceName, + LPDWORD lpcchBuffer) { +#if 0 + DWORD dwError; + + DPRINT("GetServiceKeyNameW() called\n"); + + HandleBind(); + + dwError = ScmrGetServiceKeyNameW(BindingHandle, + (unsigned int)hSCManager, + (LPWSTR)lpDisplayName, + lpServiceName, + lpcchBuffer); + if (dwError != ERROR_SUCCESS) + { + DPRINT1("ScmrGetServiceKeyNameW() failed (Error %lu)\n", dwError); + SetLastError(dwError); + return FALSE; + } + + return TRUE; +#endif DPRINT1("GetServiceKeyNameW is unimplemented\n"); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; _____ Modified: trunk/reactos/subsys/system/services/database.c --- trunk/reactos/subsys/system/services/database.c 2005-10-30 12:53:32 UTC (rev 18879) +++ trunk/reactos/subsys/system/services/database.c 2005-10-30 13:13:53 UTC (rev 18880) @@ -84,6 +84,35 @@ } +PSERVICE +ScmGetServiceEntryByDisplayName(LPWSTR lpDisplayName) +{ + PLIST_ENTRY ServiceEntry; + PSERVICE CurrentService; + + DPRINT("ScmGetServiceEntryByDisplayName() called\n"); + + ServiceEntry = ServiceListHead.Flink; + while (ServiceEntry != &ServiceListHead) + { + CurrentService = CONTAINING_RECORD(ServiceEntry, + SERVICE, + ServiceListEntry); + if (_wcsicmp(CurrentService->lpDisplayName, lpDisplayName) == 0) + { + DPRINT("Found service: '%S'\n", CurrentService->lpDisplayName); + return CurrentService; + } + + ServiceEntry = ServiceEntry->Flink; + } + + DPRINT("Couldn't find a matching service\n"); + + return NULL; +} + + static NTSTATUS STDCALL CreateGroupOrderListRoutine(PWSTR ValueName, ULONG ValueType, @@ -204,6 +233,7 @@ /* Copy service name */ wcscpy(Service->szServiceName, lpServiceName); Service->lpServiceName = Service->szServiceName; + Service->lpDisplayName = Service->lpServiceName; /* Get service data */ RtlZeroMemory(&QueryTable, @@ -284,6 +314,7 @@ /* Copy service name */ wcscpy(lpService->szServiceName, lpServiceName); lpService->lpServiceName = lpService->szServiceName; + lpService->lpDisplayName = lpService->lpServiceName; /* Append service entry */ InsertTailList(&ServiceListHead, _____ Modified: trunk/reactos/subsys/system/services/rpcserver.c --- trunk/reactos/subsys/system/services/rpcserver.c 2005-10-30 12:53:32 UTC (rev 18879) +++ trunk/reactos/subsys/system/services/rpcserver.c 2005-10-30 13:13:53 UTC (rev 18880) @@ -283,6 +283,9 @@ DPRINT1("ScmrControlService() called\n"); + if (ScmShutdown) + return ERROR_SHUTDOWN_IN_PROGRESS; + hSvc = (PSERVICE_HANDLE)hService; if (hSvc->Handle.Tag != SERVICE_TAG) { @@ -325,6 +328,9 @@ DPRINT1("ScmrDeleteService() called\n"); + if (ScmShutdown) + return ERROR_SHUTDOWN_IN_PROGRESS; + hSvc = (PSERVICE_HANDLE)hService; if (hSvc->Handle.Tag != SERVICE_TAG) return ERROR_INVALID_HANDLE; @@ -409,6 +415,9 @@ DPRINT("ScmrQueryServiceStatus() called\n"); + if (ScmShutdown) + return ERROR_SHUTDOWN_IN_PROGRESS; + hSvc = (PSERVICE_HANDLE)hService; if (hSvc->Handle.Tag != SERVICE_TAG) { @@ -488,6 +497,10 @@ unsigned long dwPasswordLength, wchar_t *lpDisplayName) { + DWORD dwError = ERROR_SUCCESS; + PSERVICE_HANDLE hSvc; + PSERVICE lpService = NULL; + DPRINT1("ScmrChangeServiceConfigW() called\n"); DPRINT1("dwServiceType = %lu\n", dwServiceType); DPRINT1("dwStartType = %lu\n", dwStartType); @@ -496,7 +509,35 @@ DPRINT1("lpLoadOrderGroup = %S\n", lpLoadOrderGroup); DPRINT1("lpDisplayName = %S\n", lpDisplayName); - return ERROR_SUCCESS; + if (ScmShutdown) + return ERROR_SHUTDOWN_IN_PROGRESS; + + hSvc = (PSERVICE_HANDLE)hService; + if (hSvc->Handle.Tag != SERVICE_TAG) + { + DPRINT1("Invalid handle tag!\n"); + return ERROR_INVALID_HANDLE; + } + + if (!RtlAreAllAccessesGranted(hSvc->Handle.DesiredAccess, + SERVICE_CHANGE_CONFIG)) + { + DPRINT1("Insufficient access rights! 0x%lx\n", hSvc->Handle.DesiredAccess); + return ERROR_ACCESS_DENIED; + } + + lpService = hSvc->ServiceEntry; + if (lpService == NULL) + { + DPRINT1("lpService == NULL!\n"); + return ERROR_INVALID_HANDLE; + } + + /* FIXME: ... */ + + DPRINT1("ScmrChangeServiceConfigW() done (Error %lu)\n", dwError); + + return dwError; } @@ -580,6 +621,9 @@ DPRINT1("lpBinaryPathName = %S\n", lpBinaryPathName); DPRINT1("lpLoadOrderGroup = %S\n", lpLoadOrderGroup); + if (ScmShutdown) + return ERROR_SHUTDOWN_IN_PROGRESS; + hManager = (PMANAGER_HANDLE)hSCManager; if (hManager->Handle.Tag != MANAGER_TAG) { @@ -625,6 +669,23 @@ lpService->dwStartType = dwStartType; lpService->dwErrorControl = dwErrorControl; + /* Fill the display name */ + if (lpDisplayName != NULL && + *lpDisplayName != 0 && + wcsicmp(lpService->lpDisplayName, lpDisplayName) != 0) + { + lpService->lpDisplayName = HeapAlloc(GetProcessHeap, 0, + (wcslen(lpDisplayName) + 1) * sizeof(WCHAR)); + if (lpService->lpDisplayName == NULL) + { + dwError = ERROR_NOT_ENOUGH_MEMORY; + goto done; + } + wcscpy(lpService->lpDisplayName, lpDisplayName); + } + + + /* FIXME: set lpLoadOrderGroup, lpDependencies etc. */ @@ -756,6 +817,10 @@ } else { + /* Release the display name buffer */ + if (lpService->lpServiceName != lpService->lpDisplayName) + HeapFree(GetProcessHeap(), 0, lpService->lpDisplayName); + if (hServiceHandle != NULL) { /* Remove the service handle */ @@ -795,6 +860,9 @@ DPRINT("lpDataBaseName: %S\n", lpDatabaseName); DPRINT("dwDesiredAccess = %x\n", dwDesiredAccess); + if (ScmShutdown) + return ERROR_SHUTDOWN_IN_PROGRESS; + dwError = ScmCreateManagerHandle(lpDatabaseName, &hHandle); if (dwError != ERROR_SUCCESS) @@ -841,6 +909,9 @@ DPRINT("lpServiceName: %S\n", lpServiceName); DPRINT("dwDesiredAccess = %x\n", dwDesiredAccess); + if (ScmShutdown) + return ERROR_SHUTDOWN_IN_PROGRESS; + hManager = (PMANAGER_HANDLE)hSCManager; if (hManager->Handle.Tag != MANAGER_TAG) { @@ -886,7 +957,56 @@ } +/* Function 20 */ +unsigned long +ScmrGetServiceDisplayNameW(handle_t BindingHandle, + unsigned int hSCManager, + wchar_t *lpServiceName, + wchar_t *lpDisplayName, /* [out, unique] */ + unsigned long *lpcchBuffer) +{ +// PMANAGER_HANDLE hManager; + PSERVICE lpService; + DWORD dwLength; + DWORD dwError; + DPRINT1("ScmrGetServiceDisplayNameW() called\n"); + DPRINT1("hSCManager = %x\n", hSCManager); + DPRINT1("lpServiceName: %S\n", lpServiceName); + DPRINT1("lpDisplayName: %p\n", lpDisplayName); + DPRINT1("*lpcchBuffer: %lu\n", *lpcchBuffer); + +// hManager = (PMANAGER_HANDLE)hSCManager; +// if (hManager->Handle.Tag != MANAGER_TAG) +// { +// DPRINT1("Invalid manager handle!\n"); +// return ERROR_INVALID_HANDLE; +// } + + /* Get service database entry */ + lpService = ScmGetServiceEntryByName(lpServiceName); + if (lpService == NULL) + { + DPRINT1("Could not find a service!\n"); + return ERROR_SERVICE_DOES_NOT_EXIST; + } + + dwLength = wcslen(lpService->lpDisplayName); + + if (lpDisplayName != NULL && + *lpcchBuffer > dwLength) + { + wcscpy(lpDisplayName, lpService->lpDisplayName); + } + + dwError = (*lpcchBuffer > dwLength) ? ERROR_SUCCESS : ERROR_INSUFFICIENT_BUFFER; + + *lpcchBuffer = dwLength; + + return dwError; +} + + /* Function 27 */ unsigned long ScmrOpenSCManagerA(handle_t BindingHandle, _____ Modified: trunk/reactos/subsys/system/services/services.c --- trunk/reactos/subsys/system/services/services.c 2005-10-30 12:53:32 UTC (rev 18879) +++ trunk/reactos/subsys/system/services/services.c 2005-10-30 13:13:53 UTC (rev 18880) @@ -40,7 +40,9 @@ #define PIPE_BUFSIZE 1024 #define PIPE_TIMEOUT 1000 +BOOL ScmShutdown = FALSE; + /* FUNCTIONS *****************************************************************/ VOID @@ -286,6 +288,23 @@ } +BOOL WINAPI +ShutdownHandlerRoutine(DWORD dwCtrlType) +{ + DPRINT1("ShutdownHandlerRoutine() called\n"); + + if (dwCtrlType == CTRL_SHUTDOWN_EVENT) + { + DPRINT1("Shutdown event received!\n"); + ScmShutdown = TRUE; + + /* FIXME: Shut all services down */ + } + + return TRUE; +} + + int STDCALL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, @@ -330,17 +349,15 @@ ScmStartRpcServer(); /* Register service process with CSRSS */ -// RegisterServicesProcess(GetCurrentProcessId()); + RegisterServicesProcess(GetCurrentProcessId()); DPRINT("SERVICES: Initialized.\n"); /* Signal start event */ SetEvent(hScmStartEvent); -#if 0 - /* FIXME: register event handler (used for system shutdown) */ - SetConsoleCtrlHandler(...); -#endif + /* Register event handler (used for system shutdown) */ + SetConsoleCtrlHandler(ShutdownHandlerRoutine, TRUE); /* Start auto-start services */ ScmAutoStartServices(); _____ Modified: trunk/reactos/subsys/system/services/services.h --- trunk/reactos/subsys/system/services/services.h 2005-10-30 12:53:32 UTC (rev 18879) +++ trunk/reactos/subsys/system/services/services.h 2005-10-30 13:13:53 UTC (rev 18880) @@ -13,6 +13,7 @@ { LIST_ENTRY ServiceListEntry; LPWSTR lpServiceName; + LPWSTR lpDisplayName; UNICODE_STRING ServiceGroup; SERVICE_STATUS Status; @@ -32,6 +33,13 @@ } SERVICE, *PSERVICE; +/* VARIABLES ***************************************************************/ + +extern BOOL ScmShutdown; + + +/* FUNCTIONS ***************************************************************/ + /* config.c */ DWORD ScmWriteDependencies(HKEY hServiceKey, @@ -46,6 +54,7 @@ VOID ScmAutoStartServices(VOID); PSERVICE ScmGetServiceEntryByName(LPWSTR lpServiceName); +PSERVICE ScmGetServiceEntryByDisplayName(LPWSTR lpDisplayName); DWORD ScmCreateNewServiceRecord(LPWSTR lpServiceName, PSERVICE *lpServiceRecord); DWORD ScmMarkServiceForDelete(PSERVICE pService);
19 years, 1 month
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
74
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Results per page:
10
25
50
100
200