ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
December 2005
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
40 participants
704 discussions
Start a n
N
ew thread
[blight] 20497: New ibrowser icon by mf :P 4 mins late but still ; )
by blight@svn.reactos.org
New ibrowser icon by mf :P 4 mins late but still ;) Modified: trunk/reactos/subsys/system/ibrowser/res/ibrowser.ico _____ Modified: trunk/reactos/subsys/system/ibrowser/res/ibrowser.ico (Binary files differ)
18 years, 11 months
1
0
0
0
[ekohl] 20496: - Service list entries use a pointer to a group list entry instead of the goup name.
by ekohl@svn.reactos.org
- Service list entries use a pointer to a group list entry instead of the goup name. - New group list entries are created in the unknown-group-list for services of unknown groups. Modified: trunk/reactos/subsys/system/services/database.c Modified: trunk/reactos/subsys/system/services/groupdb.c Modified: trunk/reactos/subsys/system/services/rpcserver.c Modified: trunk/reactos/subsys/system/services/services.h _____ Modified: trunk/reactos/subsys/system/services/database.c --- trunk/reactos/subsys/system/services/database.c 2005-12-31 21:37:52 UTC (rev 20495) +++ trunk/reactos/subsys/system/services/database.c 2005-12-31 22:42:41 UTC (rev 20496) @@ -267,8 +267,9 @@ if (lpGroup != NULL) { - lpService->lpServiceGroup = lpGroup; - lpGroup = NULL; + dwError = ScmSetServiceGroup(lpService, lpGroup); + if (dwError != ERROR_SUCCESS) + goto done; } if (lpDisplayName != NULL) @@ -278,7 +279,7 @@ } DPRINT("ServiceName: '%S'\n", lpService->lpServiceName); - DPRINT("Group: '%S'\n", lpService->lpServiceGroup); + DPRINT("Group: '%S'\n", lpService->lpGroup->lpGroupName); DPRINT("Start %lx Type %lx Tag %lx ErrorControl %lx\n", lpService->dwStartType, lpService->Status.dwServiceType, @@ -415,8 +416,6 @@ ULONG BufferLength; ULONG DataLength; ULONG Index; - PLIST_ENTRY GroupEntry; - PSERVICE_GROUP CurrentGroup; DPRINT("ScmCheckDriver(%S) called\n", Service->lpServiceName); @@ -481,24 +480,12 @@ /* Mark service as 'running' */ Service->Status.dwCurrentState = SERVICE_RUNNING; - /* Find the driver's group and mark it as 'running' */ - if (Service->lpServiceGroup != NULL) + /* Mark the service group as 'running' */ + if (Service->lpGroup != NULL) { - GroupEntry = GroupListHead.Flink; - while (GroupEntry != &GroupListHead) - { - CurrentGroup = CONTAINING_RECORD(GroupEntry, SERVICE_GROUP, GroupListEntry); - - DPRINT("Checking group '%S'\n", &CurrentGroup->lpGroupName); - if (Service->lpServiceGroup != NULL && - _wcsicmp(Service->lpServiceGroup, CurrentGroup->lpGroupName) == 0) - { - CurrentGroup->ServicesRunning = TRUE; - } - - GroupEntry = GroupEntry->Flink; - } + Service->lpGroup->ServicesRunning = TRUE; } + break; } } @@ -856,8 +843,7 @@ { CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry); - if ((CurrentService->lpServiceGroup != NULL) && - (_wcsicmp(CurrentGroup->lpGroupName, CurrentService->lpServiceGroup) == 0) && + if ((CurrentService->lpGroup == CurrentGroup) && (CurrentService->dwStartType == SERVICE_AUTO_START) && (CurrentService->ServiceVisited == FALSE) && (CurrentService->dwTag == CurrentGroup->TagArray[i])) @@ -877,8 +863,7 @@ { CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry); - if ((CurrentService->lpServiceGroup != NULL) && - (_wcsicmp(CurrentGroup->lpGroupName, CurrentService->lpServiceGroup) == 0) && + if ((CurrentService->lpGroup == CurrentGroup) && (CurrentService->dwStartType == SERVICE_AUTO_START) && (CurrentService->ServiceVisited == FALSE)) { @@ -899,7 +884,7 @@ { CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry); - if ((CurrentService->lpServiceGroup != NULL) && + if ((CurrentService->lpGroup != NULL) && (CurrentService->dwStartType == SERVICE_AUTO_START) && (CurrentService->ServiceVisited == FALSE)) { @@ -917,7 +902,7 @@ { CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry); - if ((CurrentService->lpServiceGroup == NULL) && + if ((CurrentService->lpGroup == NULL) && (CurrentService->dwStartType == SERVICE_AUTO_START) && (CurrentService->ServiceVisited == FALSE)) { _____ Modified: trunk/reactos/subsys/system/services/groupdb.c --- trunk/reactos/subsys/system/services/groupdb.c 2005-12-31 21:37:52 UTC (rev 20495) +++ trunk/reactos/subsys/system/services/groupdb.c 2005-12-31 22:42:41 UTC (rev 20496) @@ -13,10 +13,64 @@ /* GLOBALS *******************************************************************/ LIST_ENTRY GroupListHead; +LIST_ENTRY UnknownGroupListHead; /* FUNCTIONS *****************************************************************/ +DWORD +ScmSetServiceGroup(PSERVICE lpService, + LPWSTR lpGroupName) +{ + PLIST_ENTRY GroupEntry; + PSERVICE_GROUP lpGroup; + + GroupEntry = GroupListHead.Flink; + while (GroupEntry != &GroupListHead) + { + lpGroup = CONTAINING_RECORD(GroupEntry, SERVICE_GROUP, GroupListEntry); + + if (!_wcsicmp(lpGroup->lpGroupName, lpGroupName)) + { + lpService->lpGroup = lpGroup; + return ERROR_SUCCESS; + } + + GroupEntry = GroupEntry->Flink; + } + + GroupEntry = UnknownGroupListHead.Flink; + while (GroupEntry != &UnknownGroupListHead) + { + lpGroup = CONTAINING_RECORD(GroupEntry, SERVICE_GROUP, GroupListEntry); + + if (!_wcsicmp(lpGroup->lpGroupName, lpGroupName)) + { + lpGroup->dwRefCount++; + lpService->lpGroup = lpGroup; + return ERROR_SUCCESS; + } + + GroupEntry = GroupEntry->Flink; + } + + lpGroup = (PSERVICE_GROUP)HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(SERVICE_GROUP) + (wcslen(lpGroupName) * sizeof(WCHAR))); + if (lpGroup == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + wcscpy(lpGroup->szGroupName, lpGroupName); + lpGroup->lpGroupName = lpGroup->szGroupName; + lpGroup->dwRefCount = 1; + + InsertTailList(&UnknownGroupListHead, + &lpGroup->GroupListEntry); + + return ERROR_SUCCESS; +} + + static NTSTATUS STDCALL CreateGroupOrderListRoutine(PWSTR ValueName, ULONG ValueType, @@ -120,6 +174,7 @@ NTSTATUS Status; InitializeListHead(&GroupListHead); + InitializeListHead(&UnknownGroupListHead); /* Build group order list */ RtlZeroMemory(&QueryTable, _____ Modified: trunk/reactos/subsys/system/services/rpcserver.c --- trunk/reactos/subsys/system/services/rpcserver.c 2005-12-31 21:37:52 UTC (rev 20495) +++ trunk/reactos/subsys/system/services/rpcserver.c 2005-12-31 22:42:41 UTC (rev 20496) @@ -927,7 +927,7 @@ if (lpdwTagId != NULL) { - dwError = ScmAssignNewTag(lpService->lpServiceGroup, + dwError = ScmAssignNewTag(lpService->lpGroup->lpGroupName, &lpService->dwTag); if (dwError != ERROR_SUCCESS) goto done; @@ -1161,7 +1161,7 @@ if (lpdwTagId != NULL) { - dwError = ScmAssignNewTag(lpService->lpServiceGroup, + dwError = ScmAssignNewTag(lpService->lpGroup->lpGroupName, &lpService->dwTag); if (dwError != ERROR_SUCCESS) goto done; @@ -1635,8 +1635,8 @@ if (lpImagePath != NULL) dwRequiredSize += ((wcslen(lpImagePath) + 1) * sizeof(WCHAR)); - if (lpService->lpServiceGroup != NULL) - dwRequiredSize += ((wcslen(lpService->lpServiceGroup) + 1) * sizeof(WCHAR)); + if (lpService->lpGroup != NULL) + dwRequiredSize += ((wcslen(lpService->lpGroup->lpGroupName) + 1) * sizeof(WCHAR)); /* FIXME: Add Dependencies length*/ @@ -1670,11 +1670,11 @@ lpConfig->lpBinaryPathName = NULL; } - if (lpService->lpServiceGroup != NULL) + if (lpService->lpGroup != NULL) { - wcscpy(lpStr, lpService->lpServiceGroup); + wcscpy(lpStr, lpService->lpGroup->lpGroupName); lpConfig->lpLoadOrderGroup = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); - lpStr += (wcslen(lpService->lpServiceGroup) + 1); + lpStr += (wcslen(lpService->lpGroup->lpGroupName) + 1); } else { @@ -2290,7 +2290,8 @@ if (pszGroupName) { - if (_wcsicmp(pszGroupName, CurrentService->lpServiceGroup)) + if ((CurrentService->lpGroup == NULL) || + _wcsicmp(pszGroupName, CurrentService->lpGroup->lpGroupName)) continue; } @@ -2336,7 +2337,8 @@ if (pszGroupName) { - if (_wcsicmp(pszGroupName, CurrentService->lpServiceGroup)) + if ((CurrentService->lpGroup == NULL) || + _wcsicmp(pszGroupName, CurrentService->lpGroup->lpGroupName)) continue; } @@ -2378,7 +2380,8 @@ if (pszGroupName) { - if (_wcsicmp(pszGroupName, CurrentService->lpServiceGroup)) + if ((CurrentService->lpGroup == NULL) || + _wcsicmp(pszGroupName, CurrentService->lpGroup->lpGroupName)) continue; } _____ Modified: trunk/reactos/subsys/system/services/services.h --- trunk/reactos/subsys/system/services/services.h 2005-12-31 21:37:52 UTC (rev 20495) +++ trunk/reactos/subsys/system/services/services.h 2005-12-31 22:42:41 UTC (rev 20496) @@ -29,7 +29,7 @@ LIST_ENTRY ServiceListEntry; LPWSTR lpServiceName; LPWSTR lpDisplayName; - LPWSTR lpServiceGroup; + PSERVICE_GROUP lpGroup; BOOL bDeleted; DWORD dwResumeCount; @@ -109,6 +109,8 @@ /* groupdb.c */ DWORD ScmCreateGroupList(VOID); +DWORD ScmSetServiceGroup(PSERVICE lpService, + LPWSTR lpGroupName); /* rpcserver.c */
18 years, 11 months
1
0
0
0
[jimtabor] 20495: Close bug 1223.
by jimtabor@svn.reactos.org
Close bug 1223. Modified: trunk/reactos/lib/kernel32/misc/lang.c _____ Modified: trunk/reactos/lib/kernel32/misc/lang.c --- trunk/reactos/lib/kernel32/misc/lang.c 2005-12-31 20:49:43 UTC (rev 20494) +++ trunk/reactos/lib/kernel32/misc/lang.c 2005-12-31 21:37:52 UTC (rev 20495) @@ -979,7 +979,7 @@ if (dwCmpFlags & ~NORM_IGNORECASE) { - DPRINT1("CompareString: STUB flags - 0x%x\n", dwCmpFlags); + DPRINT("CompareString: STUB flags - 0x%x\n", dwCmpFlags); Result = compare_unicode_string(&String1, &String2, dwCmpFlags); } else
18 years, 11 months
1
0
0
0
[mf] 20494: Registry entries for shell folders
by mf@svn.reactos.org
Registry entries for shell folders Modified: trunk/reactos/bootdata/hivecls.inf _____ Modified: trunk/reactos/bootdata/hivecls.inf --- trunk/reactos/bootdata/hivecls.inf 2005-12-31 19:50:29 UTC (rev 20493) +++ trunk/reactos/bootdata/hivecls.inf 2005-12-31 20:49:43 UTC (rev 20494) @@ -14,6 +14,13 @@ HKCR,"inffile\DefaultIcon","",0x00000000,"%SystemRoot%\System32\shell32. dll,-151" HKCR,"inffile\shell\Install\command","",0x00020000,"%SystemRoot%\System3 2\rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 %1" +; Folders +HKCR,"Folder\Defaulticon","",0x00000000,"%SystemRoot%\System32\shell32. dll,-4" +HKCR,"Folder\shell\open\command","",0x00000000,"explorer.exe ""%1""" +HKCR,"Folder\shell\explore\command","",0x00000000,"explorer.exe /e,""%1""" +HKCR,"Folder\shell\rootexplore","",0x00000000,"Explore from here" +HKCR,"Folder\shell\rootexplore\command","",0x00000000,"explorer.exe /e,/root,""%1""" + ; Show icons for shortcuts in shell views (lnkfile is handled specially in shell32) ; Don't display extension for shortcuts HKCR,".lnk","",0x00000000,"lnkfile"
18 years, 11 months
1
0
0
0
[gvg] 20493: On FAT16 partitions smaller than 128MB, the cluster size is 2048, which is
by gvg@svn.reactos.org
On FAT16 partitions smaller than 128MB, the cluster size is 2048, which is smaller than PAGE_SIZE. This caused creation of the paging file on such a partition to fail, which in turn made SMSS fail, blocking the boot process. Creation of paging file fixed, and failure to create it is no longer a blocker for the boot process (just try to run without paging file). Modified: trunk/reactos/ntoskrnl/mm/pagefile.c Modified: trunk/reactos/subsys/smss/initobdir.c Modified: trunk/reactos/subsys/smss/initpage.c Modified: trunk/reactos/subsys/smss/print.c Modified: trunk/reactos/subsys/smss/smss.c _____ Modified: trunk/reactos/ntoskrnl/mm/pagefile.c --- trunk/reactos/ntoskrnl/mm/pagefile.c 2005-12-31 19:02:48 UTC (rev 20492) +++ trunk/reactos/ntoskrnl/mm/pagefile.c 2005-12-31 19:50:29 UTC (rev 20493) @@ -809,13 +809,6 @@ PreviousMode = ExGetPreviousMode(); - Status = ProbeAndCaptureUnicodeString(&CapturedFileName, - PreviousMode, - FileName); - if (!NT_SUCCESS(Status)) - { - return(Status); - } if (PreviousMode != KernelMode) { _SEH_TRY @@ -831,8 +824,6 @@ if (!NT_SUCCESS(Status)) { - ReleaseCapturedUnicodeString(&CapturedFileName, - PreviousMode); return Status; } } @@ -842,6 +833,29 @@ SafeMaximumSize = *MaximumSize; } + /* Pagefiles can't be larger than 4GB and ofcourse the minimum should be + smaller than the maximum */ + if (0 != SafeInitialSize.u.HighPart) + { + return STATUS_INVALID_PARAMETER_2; + } + if (0 != SafeMaximumSize.u.HighPart) + { + return STATUS_INVALID_PARAMETER_3; + } + if (SafeMaximumSize.u.LowPart < SafeInitialSize.u.LowPart) + { + return STATUS_INVALID_PARAMETER_MIX; + } + + Status = ProbeAndCaptureUnicodeString(&CapturedFileName, + PreviousMode, + FileName); + if (!NT_SUCCESS(Status)) + { + return(Status); + } + InitializeObjectAttributes(&ObjectAttributes, &CapturedFileName, 0, @@ -881,12 +895,24 @@ return Status; } - BytesPerAllocationUnit = FsSizeInformation.SectorsPerAllocationUnit * FsSizeInformation.BytesPerSector; - if (BytesPerAllocationUnit % PAGE_SIZE) + BytesPerAllocationUnit = FsSizeInformation.SectorsPerAllocationUnit * + FsSizeInformation.BytesPerSector; + + /* We have to find a value which is a multiple of both PAGE_SIZE and + BytesPerAllocationUnit */ + SafeInitialSize.u.LowPart = ((SafeInitialSize.u.LowPart + PAGE_SIZE - 1) / + PAGE_SIZE) * PAGE_SIZE; + while (0 != (SafeInitialSize.u.LowPart % BytesPerAllocationUnit) && + SafeInitialSize.u.LowPart <= SafeMaximumSize.u.LowPart - PAGE_SIZE) { + SafeInitialSize.u.LowPart += PAGE_SIZE; + } + if (0 != (SafeInitialSize.u.LowPart % BytesPerAllocationUnit)) + { ZwClose(FileHandle); - return STATUS_UNSUCCESSFUL; + return STATUS_ALLOTTED_SPACE_EXCEEDED; } + ASSERT(0 == (SafeInitialSize.u.LowPart % PAGE_SIZE)); Status = ZwSetInformationFile(FileHandle, &IoStatus, _____ Modified: trunk/reactos/subsys/smss/initobdir.c --- trunk/reactos/subsys/smss/initobdir.c 2005-12-31 19:02:48 UTC (rev 20492) +++ trunk/reactos/subsys/smss/initobdir.c 2005-12-31 19:50:29 UTC (rev 20493) @@ -41,10 +41,8 @@ HANDLE WindowsDirectory; NTSTATUS Status = STATUS_SUCCESS; -#ifndef NDEBUG - DbgPrint("ValueName '%S' Type %lu Length %lu\n", ValueName, ValueType, ValueLength); - DbgPrint("ValueData '%S'\n", (PWSTR)ValueData); -#endif + DPRINT("ValueName '%S' Type %lu Length %lu\n", ValueName, ValueType, ValueLength); + DPRINT("ValueData '%S'\n", (PWSTR)ValueData); if (ValueType != REG_SZ) { return(STATUS_SUCCESS); _____ Modified: trunk/reactos/subsys/smss/initpage.c --- trunk/reactos/subsys/smss/initpage.c 2005-12-31 19:02:48 UTC (rev 20492) +++ trunk/reactos/subsys/smss/initpage.c 2005-12-31 19:50:29 UTC (rev 20493) @@ -1,5 +1,4 @@ -/* $Id$ - * +/* * initpage.c - * * ReactOS Operating System @@ -217,18 +216,23 @@ MaximumSize.QuadPart = InitialSize.QuadPart; } - DPRINT1("SMSS: Created paging file %wZ with size %I64d KB\n", + DPRINT("Creating paging file %wZ with size %I64d KB\n", &FileName, InitialSize.QuadPart / 1024); Status = NtCreatePagingFile(&FileName, &InitialSize, &MaximumSize, 0); + if (! NT_SUCCESS(Status)) + { + PrintString("Creation of paging file %wZ with size %I64d KB failed (status 0x%x\n", + &FileName, InitialSize.QuadPart / 1024); + } Cleanup: RtlFreeUnicodeString(&FileName); - return Status; + return STATUS_SUCCESS; } @@ -238,7 +242,7 @@ RTL_QUERY_REGISTRY_TABLE QueryTable[2]; NTSTATUS Status; - DbgPrint("SM: creating system paging files\n"); + DPRINT("creating system paging files\n"); /* * Disable paging file on MiniNT/Live CD. */ _____ Modified: trunk/reactos/subsys/smss/print.c --- trunk/reactos/subsys/smss/print.c 2005-12-31 19:02:48 UTC (rev 20492) +++ trunk/reactos/subsys/smss/print.c 2005-12-31 19:50:29 UTC (rev 20493) @@ -31,7 +31,7 @@ UNICODE_STRING us; RtlInitUnicodeString (&us, lpwString); - ZwDisplayString (&us); + NtDisplayString (&us); } VOID STDCALL PrintString (char* fmt, ...) @@ -44,6 +44,7 @@ va_start(ap, fmt); vsprintf(buffer, fmt, ap); va_end(ap); + DPRINT1("%s", buffer); RtlInitAnsiString (&AnsiString, buffer); RtlAnsiStringToUnicodeString (&UnicodeString, _____ Modified: trunk/reactos/subsys/smss/smss.c --- trunk/reactos/subsys/smss/smss.c 2005-12-31 19:02:48 UTC (rev 20492) +++ trunk/reactos/subsys/smss/smss.c 2005-12-31 19:50:29 UTC (rev 20493) @@ -41,9 +41,6 @@ NTSTATUS Status = STATUS_SUCCESS; PROCESS_BASIC_INFORMATION PBI = {0}; - PrintString("ReactOS Session Manager (Build %s)\n", - KERNEL_VERSION_BUILD_STR); - /* Lookup yourself */ Status = NtQueryInformationProcess (NtCurrentProcess(), ProcessBasicInformation,
18 years, 11 months
1
0
0
0
[ekohl] 20492: SVN maintenance
by ekohl@svn.reactos.org
SVN maintenance Modified: trunk/reactos/subsys/system/services/config.c Modified: trunk/reactos/subsys/system/services/driver.c Modified: trunk/reactos/subsys/system/services/groupdb.c _____ Modified: trunk/reactos/subsys/system/services/config.c --- trunk/reactos/subsys/system/services/config.c 2005-12-31 18:56:34 UTC (rev 20491) +++ trunk/reactos/subsys/system/services/config.c 2005-12-31 19:02:48 UTC (rev 20492) @@ -1,298 +1,298 @@ -/* - * config.c - */ - -/* INCLUDES *****************************************************************/ - -#include "services.h" - -#define NDEBUG -#include <debug.h> - -/* FUNCTIONS *****************************************************************/ - - -DWORD -ScmOpenServiceKey(LPWSTR lpServiceName, - REGSAM samDesired, - PHKEY phKey) -{ - HKEY hServicesKey = NULL; - DWORD dwError; - - *phKey = NULL; - - dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, - L"System\\CurrentControlSet\\Services", - 0, - KEY_READ, - &hServicesKey); - if (dwError != ERROR_SUCCESS) - return dwError; - - dwError = RegOpenKeyExW(hServicesKey, - lpServiceName, - 0, - samDesired, - phKey); - - RegCloseKey(hServicesKey); - - return dwError; -} - - -DWORD -ScmCreateServiceKey(LPWSTR lpServiceName, - REGSAM samDesired, - PHKEY phKey) -{ - HKEY hServicesKey = NULL; - DWORD dwDisposition; - DWORD dwError; - - *phKey = NULL; - - dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, - L"System\\CurrentControlSet\\Services", - 0, - KEY_READ | KEY_CREATE_SUB_KEY, - &hServicesKey); - if (dwError != ERROR_SUCCESS) - return dwError; - - dwError = RegCreateKeyExW(hServicesKey, - lpServiceName, - 0, - NULL, - REG_OPTION_NON_VOLATILE, - samDesired, - NULL, - phKey, - &dwDisposition); -#if 0 - if ((dwError == ERROR_SUCCESS) && - (dwDisposition == REG_OPENED_EXISTING_KEY)) - { - RegCloseKey(*phKey); - *phKey = NULL; - dwError = ERROR_SERVICE_EXISTS; - } -#endif - - RegCloseKey(hServicesKey); - - return dwError; -} - - - -DWORD -ScmWriteDependencies(HKEY hServiceKey, - LPWSTR lpDependencies, - DWORD dwDependenciesLength) -{ - DWORD dwError = ERROR_SUCCESS; - DWORD dwGroupLength = 0; - DWORD dwServiceLength = 0; - DWORD dwLength; - LPWSTR lpGroupDeps; - LPWSTR lpServiceDeps; - LPWSTR lpSrc; - LPWSTR lpDst; - - if (*lpDependencies == 0) - { - RegDeleteValue(hServiceKey, - L"DependOnService"); - RegDeleteValue(hServiceKey, - L"DependOnGroup"); - } - else - { - lpGroupDeps = HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, - (dwDependenciesLength + 2) * sizeof(WCHAR)); - if (lpGroupDeps == NULL) - return ERROR_NOT_ENOUGH_MEMORY; - - lpSrc = lpDependencies; - lpDst = lpGroupDeps; - while (*lpSrc != 0) - { - dwLength = wcslen(lpSrc); - if (*lpSrc == SC_GROUP_IDENTIFIERW) - { - lpSrc++; - dwGroupLength += dwLength; - wcscpy(lpDst, lpSrc); - lpDst = lpDst + dwLength; - } - - lpSrc = lpSrc + dwLength; - } - *lpDst = 0; - lpDst++; - dwGroupLength++; - - lpSrc = lpDependencies; - lpServiceDeps = lpDst; - while (*lpSrc != 0) - { - dwLength = wcslen(lpSrc) + 1; - if (*lpSrc != SC_GROUP_IDENTIFIERW) - { - dwServiceLength += dwLength; - wcscpy(lpDst, lpSrc); - lpDst = lpDst + dwLength; - } - - lpSrc = lpSrc + dwLength; - } - *lpDst = 0; - dwServiceLength++; - - dwError = RegSetValueExW(hServiceKey, - L"DependOnGroup", - 0, - REG_MULTI_SZ, - (LPBYTE)lpGroupDeps, - dwGroupLength * sizeof(WCHAR)); - - if (dwError == ERROR_SUCCESS) - { - dwError = RegSetValueExW(hServiceKey, - L"DependOnService", - 0, - REG_MULTI_SZ, - (LPBYTE)lpServiceDeps, - dwServiceLength * sizeof(WCHAR)); - } - - HeapFree(GetProcessHeap(), 0, lpGroupDeps); - } - - return dwError; -} - - -DWORD -ScmMarkServiceForDelete(PSERVICE pService) -{ - HKEY hServiceKey = NULL; - DWORD dwValue = 1; - DWORD dwError; - - DPRINT("ScmMarkServiceForDelete() called\n"); - - dwError = ScmOpenServiceKey(pService->lpServiceName, - KEY_WRITE, - &hServiceKey); - if (dwError != ERROR_SUCCESS) - return dwError; - - dwError = RegSetValueExW(hServiceKey, - L"DeleteFlag", - 0, - REG_DWORD, - (LPBYTE)&dwValue, - sizeof(DWORD)); - - RegCloseKey(hServiceKey); - - return dwError; -} - - -BOOL -ScmIsDeleteFlagSet(HKEY hServiceKey) -{ - DWORD dwError; - DWORD dwType; - DWORD dwFlag; - DWORD dwSize = sizeof(DWORD); - - dwError = RegQueryValueExW(hServiceKey, - L"DeleteFlag", - 0, - &dwType, - (LPBYTE)&dwFlag, - &dwSize); - - return (dwError == ERROR_SUCCESS); -} - - -DWORD -ScmReadString(HKEY hServiceKey, - LPWSTR lpValueName, - LPWSTR *lpValue) -{ - DWORD dwError; - DWORD dwSize; - DWORD dwType; - DWORD dwSizeNeeded; - LPWSTR expanded = NULL; - LPWSTR ptr = NULL; - - *lpValue = NULL; - - dwSize = 0; - dwError = RegQueryValueExW(hServiceKey, - lpValueName, - 0, - &dwType, - NULL, - &dwSize); - if (dwError != ERROR_SUCCESS) - return dwError; - - ptr = HeapAlloc(GetProcessHeap(), 0, dwSize); - if (ptr == NULL) - return ERROR_NOT_ENOUGH_MEMORY; - - dwError = RegQueryValueExW(hServiceKey, - lpValueName, - 0, - &dwType, - (LPBYTE)ptr, - &dwSize); - if (dwError != ERROR_SUCCESS) - goto done; - - if (dwType == REG_EXPAND_SZ) - { - /* Expand the value... */ - dwSizeNeeded = ExpandEnvironmentStringsW((LPCWSTR)ptr, NULL, 0); - if (dwSizeNeeded == 0) - { - dwError = GetLastError(); - goto done; - } - expanded = HeapAlloc(GetProcessHeap(), 0, dwSizeNeeded * sizeof(WCHAR)); - if (dwSizeNeeded < ExpandEnvironmentStringsW((LPCWSTR)ptr, expanded, dwSizeNeeded)) - { - dwError = GetLastError(); - goto done; - } - *lpValue = expanded; - HeapFree(GetProcessHeap(), 0, ptr); - dwError = ERROR_SUCCESS; - } - else - { - *lpValue = ptr; - } - -done:; - if (dwError != ERROR_SUCCESS) - { - HeapFree(GetProcessHeap(), 0, ptr); - HeapFree(GetProcessHeap(), 0, expanded); - } - - return dwError; -} - -/* EOF */ - +/* + * config.c + */ + +/* INCLUDES *****************************************************************/ + +#include "services.h" + +#define NDEBUG +#include <debug.h> + +/* FUNCTIONS *****************************************************************/ + + +DWORD +ScmOpenServiceKey(LPWSTR lpServiceName, + REGSAM samDesired, + PHKEY phKey) +{ + HKEY hServicesKey = NULL; + DWORD dwError; + + *phKey = NULL; + + dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"System\\CurrentControlSet\\Services", + 0, + KEY_READ, + &hServicesKey); + if (dwError != ERROR_SUCCESS) + return dwError; + + dwError = RegOpenKeyExW(hServicesKey, + lpServiceName, + 0, + samDesired, + phKey); + + RegCloseKey(hServicesKey); + + return dwError; +} + + +DWORD +ScmCreateServiceKey(LPWSTR lpServiceName, + REGSAM samDesired, + PHKEY phKey) +{ + HKEY hServicesKey = NULL; + DWORD dwDisposition; + DWORD dwError; + + *phKey = NULL; + + dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"System\\CurrentControlSet\\Services", + 0, + KEY_READ | KEY_CREATE_SUB_KEY, + &hServicesKey); + if (dwError != ERROR_SUCCESS) + return dwError; + + dwError = RegCreateKeyExW(hServicesKey, + lpServiceName, + 0, + NULL, + REG_OPTION_NON_VOLATILE, + samDesired, + NULL, + phKey, + &dwDisposition); +#if 0 + if ((dwError == ERROR_SUCCESS) && + (dwDisposition == REG_OPENED_EXISTING_KEY)) + { + RegCloseKey(*phKey); + *phKey = NULL; + dwError = ERROR_SERVICE_EXISTS; + } +#endif + + RegCloseKey(hServicesKey); + + return dwError; +} + + + +DWORD +ScmWriteDependencies(HKEY hServiceKey, + LPWSTR lpDependencies, + DWORD dwDependenciesLength) +{ + DWORD dwError = ERROR_SUCCESS; + DWORD dwGroupLength = 0; + DWORD dwServiceLength = 0; + DWORD dwLength; + LPWSTR lpGroupDeps; + LPWSTR lpServiceDeps; + LPWSTR lpSrc; + LPWSTR lpDst; + + if (*lpDependencies == 0) + { + RegDeleteValue(hServiceKey, + L"DependOnService"); + RegDeleteValue(hServiceKey, + L"DependOnGroup"); + } + else + { + lpGroupDeps = HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + (dwDependenciesLength + 2) * sizeof(WCHAR)); + if (lpGroupDeps == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + lpSrc = lpDependencies; + lpDst = lpGroupDeps; + while (*lpSrc != 0) + { + dwLength = wcslen(lpSrc); + if (*lpSrc == SC_GROUP_IDENTIFIERW) + { + lpSrc++; + dwGroupLength += dwLength; + wcscpy(lpDst, lpSrc); + lpDst = lpDst + dwLength; + } + + lpSrc = lpSrc + dwLength; + } + *lpDst = 0; + lpDst++; + dwGroupLength++; + + lpSrc = lpDependencies; + lpServiceDeps = lpDst; + while (*lpSrc != 0) + { + dwLength = wcslen(lpSrc) + 1; + if (*lpSrc != SC_GROUP_IDENTIFIERW) + { + dwServiceLength += dwLength; + wcscpy(lpDst, lpSrc); + lpDst = lpDst + dwLength; + } + + lpSrc = lpSrc + dwLength; + } + *lpDst = 0; + dwServiceLength++; + + dwError = RegSetValueExW(hServiceKey, + L"DependOnGroup", + 0, + REG_MULTI_SZ, + (LPBYTE)lpGroupDeps, + dwGroupLength * sizeof(WCHAR)); + + if (dwError == ERROR_SUCCESS) + { + dwError = RegSetValueExW(hServiceKey, + L"DependOnService", + 0, + REG_MULTI_SZ, + (LPBYTE)lpServiceDeps, + dwServiceLength * sizeof(WCHAR)); + } + + HeapFree(GetProcessHeap(), 0, lpGroupDeps); + } + + return dwError; +} + + +DWORD +ScmMarkServiceForDelete(PSERVICE pService) +{ + HKEY hServiceKey = NULL; + DWORD dwValue = 1; + DWORD dwError; + + DPRINT("ScmMarkServiceForDelete() called\n"); + + dwError = ScmOpenServiceKey(pService->lpServiceName, + KEY_WRITE, + &hServiceKey); + if (dwError != ERROR_SUCCESS) + return dwError; + + dwError = RegSetValueExW(hServiceKey, + L"DeleteFlag", + 0, + REG_DWORD, + (LPBYTE)&dwValue, + sizeof(DWORD)); + + RegCloseKey(hServiceKey); + + return dwError; +} + + +BOOL +ScmIsDeleteFlagSet(HKEY hServiceKey) +{ + DWORD dwError; + DWORD dwType; + DWORD dwFlag; + DWORD dwSize = sizeof(DWORD); + + dwError = RegQueryValueExW(hServiceKey, + L"DeleteFlag", + 0, + &dwType, + (LPBYTE)&dwFlag, + &dwSize); + + return (dwError == ERROR_SUCCESS); +} + + +DWORD +ScmReadString(HKEY hServiceKey, + LPWSTR lpValueName, + LPWSTR *lpValue) +{ + DWORD dwError; + DWORD dwSize; + DWORD dwType; + DWORD dwSizeNeeded; + LPWSTR expanded = NULL; + LPWSTR ptr = NULL; + + *lpValue = NULL; + + dwSize = 0; + dwError = RegQueryValueExW(hServiceKey, + lpValueName, + 0, + &dwType, + NULL, + &dwSize); + if (dwError != ERROR_SUCCESS) + return dwError; + + ptr = HeapAlloc(GetProcessHeap(), 0, dwSize); + if (ptr == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + dwError = RegQueryValueExW(hServiceKey, + lpValueName, + 0, + &dwType, + (LPBYTE)ptr, + &dwSize); + if (dwError != ERROR_SUCCESS) + goto done; + + if (dwType == REG_EXPAND_SZ) + { + /* Expand the value... */ + dwSizeNeeded = ExpandEnvironmentStringsW((LPCWSTR)ptr, NULL, 0); + if (dwSizeNeeded == 0) + { + dwError = GetLastError(); + goto done; + } + expanded = HeapAlloc(GetProcessHeap(), 0, dwSizeNeeded * sizeof(WCHAR)); + if (dwSizeNeeded < ExpandEnvironmentStringsW((LPCWSTR)ptr, expanded, dwSizeNeeded)) + { + dwError = GetLastError(); + goto done; + } + *lpValue = expanded; + HeapFree(GetProcessHeap(), 0, ptr); + dwError = ERROR_SUCCESS; + } + else + { + *lpValue = ptr; + } + +done:; + if (dwError != ERROR_SUCCESS) + { + HeapFree(GetProcessHeap(), 0, ptr); + HeapFree(GetProcessHeap(), 0, expanded); + } + + return dwError; +} + +/* EOF */ + Property changes on: trunk/reactos/subsys/system/services/config.c ___________________________________________________________________ Name: svn:keywords + author date id revision Name: svn:eol-style + native _____ Modified: trunk/reactos/subsys/system/services/driver.c --- trunk/reactos/subsys/system/services/driver.c 2005-12-31 18:56:34 UTC (rev 20491) +++ trunk/reactos/subsys/system/services/driver.c 2005-12-31 19:02:48 UTC (rev 20492) @@ -1,253 +1,253 @@ -/* - * driver.c - */ - -/* INCLUDES *****************************************************************/ - -#include "services.h" - -#define NDEBUG -#include <debug.h> - -/* FUNCTIONS ****************************************************************/ - -NTSTATUS -ScmLoadDriver(PSERVICE lpService) -{ - WCHAR szDriverPath[MAX_PATH]; - UNICODE_STRING DriverPath; - NTSTATUS Status; - - /* Build the driver path */ - wcscpy(szDriverPath, - L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\"); - wcscat(szDriverPath, - lpService->lpServiceName); - - RtlInitUnicodeString(&DriverPath, - szDriverPath); - - /* FIXME: Acquire privilege */ - - DPRINT(" Path: %wZ\n", &DriverPath); - Status = NtLoadDriver(&DriverPath); - - /* FIXME: Release privilege */ - - return Status; -} - - -DWORD -ScmUnloadDriver(PSERVICE lpService) -{ - WCHAR szDriverPath[MAX_PATH]; - UNICODE_STRING DriverPath; - NTSTATUS Status; - DWORD dwError = ERROR_SUCCESS; - - /* Build the driver path */ - wcscpy(szDriverPath, - L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\"); - wcscat(szDriverPath, - lpService->lpServiceName); - - RtlInitUnicodeString(&DriverPath, - szDriverPath); - - /* FIXME: Acquire privilege */ - - Status = NtUnloadDriver(&DriverPath); - - /* FIXME: Release privilege */ - - if (!NT_SUCCESS(Status)) - { - dwError = RtlNtStatusToDosError(Status); - } - - return dwError; -} - - -DWORD -ScmGetDriverStatus(PSERVICE lpService, - LPSERVICE_STATUS lpServiceStatus) -{ - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING DirName; - HANDLE DirHandle; - NTSTATUS Status = STATUS_SUCCESS; - POBJECT_DIRECTORY_INFORMATION DirInfo; - ULONG BufferLength; - ULONG DataLength; - ULONG Index; - DWORD dwError = ERROR_SUCCESS; - BOOLEAN bFound = FALSE; - - DPRINT1("ScmGetDriverStatus() called\n"); - - memset(lpServiceStatus, 0, sizeof(SERVICE_STATUS)); - - if (lpService->Status.dwServiceType == SERVICE_KERNEL_DRIVER) - { - RtlInitUnicodeString(&DirName, - L"\\Driver"); - } - else - { - RtlInitUnicodeString(&DirName, - L"\\FileSystem"); - } - - InitializeObjectAttributes(&ObjectAttributes, - &DirName, - 0, - NULL, - NULL); - - Status = NtOpenDirectoryObject(&DirHandle, - DIRECTORY_QUERY | DIRECTORY_TRAVERSE, - &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtOpenDirectoryObject() failed!\n"); - return RtlNtStatusToDosError(Status); - } - - BufferLength = sizeof(OBJECT_DIRECTORY_INFORMATION) + - 2 * MAX_PATH * sizeof(WCHAR); - DirInfo = HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, - BufferLength); - - Index = 0; - while (TRUE) - { - Status = NtQueryDirectoryObject(DirHandle, - DirInfo, - BufferLength, - TRUE, - FALSE, - &Index, - &DataLength); - if (Status == STATUS_NO_MORE_ENTRIES) - { - DPRINT("No more services\n"); - break; - } - - if (!NT_SUCCESS(Status)) - break; - - DPRINT("Comparing: '%S' '%wZ'\n", lpService->lpServiceName, &DirInfo->ObjectName); - - if (_wcsicmp(lpService->lpServiceName, DirInfo->ObjectName.Buffer) == 0) - { - DPRINT1("Found: '%S' '%wZ'\n", - lpService->lpServiceName, &DirInfo->ObjectName); - bFound = TRUE; - - break; - } - } - - HeapFree(GetProcessHeap(), - 0, - DirInfo); - NtClose(DirHandle); - - if (!NT_SUCCESS(Status)) - { - DPRINT1("Status: %lx\n", Status); - return RtlNtStatusToDosError(Status); - } - - if ((bFound == TRUE) && - (lpService->Status.dwCurrentState != SERVICE_STOP_PENDING)) - { - if (lpService->Status.dwCurrentState == SERVICE_STOPPED) - { - lpService->Status.dwWin32ExitCode = ERROR_SUCCESS; - lpService->Status.dwServiceSpecificExitCode = ERROR_SUCCESS; - lpService->Status.dwCheckPoint = 0; - lpService->Status.dwWaitHint = 0; - lpService->Status.dwControlsAccepted = 0; - } - else - { - lpService->Status.dwCurrentState = SERVICE_RUNNING; - lpService->Status.dwControlsAccepted = SERVICE_ACCEPT_STOP; - - if (lpService->Status.dwWin32ExitCode == ERROR_SERVICE_NEVER_STARTED) - lpService->Status.dwWin32ExitCode = ERROR_SUCCESS; - } - } - else - { - lpService->Status.dwCurrentState = SERVICE_STOPPED; - lpService->Status.dwControlsAccepted = 0; - lpService->Status.dwCheckPoint = 0; - lpService->Status.dwWaitHint = 0; - - if (lpService->Status.dwCurrentState == SERVICE_STOP_PENDING) - lpService->Status.dwWin32ExitCode = ERROR_SUCCESS; - else - lpService->Status.dwWin32ExitCode = ERROR_GEN_FAILURE; - } - - if (lpServiceStatus != NULL) - { - memcpy(lpServiceStatus, - &lpService->Status, - sizeof(SERVICE_STATUS)); - } - - DPRINT1("ScmGetDriverStatus() done (Error: %lu)\n", dwError); - - return ERROR_SUCCESS; -} - - -DWORD -ScmControlDriver(PSERVICE lpService, - DWORD dwControl, - LPSERVICE_STATUS lpServiceStatus) -{ - DWORD dwError; - - DPRINT("ScmControlDriver() called\n"); - - switch (dwControl) - { - case SERVICE_CONTROL_STOP: - if (lpService->Status.dwCurrentState != SERVICE_RUNNING) - { - dwError = ERROR_INVALID_SERVICE_CONTROL; - goto done; - } - - dwError = ScmUnloadDriver(lpService); - if (dwError == ERROR_SUCCESS) - { - lpService->Status.dwControlsAccepted = 0; - lpService->Status.dwCurrentState = SERVICE_STOPPED; - } - break; - - case SERVICE_CONTROL_INTERROGATE: - dwError = ScmGetDriverStatus(lpService, - lpServiceStatus); - break; - - default: - dwError = ERROR_INVALID_SERVICE_CONTROL; - } - -done:; - DPRINT("ScmControlDriver() done (Erorr: %lu)\n", dwError); - - return dwError; -} - -/* EOF */ +/* + * driver.c + */ + +/* INCLUDES *****************************************************************/ + +#include "services.h" + +#define NDEBUG +#include <debug.h> + +/* FUNCTIONS ****************************************************************/ + +NTSTATUS +ScmLoadDriver(PSERVICE lpService) +{ + WCHAR szDriverPath[MAX_PATH]; + UNICODE_STRING DriverPath; + NTSTATUS Status; + + /* Build the driver path */ + wcscpy(szDriverPath, + L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\"); + wcscat(szDriverPath, + lpService->lpServiceName); + + RtlInitUnicodeString(&DriverPath, + szDriverPath); + + /* FIXME: Acquire privilege */ + + DPRINT(" Path: %wZ\n", &DriverPath); + Status = NtLoadDriver(&DriverPath); + + /* FIXME: Release privilege */ + + return Status; +} + + +DWORD +ScmUnloadDriver(PSERVICE lpService) +{ + WCHAR szDriverPath[MAX_PATH]; + UNICODE_STRING DriverPath; + NTSTATUS Status; + DWORD dwError = ERROR_SUCCESS; + + /* Build the driver path */ + wcscpy(szDriverPath, + L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\"); + wcscat(szDriverPath, + lpService->lpServiceName); + + RtlInitUnicodeString(&DriverPath, + szDriverPath); + + /* FIXME: Acquire privilege */ + + Status = NtUnloadDriver(&DriverPath); + + /* FIXME: Release privilege */ + + if (!NT_SUCCESS(Status)) + { + dwError = RtlNtStatusToDosError(Status); + } + + return dwError; +} + + +DWORD +ScmGetDriverStatus(PSERVICE lpService, + LPSERVICE_STATUS lpServiceStatus) +{ + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING DirName; + HANDLE DirHandle; + NTSTATUS Status = STATUS_SUCCESS; + POBJECT_DIRECTORY_INFORMATION DirInfo; + ULONG BufferLength; + ULONG DataLength; + ULONG Index; + DWORD dwError = ERROR_SUCCESS; + BOOLEAN bFound = FALSE; + + DPRINT1("ScmGetDriverStatus() called\n"); + + memset(lpServiceStatus, 0, sizeof(SERVICE_STATUS)); + + if (lpService->Status.dwServiceType == SERVICE_KERNEL_DRIVER) + { + RtlInitUnicodeString(&DirName, + L"\\Driver"); + } + else + { + RtlInitUnicodeString(&DirName, + L"\\FileSystem"); + } + + InitializeObjectAttributes(&ObjectAttributes, + &DirName, + 0, + NULL, + NULL); + + Status = NtOpenDirectoryObject(&DirHandle, + DIRECTORY_QUERY | DIRECTORY_TRAVERSE, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtOpenDirectoryObject() failed!\n"); + return RtlNtStatusToDosError(Status); + } + + BufferLength = sizeof(OBJECT_DIRECTORY_INFORMATION) + + 2 * MAX_PATH * sizeof(WCHAR); + DirInfo = HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + BufferLength); + + Index = 0; + while (TRUE) + { + Status = NtQueryDirectoryObject(DirHandle, + DirInfo, + BufferLength, + TRUE, + FALSE, + &Index, + &DataLength); + if (Status == STATUS_NO_MORE_ENTRIES) + { [truncated at 1000 lines; 419 more skipped]
18 years, 11 months
1
0
0
0
[ekohl] 20491: Move group-list related code to a separate file and keep the group name in the group record because it never changes.
by ekohl@svn.reactos.org
Move group-list related code to a separate file and keep the group name in the group record because it never changes. Modified: trunk/reactos/subsys/system/services/config.c Modified: trunk/reactos/subsys/system/services/database.c Added: trunk/reactos/subsys/system/services/groupdb.c Modified: trunk/reactos/subsys/system/services/services.h Modified: trunk/reactos/subsys/system/services/services.xml _____ Modified: trunk/reactos/subsys/system/services/config.c --- trunk/reactos/subsys/system/services/config.c 2005-12-31 18:36:39 UTC (rev 20490) +++ trunk/reactos/subsys/system/services/config.c 2005-12-31 18:56:34 UTC (rev 20491) @@ -233,7 +233,7 @@ DWORD dwType; DWORD dwSizeNeeded; LPWSTR expanded = NULL; - LPBYTE ptr = NULL; + LPWSTR ptr = NULL; *lpValue = NULL; @@ -255,7 +255,7 @@ lpValueName, 0, &dwType, - ptr, + (LPBYTE)ptr, &dwSize); if (dwError != ERROR_SUCCESS) goto done; @@ -281,7 +281,7 @@ } else { - *lpValue = (LPWSTR)ptr; + *lpValue = ptr; } done:; _____ Modified: trunk/reactos/subsys/system/services/database.c --- trunk/reactos/subsys/system/services/database.c 2005-12-31 18:36:39 UTC (rev 20490) +++ trunk/reactos/subsys/system/services/database.c 2005-12-31 18:56:34 UTC (rev 20491) @@ -31,23 +31,8 @@ #include <debug.h> -/* TYPES *********************************************************************/ - -typedef struct _SERVICE_GROUP -{ - LIST_ENTRY GroupListEntry; - UNICODE_STRING GroupName; - - BOOLEAN ServicesRunning; - ULONG TagCount; - PULONG TagArray; - -} SERVICE_GROUP, *PSERVICE_GROUP; - - /* GLOBALS *******************************************************************/ -LIST_ENTRY GroupListHead; LIST_ENTRY ServiceListHead; static RTL_RESOURCE DatabaseLock; @@ -143,104 +128,6 @@ } -static NTSTATUS STDCALL -CreateGroupOrderListRoutine(PWSTR ValueName, - ULONG ValueType, - PVOID ValueData, - ULONG ValueLength, - PVOID Context, - PVOID EntryContext) -{ - PSERVICE_GROUP Group; - - DPRINT("CreateGroupOrderListRoutine(%S, %x, %x, %x, %x, %x)\n", - ValueName, ValueType, ValueData, ValueLength, Context, EntryContext); - - if (ValueType == REG_BINARY && - ValueData != NULL && - ValueLength >= sizeof(DWORD) && - ValueLength >= (*(PULONG)ValueData + 1) * sizeof(DWORD)) - { - Group = (PSERVICE_GROUP)Context; - Group->TagCount = ((PULONG)ValueData)[0]; - if (Group->TagCount > 0) - { - if (ValueLength >= (Group->TagCount + 1) * sizeof(DWORD)) - { - Group->TagArray = (PULONG)HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, - Group->TagCount * sizeof(DWORD)); - if (Group->TagArray == NULL) - { - Group->TagCount = 0; - return STATUS_INSUFFICIENT_RESOURCES; - } - - RtlCopyMemory(Group->TagArray, - (PULONG)ValueData + 1, - Group->TagCount * sizeof(DWORD)); - } - else - { - Group->TagCount = 0; - return STATUS_UNSUCCESSFUL; - } - } - } - - return STATUS_SUCCESS; -} - - -static NTSTATUS STDCALL -CreateGroupListRoutine(PWSTR ValueName, - ULONG ValueType, - PVOID ValueData, - ULONG ValueLength, - PVOID Context, - PVOID EntryContext) -{ - PSERVICE_GROUP Group; - RTL_QUERY_REGISTRY_TABLE QueryTable[2]; - NTSTATUS Status; - - if (ValueType == REG_SZ) - { - DPRINT("Data: '%S'\n", (PWCHAR)ValueData); - - Group = (PSERVICE_GROUP)HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, - sizeof(SERVICE_GROUP)); - if (Group == NULL) - { - return STATUS_INSUFFICIENT_RESOURCES; - } - - if (!RtlCreateUnicodeString(&Group->GroupName, - (PWSTR)ValueData)) - { - return STATUS_INSUFFICIENT_RESOURCES; - } - - RtlZeroMemory(&QueryTable, sizeof(QueryTable)); - QueryTable[0].Name = (PWSTR)ValueData; - QueryTable[0].QueryRoutine = CreateGroupOrderListRoutine; - - Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL, - L"GroupOrderList", - QueryTable, - (PVOID)Group, - NULL); - DPRINT("%x %d %S\n", Status, Group->TagCount, (PWSTR)ValueData); - - InsertTailList(&GroupListHead, - &Group->GroupListEntry); - } - - return STATUS_SUCCESS; -} - - DWORD ScmCreateNewServiceRecord(LPWSTR lpServiceName, PSERVICE *lpServiceRecord) @@ -412,31 +299,6 @@ } -DWORD -ScmReadGroupList(VOID) -{ - RTL_QUERY_REGISTRY_TABLE QueryTable[2]; - NTSTATUS Status; - - InitializeListHead(&GroupListHead); - - /* Build group order list */ - RtlZeroMemory(&QueryTable, - sizeof(QueryTable)); - - QueryTable[0].Name = L"List"; - QueryTable[0].QueryRoutine = CreateGroupListRoutine; - - Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL, - L"ServiceGroupOrder", - QueryTable, - NULL, - NULL); - - return RtlNtStatusToDosError(Status); -} - - VOID ScmDeleteMarkedServices(VOID) { @@ -476,7 +338,7 @@ DPRINT("ScmCreateServiceDatabase() called\n"); - dwError = ScmReadGroupList(); + dwError = ScmCreateGroupList(); if (dwError != ERROR_SUCCESS) return dwError; @@ -627,9 +489,9 @@ { CurrentGroup = CONTAINING_RECORD(GroupEntry, SERVICE_GROUP, GroupListEntry); - DPRINT("Checking group '%wZ'\n", &CurrentGroup->GroupName); + DPRINT("Checking group '%S'\n", &CurrentGroup->lpGroupName); if (Service->lpServiceGroup != NULL && - _wcsicmp(Service->lpServiceGroup, CurrentGroup->GroupName.Buffer) == 0) + _wcsicmp(Service->lpServiceGroup, CurrentGroup->lpGroupName) == 0) { CurrentGroup->ServicesRunning = TRUE; } @@ -984,7 +846,7 @@ { CurrentGroup = CONTAINING_RECORD(GroupEntry, SERVICE_GROUP, GroupListEntry); - DPRINT("Group '%wZ'\n", &CurrentGroup->GroupName); + DPRINT("Group '%S'\n", CurrentGroup->lpGroupName); /* Start all services witch have a valid tag */ for (i = 0; i < CurrentGroup->TagCount; i++) @@ -995,7 +857,7 @@ CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry); if ((CurrentService->lpServiceGroup != NULL) && - (_wcsicmp(CurrentGroup->GroupName.Buffer, CurrentService->lpServiceGroup) == 0) && + (_wcsicmp(CurrentGroup->lpGroupName, CurrentService->lpServiceGroup) == 0) && (CurrentService->dwStartType == SERVICE_AUTO_START) && (CurrentService->ServiceVisited == FALSE) && (CurrentService->dwTag == CurrentGroup->TagArray[i])) @@ -1016,7 +878,7 @@ CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry); if ((CurrentService->lpServiceGroup != NULL) && - (_wcsicmp(CurrentGroup->GroupName.Buffer, CurrentService->lpServiceGroup) == 0) && + (_wcsicmp(CurrentGroup->lpGroupName, CurrentService->lpServiceGroup) == 0) && (CurrentService->dwStartType == SERVICE_AUTO_START) && (CurrentService->ServiceVisited == FALSE)) { _____ Added: trunk/reactos/subsys/system/services/groupdb.c --- trunk/reactos/subsys/system/services/groupdb.c 2005-12-31 18:36:39 UTC (rev 20490) +++ trunk/reactos/subsys/system/services/groupdb.c 2005-12-31 18:56:34 UTC (rev 20491) @@ -0,0 +1,140 @@ +/* + * groupdb.c + */ + +/* INCLUDES *****************************************************************/ + +#include "services.h" + +#define NDEBUG +#include <debug.h> + + +/* GLOBALS *******************************************************************/ + +LIST_ENTRY GroupListHead; + + +/* FUNCTIONS *****************************************************************/ + +static NTSTATUS STDCALL +CreateGroupOrderListRoutine(PWSTR ValueName, + ULONG ValueType, + PVOID ValueData, + ULONG ValueLength, + PVOID Context, + PVOID EntryContext) +{ + PSERVICE_GROUP Group; + + DPRINT("CreateGroupOrderListRoutine(%S, %x, %x, %x, %x, %x)\n", + ValueName, ValueType, ValueData, ValueLength, Context, EntryContext); + + if (ValueType == REG_BINARY && + ValueData != NULL && + ValueLength >= sizeof(DWORD) && + ValueLength >= (*(PULONG)ValueData + 1) * sizeof(DWORD)) + { + Group = (PSERVICE_GROUP)Context; + Group->TagCount = ((PULONG)ValueData)[0]; + if (Group->TagCount > 0) + { + if (ValueLength >= (Group->TagCount + 1) * sizeof(DWORD)) + { + Group->TagArray = (PULONG)HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + Group->TagCount * sizeof(DWORD)); + if (Group->TagArray == NULL) + { + Group->TagCount = 0; + return STATUS_INSUFFICIENT_RESOURCES; + } + + RtlCopyMemory(Group->TagArray, + (PULONG)ValueData + 1, + Group->TagCount * sizeof(DWORD)); + } + else + { + Group->TagCount = 0; + return STATUS_UNSUCCESSFUL; + } + } + } + + return STATUS_SUCCESS; +} + + +static NTSTATUS STDCALL +CreateGroupListRoutine(PWSTR ValueName, + ULONG ValueType, + PVOID ValueData, + ULONG ValueLength, + PVOID Context, + PVOID EntryContext) +{ + PSERVICE_GROUP Group; + RTL_QUERY_REGISTRY_TABLE QueryTable[2]; + NTSTATUS Status; + + if (ValueType == REG_SZ) + { + DPRINT("Data: '%S'\n", (PWCHAR)ValueData); + + Group = (PSERVICE_GROUP)HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(SERVICE_GROUP) + (wcslen(ValueData) * sizeof(WCHAR))); + if (Group == NULL) + { + return STATUS_INSUFFICIENT_RESOURCES; + } + + wcscpy(Group->szGroupName, ValueData); + Group->lpGroupName = Group->szGroupName; + Group->dwRefCount = (DWORD)-1; + + RtlZeroMemory(&QueryTable, sizeof(QueryTable)); + QueryTable[0].Name = (PWSTR)ValueData; + QueryTable[0].QueryRoutine = CreateGroupOrderListRoutine; + + Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL, + L"GroupOrderList", + QueryTable, + (PVOID)Group, + NULL); + DPRINT("%x %d %S\n", Status, Group->TagCount, (PWSTR)ValueData); + + InsertTailList(&GroupListHead, + &Group->GroupListEntry); + } + + return STATUS_SUCCESS; +} + + +DWORD +ScmCreateGroupList(VOID) +{ + RTL_QUERY_REGISTRY_TABLE QueryTable[2]; + NTSTATUS Status; + + InitializeListHead(&GroupListHead); + + /* Build group order list */ + RtlZeroMemory(&QueryTable, + sizeof(QueryTable)); + + QueryTable[0].Name = L"List"; + QueryTable[0].QueryRoutine = CreateGroupListRoutine; + + Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL, + L"ServiceGroupOrder", + QueryTable, + NULL, + NULL); + + return RtlNtStatusToDosError(Status); +} + +/* EOF */ _____ Modified: trunk/reactos/subsys/system/services/services.h --- trunk/reactos/subsys/system/services/services.h 2005-12-31 18:36:39 UTC (rev 20490) +++ trunk/reactos/subsys/system/services/services.h 2005-12-31 18:56:34 UTC (rev 20491) @@ -9,6 +9,21 @@ #include <ndk/ntndk.h> #include <services/services.h> + +typedef struct _SERVICE_GROUP +{ + LIST_ENTRY GroupListEntry; + LPWSTR lpGroupName; + + DWORD dwRefCount; + BOOLEAN ServicesRunning; + ULONG TagCount; + PULONG TagArray; + + WCHAR szGroupName[1]; +} SERVICE_GROUP, *PSERVICE_GROUP; + + typedef struct _SERVICE { LIST_ENTRY ServiceListEntry; @@ -40,6 +55,7 @@ /* VARIABLES ***************************************************************/ extern LIST_ENTRY ServiceListHead; +extern LIST_ENTRY GroupListHead; extern BOOL ScmShutdown; @@ -90,6 +106,11 @@ LPSERVICE_STATUS lpServiceStatus); +/* groupdb.c */ + +DWORD ScmCreateGroupList(VOID); + + /* rpcserver.c */ VOID ScmStartRpcServer(VOID); _____ Modified: trunk/reactos/subsys/system/services/services.xml --- trunk/reactos/subsys/system/services/services.xml 2005-12-31 18:36:39 UTC (rev 20490) +++ trunk/reactos/subsys/system/services/services.xml 2005-12-31 18:56:34 UTC (rev 20491) @@ -13,6 +13,7 @@ <file>config.c</file> <file>database.c</file> <file>driver.c</file> + <file>groupdb.c</file> <file>rpcserver.c</file> <file>services.c</file> <file>services.rc</file>
18 years, 11 months
1
0
0
0
[mf] 20490: lean explorer: correctly handle path of command line argument in explore mode
by mf@svn.reactos.org
lean explorer: correctly handle path of command line argument in explore mode Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/mainframe.cp p Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .h Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp --- branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp 2005-12-31 17:27:25 UTC (rev 20489) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp 2005-12-31 18:36:39 UTC (rev 20490) @@ -129,36 +129,6 @@ } - // read directory tree and expand to the given location -ShellEntry* ShellDirectory::read_tree(const void* path, SORT_ORDER sortOrder) -{ - CONTEXT("ShellEntry::read_tree()"); - - HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT)); - - ShellDirectory* entry = this; - - for(const void*p=path; p && entry; ) { - if (!(entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) - break; - - entry->read_directory(sortOrder); - - if (entry->_down) - entry->_expanded = true; - - ShellEntry* next_entry = entry->find_entry(p); - p = entry->get_next_path_component(p); - - entry = static_cast<ShellDirectory*>(next_entry); - } - - SetCursor(old_cursor); - - return entry; -} - - void ShellDirectory::read_directory(SORT_ORDER sortOrder, int scan_flags) { CONTEXT("ShellEntry::read_directory(SORT_ORDER)"); _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h --- branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h 2005-12-31 17:27:25 UTC (rev 20489) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h 2005-12-31 18:36:39 UTC (rev 20490) @@ -155,17 +155,15 @@ pFolder->Release(); } - ShellEntry* read_tree(const void* path, SORT_ORDER sortOrder); void read_directory(SORT_ORDER sortOrder, int scan_flags=0); void read_directory(int scan_flags=0); void sort_directory(SORT_ORDER sortOrder); void smart_scan(int scan_flags=0); - virtual const void* get_next_path_component(const void*) const; - virtual ShellEntry* find_entry(const void* p); + virtual ShellEntry* find_entry(const void* p); virtual bool get_path(PTSTR path) const; - int extract_icons(); + int extract_icons(); ShellFolder _folder; HWND _hwnd; @@ -178,7 +176,7 @@ inline IShellFolder* ShellEntry::get_parent_folder() const { if (_up) - return static_cast<ShellDirectory*>(_up)->_folder; + return _up->_folder; else return GetDesktopFolder(); } _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/mainframe.cp p --- branches/lean-explorer/reactos/subsys/system/explorer/shell/mainframe.cp p 2005-12-31 17:27:25 UTC (rev 20489) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/mainframe.cp p 2005-12-31 18:36:39 UTC (rev 20490) @@ -82,8 +82,6 @@ delete _shellBrowser.release(); } - ///@todo use OWM_ROOTED flag - // create explorer treeview if (_create_info._open_mode & OWM_EXPLORE) { if (!_left_hwnd) { _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp --- branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp 2005-12-31 17:27:25 UTC (rev 20489) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp 2005-12-31 18:36:39 UTC (rev 20490) @@ -103,8 +103,6 @@ _root._entry = new ShellDirectory(GetDesktopFolder(), _create_info._root_shell_path, _hwnd); - jump_to(_create_info._shell_path); - // -> set_curdir() _root._entry->read_directory(); @@ -113,8 +111,7 @@ InitDragDrop(); } - /* already filled by ShellDirectory constructor - lstrcpy(_root._entry->_data.cFileName, TEXT("Desktop")); */ + jump_to(_create_info._shell_path); return 0; } @@ -278,11 +275,11 @@ if (pnmtv->action == TVE_COLLAPSE) TreeView_Expand(_left_hwnd, pnmtv->itemNew.hItem, TVE_COLLAPSE|TVE_COLLAPSERESET); else if (pnmtv->action == TVE_EXPAND) { - ShellDirectory* entry = (ShellDirectory*)TreeView_GetItemData(_left_hwnd, pnmtv->itemNew.hItem); + ShellDirectory* dir = (ShellDirectory*)TreeView_GetItemData(_left_hwnd, pnmtv->itemNew.hItem); - if (entry) - if (!InsertSubitems(pnmtv->itemNew.hItem, entry)) { - entry->_shell_attribs &= ~SFGAO_HASSUBFOLDER; + if (dir) + if (!InsertSubitems(pnmtv->itemNew.hItem, dir)) { + dir->_shell_attribs &= ~SFGAO_HASSUBFOLDER; // remove subitem "+" TV_ITEM tvItem; @@ -359,10 +356,11 @@ { CONTEXT("ShellBrowserChild::OnTreeItemSelected()"); - _last_sel = pnmtv->itemNew.hItem; - ShellDirectory* entry = (ShellDirectory*)pnmtv->itemNew.lParam; + ShellDirectory* dir = (ShellDirectory*)pnmtv->itemNew.lParam; - jump_to(entry); + jump_to(dir); + + _last_sel = pnmtv->itemNew.hItem; } void ShellBrowserChild::UpdateFolderView(IShellFolder* folder) @@ -576,26 +574,24 @@ if (pida->cidl >= 1) { if (_left_hwnd) { // explorer mode - //@@if (_last_sel) { - ShellDirectory* parent = _cur_dir;//@@(ShellDirectory*)TreeView_GetItemData(_left_hwnd, _last_sel); + ShellDirectory* parent = _cur_dir; - if (parent) { - try { - parent->smart_scan(); - } catch(COMException& e) { - return e.Error(); - } + if (parent) { + try { + parent->smart_scan(); + } catch(COMException& e) { + return e.Error(); + } - UINT firstOffset = pida->aoffset[1]; - LPITEMIDLIST pidl = (LPITEMIDLIST)((LPBYTE)pida+firstOffset); + UINT firstOffset = pida->aoffset[1]; + LPITEMIDLIST pidl = (LPITEMIDLIST)((LPBYTE)pida+firstOffset); - ShellEntry* entry = parent->find_entry(pidl); + ShellEntry* entry = parent->find_entry(pidl); - if (entry && (entry->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) - if (expand_folder(static_cast<ShellDirectory*>(entry))) - return S_OK; - } - //@@} + if (entry && (entry->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) + if (select_folder(static_cast<ShellDirectory*>(entry), true)) + return S_OK; + } } else { // no tree control if (MainFrame::OpenShellFolders(pida, _hWndFrame)) return S_OK; @@ -611,7 +607,7 @@ } -bool ShellBrowserChild::expand_folder(ShellDirectory* entry) +bool ShellBrowserChild::select_folder(ShellDirectory* dir, bool expand) { CONTEXT("ShellBrowserChild::expand_folder()"); @@ -619,14 +615,19 @@ if (!_last_sel) return false; - if (!TreeView_Expand(_left_hwnd, _last_sel, TVE_EXPAND)) - return false; + if (expand) + if (!TreeView_Expand(_left_hwnd, _last_sel, TVE_EXPAND)) + return false; for(HTREEITEM hitem=TreeView_GetChild(_left_hwnd,_last_sel); hitem; hitem=TreeView_GetNextSibling(_left_hwnd,hitem)) { - if ((ShellDirectory*)TreeView_GetItemData(_left_hwnd,hitem) == entry) { - if (TreeView_SelectItem(_left_hwnd, hitem) && - TreeView_Expand(_left_hwnd, hitem, TVE_EXPAND)) + if ((ShellDirectory*)TreeView_GetItemData(_left_hwnd,hitem) == dir) { + if (TreeView_SelectItem(_left_hwnd, hitem)) { + if (expand) + if (!TreeView_Expand(_left_hwnd, hitem, TVE_EXPAND)) + return false; + return true; + } break; } @@ -645,7 +646,7 @@ void ShellBrowserChild::jump_to(LPCITEMIDLIST pidl) { - ShellDirectory* entry = NULL; + ShellDirectory* dir = NULL; if (!_cur_dir) _cur_dir = _root._entry; @@ -661,48 +662,36 @@ _cur_dir->smart_scan(); - entry = static_cast<ShellDirectory*>(_cur_dir->find_entry(child_pidl)); - if (!entry) + dir = static_cast<ShellDirectory*>(_cur_dir->find_entry(child_pidl)); + if (!dir) break; - jump_to(entry); + jump_to(dir); } } else { _cur_dir->smart_scan(); - entry = static_cast<ShellDirectory*>(_cur_dir->find_entry(pidl)); // This is not correct in the common case, but works on the desktop level. + dir = static_cast<ShellDirectory*>(_cur_dir->find_entry(pidl)); // This is not correct in the common case, but works on the desktop level. - if (entry) - jump_to(entry); + if (dir) + jump_to(dir); } } // If not already called, now directly call UpdateFolderView() using pidl. - if (!entry) + if (!dir) UpdateFolderView(ShellFolder(pidl)); } -void ShellBrowserChild::jump_to(ShellDirectory* entry) +void ShellBrowserChild::jump_to(ShellDirectory* dir) { - IShellFolder* folder; - ShellDirectory* se = entry; - - if (se->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - folder = static_cast<ShellDirectory*>(se)->_folder; - else - folder = se->get_parent_folder(); - - if (!folder) { - assert(folder); + if (dir == _cur_dir) return; - } - if (_create_info._open_mode & OWM_EXPLORE) { + if (_left_hwnd) + select_folder(dir, false); - //@@ todo + UpdateFolderView(dir->_folder); - } else; - UpdateFolderView(folder); - - _cur_dir = se; + _cur_dir = dir; } _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .h --- branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .h 2005-12-31 17:27:25 UTC (rev 20489) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .h 2005-12-31 18:36:39 UTC (rev 20490) @@ -138,7 +138,7 @@ void UpdateFolderView(IShellFolder* folder); void Tree_DoItemMenu(HWND hwndTreeView, HTREEITEM hItem, LPPOINT pptScreen); - bool expand_folder(ShellDirectory* entry); + bool select_folder(ShellDirectory* dir, bool expand); // SDI integration public: @@ -150,7 +150,7 @@ void jump_to(LPCTSTR path); void jump_to(LPCITEMIDLIST pidl); - void jump_to(ShellDirectory* entry); + void jump_to(ShellDirectory* dir); protected: ShellDirectory* _cur_dir; _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp --- branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp 2005-12-31 17:27:25 UTC (rev 20489) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp 2005-12-31 18:36:39 UTC (rev 20490) @@ -96,7 +96,7 @@ CONTEXT("ShellEntry::create_absolute_pidl()"); if (_up) { - ShellDirectory* dir = static_cast<ShellDirectory*>(_up); + ShellDirectory* dir = _up; if (dir->_pidl->mkid.cb) // Caching of absolute PIDLs could enhance performance. return _pidl.create_absolute_pidl(dir->create_absolute_pidl()); @@ -306,19 +306,6 @@ _scanned = true; } -const void* ShellDirectory::get_next_path_component(const void* p) const -{ - LPITEMIDLIST pidl = (LPITEMIDLIST)p; - - if (!pidl || !pidl->mkid.cb) - return NULL; - - // go to next element - pidl = (LPITEMIDLIST)((LPBYTE)pidl+pidl->mkid.cb); - - return pidl; -} - ShellEntry* ShellDirectory::find_entry(const void* p) { LPITEMIDLIST pidl = (LPITEMIDLIST) p;
18 years, 11 months
1
0
0
0
[gedmurphy] 20489: - Use a separate icon for minimizing windows.
by gedmurphy@svn.reactos.org
- Use a separate icon for minimizing windows. - Add new icon Modified: trunk/reactos/subsys/system/explorer/explorer.cpp Modified: trunk/reactos/subsys/system/explorer/explorer_intres.rc Modified: trunk/reactos/subsys/system/explorer/globals.h Added: trunk/reactos/subsys/system/explorer/res/minimize.ico Modified: trunk/reactos/subsys/system/explorer/resource.h Modified: trunk/reactos/subsys/system/explorer/taskbar/quicklaunch.cpp _____ Modified: trunk/reactos/subsys/system/explorer/explorer.cpp --- trunk/reactos/subsys/system/explorer/explorer.cpp 2005-12-31 16:15:42 UTC (rev 20488) +++ trunk/reactos/subsys/system/explorer/explorer.cpp 2005-12-31 17:27:25 UTC (rev 20489) @@ -393,6 +393,7 @@ _icons[ICID_COMPUTER] = Icon(ICID_COMPUTER, IDI_COMPUTER); _icons[ICID_LOGOFF] = Icon(ICID_LOGOFF, IDI_LOGOFF); _icons[ICID_BOOKMARK] = Icon(ICID_BOOKMARK, IDI_DOT_TRANS); + _icons[ICID_MINIMIZE] = Icon(ICID_MINIMIZE, IDI_MINIMIZE); } _____ Modified: trunk/reactos/subsys/system/explorer/explorer_intres.rc --- trunk/reactos/subsys/system/explorer/explorer_intres.rc 2005-12-31 16:15:42 UTC (rev 20488) +++ trunk/reactos/subsys/system/explorer/explorer_intres.rc 2005-12-31 17:27:25 UTC (rev 20489) @@ -163,6 +163,7 @@ IDI_ARROW_DOWN ICON DISCARDABLE "res/arrow_dwn.ico" IDI_NOTIFY_L ICON DISCARDABLE "res/notify_l.ico" IDI_NOTIFY_R ICON DISCARDABLE "res/notify_r.ico" +IDI_MINIMIZE ICON DISCARDABLE "res/minimize.ico" #endif // Neutral resources //////////////////////////////////////////////////////////////////////// ///// _____ Modified: trunk/reactos/subsys/system/explorer/globals.h --- trunk/reactos/subsys/system/explorer/globals.h 2005-12-31 16:15:42 UTC (rev 20488) +++ trunk/reactos/subsys/system/explorer/globals.h 2005-12-31 17:27:25 UTC (rev 20489) @@ -81,6 +81,7 @@ ICID_COMPUTER, ICID_LOGOFF, ICID_BOOKMARK, + ICID_MINIMIZE, ICID_DYNAMIC }; _____ Added: trunk/reactos/subsys/system/explorer/res/minimize.ico (Binary files differ) Property changes on: trunk/reactos/subsys/system/explorer/res/minimize.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream _____ Modified: trunk/reactos/subsys/system/explorer/resource.h --- trunk/reactos/subsys/system/explorer/resource.h 2005-12-31 16:15:42 UTC (rev 20488) +++ trunk/reactos/subsys/system/explorer/resource.h 2005-12-31 17:27:25 UTC (rev 20489) @@ -116,6 +116,7 @@ #define IDI_NOTIFY_R 169 #define IDB_MDI 170 #define IDB_SDI 171 +#define IDI_MINIMIZE 172 #define ID_VIEW_NAME 401 #define ID_VIEW_ALL_ATTRIBUTES 402 #define ID_VIEW_SELECTED_ATTRIBUTES 403 _____ Modified: trunk/reactos/subsys/system/explorer/taskbar/quicklaunch.cpp --- trunk/reactos/subsys/system/explorer/taskbar/quicklaunch.cpp 2005-12-31 16:15:42 UTC (rev 20488) +++ trunk/reactos/subsys/system/explorer/taskbar/quicklaunch.cpp 2005-12-31 17:27:25 UTC (rev 20489) @@ -121,7 +121,7 @@ COLORREF bk_color = GetSysColor(COLOR_BTNFACE); HBRUSH bk_brush = GetSysColorBrush(COLOR_BTNFACE); - AddButton(ID_MINIMIZE_ALL, g_Globals._icon_cache.get_icon(ICID_LOGOFF/*@@*/).create_bitmap(bk_color , bk_brush, canvas), ResString(IDS_MINIMIZE_ALL), NULL); + AddButton(ID_MINIMIZE_ALL, g_Globals._icon_cache.get_icon(ICID_MINIMIZE/*@@*/).create_bitmap(bk_col or, bk_brush, canvas), ResString(IDS_MINIMIZE_ALL), NULL); AddButton(ID_EXPLORE, g_Globals._icon_cache.get_icon(ICID_EXPLORER).create_bitmap(bk_color, bk_brush, canvas), ResString(IDS_TITLE), NULL); TBBUTTON sep = {0, -1, TBSTATE_ENABLED, BTNS_SEP, {0, 0}, 0, 0};
18 years, 11 months
1
0
0
0
[gvg] 20488: SVN maintenance
by gvg@svn.reactos.org
SVN maintenance Property changes on: trunk/reactos/lib/keyboard/kbdur ___________________________________________________________________ Name: svn:ignore + GNUmakefile
18 years, 11 months
1
0
0
0
← Newer
1
2
3
4
...
71
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Results per page:
10
25
50
100
200