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
September 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
22 participants
582 discussions
Start a n
N
ew thread
[weiden] 18181: initialize COM on demand only
by weiden@svn.reactos.com
initialize COM on demand only Modified: trunk/reactos/subsys/system/regedit/framewnd.c Modified: trunk/reactos/subsys/system/regedit/main.c _____ Modified: trunk/reactos/subsys/system/regedit/framewnd.c --- trunk/reactos/subsys/system/regedit/framewnd.c 2005-09-30 22:17:58 UTC (rev 18180) +++ trunk/reactos/subsys/system/regedit/framewnd.c 2005-09-30 23:32:24 UTC (rev 18181) @@ -27,6 +27,7 @@ #include <stdio.h> #include <shellapi.h> #include <objsel.h> +#include <objbase.h> #include "main.h" #include "regproc.h" @@ -679,20 +680,26 @@ IDsObjectPicker *ObjectPicker; WCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1]; HRESULT hRet; - - hRet = InitializeRemoteRegistryPicker(&ObjectPicker); + + hRet = CoInitialize(NULL); if (SUCCEEDED(hRet)) { - hRet = InvokeRemoteRegistryPickerDialog(ObjectPicker, - hWnd, - szComputerName, - sizeof(szComputerName) / sizeof(szComputerName[0])); - if (hRet == S_OK) + hRet = InitializeRemoteRegistryPicker(&ObjectPicker); + if (SUCCEEDED(hRet)) { - /* FIXME - connect to the registry */ + hRet = InvokeRemoteRegistryPickerDialog(ObjectPicker, + hWnd, + szComputerName, + sizeof(szComputerName) / sizeof(szComputerName[0])); + if (hRet == S_OK) + { + /* FIXME - connect to the registry */ + } + + FreeObjectPicker(ObjectPicker); } - FreeObjectPicker(ObjectPicker); + CoUninitialize(); } return TRUE; _____ Modified: trunk/reactos/subsys/system/regedit/main.c --- trunk/reactos/subsys/system/regedit/main.c 2005-09-30 22:17:58 UTC (rev 18180) +++ trunk/reactos/subsys/system/regedit/main.c 2005-09-30 23:32:24 UTC (rev 18181) @@ -30,7 +30,6 @@ #include <fcntl.h> #include <aclui.h> #include <cguid.h> -#include <objbase.h> #include "main.h" #include "hexedit.h" @@ -190,7 +189,7 @@ { MSG msg; HACCEL hAccel; - HRESULT hComInit; + /* int hCrt; FILE *hf; @@ -223,9 +222,6 @@ return FALSE; } hAccel = LoadAccelerators(hInstance, (LPCTSTR)IDC_REGEDIT); - - /* initialize the COM library for the remote registry object picker dialog */ - hComInit = CoInitialize(NULL); /* Main message loop */ while (GetMessage(&msg, (HWND)NULL, 0, 0)) { @@ -236,11 +232,6 @@ } } - if (SUCCEEDED(hComInit)) - { - CoUninitialize(); - } - ExitInstance(hInstance); return msg.wParam; }
19 years, 2 months
1
0
0
0
[ea] 18180: Fix build.
by ea@svn.reactos.com
Fix build. Modified: trunk/reactos/baseaddress.xml _____ Modified: trunk/reactos/baseaddress.xml --- trunk/reactos/baseaddress.xml 2005-09-30 22:00:30 UTC (rev 18179) +++ trunk/reactos/baseaddress.xml 2005-09-30 22:17:58 UTC (rev 18180) @@ -109,4 +109,5 @@ <property name="BASEADDRESS_PACKET" value="0x77780000" /> <property name="BASEADDRESS_IPRTPRIO" value="0x777c0000" /> <property name="BASEADDRESS_WSHTCPIP" value="0x777c0000" /> +<property name="BASEADDRESS_AUTHZ" value="0x77690000" /> </group>
19 years, 2 months
1
0
0
0
[weiden] 18179: don't remove mutants twice from the thread's mutant list in KeRundownThread(). This might fix bug 821
by weiden@svn.reactos.com
don't remove mutants twice from the thread's mutant list in KeRundownThread(). This might fix bug 821 Modified: trunk/reactos/ntoskrnl/ke/kthread.c _____ Modified: trunk/reactos/ntoskrnl/ke/kthread.c --- trunk/reactos/ntoskrnl/ke/kthread.c 2005-09-30 21:32:01 UTC (rev 18178) +++ trunk/reactos/ntoskrnl/ke/kthread.c 2005-09-30 22:00:30 UTC (rev 18179) @@ -467,7 +467,7 @@ while (!IsListEmpty(&Thread->MutantListHead)) { /* Get the Mutant */ - CurrentEntry = RemoveHeadList(&Thread->MutantListHead); + CurrentEntry = RemoveHeadList(&Thread->MutantListHead); Mutant = CONTAINING_RECORD(CurrentEntry, KMUTANT, MutantListEntry); ASSERT(Mutant->ApcDisable == 0); @@ -476,7 +476,6 @@ Mutant->Header.SignalState = 1; Mutant->Abandoned = TRUE; Mutant->OwnerThread = NULL; - RemoveEntryList(&Mutant->MutantListEntry); /* Check if the Wait List isn't empty */ DPRINT("Checking whether to wake the Mutant\n");
19 years, 2 months
1
0
0
0
[weiden] 18178: set eol-style to native
by weiden@svn.reactos.com
set eol-style to native Modified: trunk/reactos/lib/authz/authz.def _____ Modified: trunk/reactos/lib/authz/authz.def --- trunk/reactos/lib/authz/authz.def 2005-09-30 21:28:29 UTC (rev 18177) +++ trunk/reactos/lib/authz/authz.def 2005-09-30 21:32:01 UTC (rev 18178) @@ -1,46 +1,46 @@ -LIBRARY authz.dll - -EXPORTS -AuthzAccessCheck@36 -AuthzAddSidsToContext@24 -AuthzCachedAccessCheck@20 -AuthzEnumerateSecurityEventSources@16 -AuthzFreeAuditEvent@4 -AuthzFreeContext@4 -AuthzFreeHandle@4 -AuthzFreeResourceManager@4 -AuthzGetInformationFromContext@20 -AuthzInitializeContextFromAuthzContext@28 -AuthzInitializeContextFromSid@32 -AuthzInitializeContextFromToken@32 -AuthzInitializeObjectAccessAuditEvent@32 -AuthzInitializeObjectAccessAuditEvent2@36 -AuthzInitializeResourceManager@24 -AuthzInstallSecurityEventSource@8 -AuthzOpenObjectAudit@32 -AuthzRegisterSecurityEventSource@12 -AuthzReportSecurityEvent@20=AuthzReportSecurityEvent -AuthzReportSecurityEventFromParams@20 -AuthzUninstallSecurityEventSource@8 -AuthzUnregisterSecurityEventSource@8 -;AuthziAllocateAuditParams -;AuthziFreeAuditEventType -;AuthziFreeAuditParams -;AuthziFreeAuditQueue -;AuthziInitializeAuditEvent -;AuthziInitializeAuditEventType -;AuthziInitializeAuditParams -;AuthziInitializeAuditParamsFromArray -;AuthziInitializeAuditParamsWithRM -;AuthziInitializeAuditQueue -;AuthziInitializeContextFromSid -;AuthziLogAuditEvent -;AuthziModifyAuditEvent2 -;AuthziModifyAuditEvent -;AuthziModifyAuditEventType -;AuthziModifyAuditQueue -;AuthziQueryAuditPolicy -;AuthziSetAuditPolicy -;AuthziSourceAudit - -; EOF +LIBRARY authz.dll + +EXPORTS +AuthzAccessCheck@36 +AuthzAddSidsToContext@24 +AuthzCachedAccessCheck@20 +AuthzEnumerateSecurityEventSources@16 +AuthzFreeAuditEvent@4 +AuthzFreeContext@4 +AuthzFreeHandle@4 +AuthzFreeResourceManager@4 +AuthzGetInformationFromContext@20 +AuthzInitializeContextFromAuthzContext@28 +AuthzInitializeContextFromSid@32 +AuthzInitializeContextFromToken@32 +AuthzInitializeObjectAccessAuditEvent@32 +AuthzInitializeObjectAccessAuditEvent2@36 +AuthzInitializeResourceManager@24 +AuthzInstallSecurityEventSource@8 +AuthzOpenObjectAudit@32 +AuthzRegisterSecurityEventSource@12 +AuthzReportSecurityEvent@20=AuthzReportSecurityEvent +AuthzReportSecurityEventFromParams@20 +AuthzUninstallSecurityEventSource@8 +AuthzUnregisterSecurityEventSource@8 +;AuthziAllocateAuditParams +;AuthziFreeAuditEventType +;AuthziFreeAuditParams +;AuthziFreeAuditQueue +;AuthziInitializeAuditEvent +;AuthziInitializeAuditEventType +;AuthziInitializeAuditParams +;AuthziInitializeAuditParamsFromArray +;AuthziInitializeAuditParamsWithRM +;AuthziInitializeAuditQueue +;AuthziInitializeContextFromSid +;AuthziLogAuditEvent +;AuthziModifyAuditEvent2 +;AuthziModifyAuditEvent +;AuthziModifyAuditEventType +;AuthziModifyAuditQueue +;AuthziQueryAuditPolicy +;AuthziSetAuditPolicy +;AuthziSourceAudit + +; EOF Property changes on: trunk/reactos/lib/authz/authz.def ___________________________________________________________________ Name: svn:eol-style + native
19 years, 2 months
1
0
0
0
[weiden] 18177: - added stubs for authz.dll
by weiden@svn.reactos.com
- added stubs for authz.dll - added an authz.h to w32api Added: trunk/reactos/lib/authz/ Added: trunk/reactos/lib/authz/authz.c Added: trunk/reactos/lib/authz/authz.def Added: trunk/reactos/lib/authz/authz.rc Added: trunk/reactos/lib/authz/authz.xml Added: trunk/reactos/lib/authz/precomp.h Modified: trunk/reactos/lib/directory.xml Added: trunk/reactos/w32api/include/authz.h Property changes on: trunk/reactos/lib/authz ___________________________________________________________________ Name: svn:ignore + *.coff *.dll *.d *.a *.o *.sym *.map *.tmp *.gch GNUmakefile _____ Added: trunk/reactos/lib/authz/authz.c --- trunk/reactos/lib/authz/authz.c 2005-09-30 21:19:12 UTC (rev 18176) +++ trunk/reactos/lib/authz/authz.c 2005-09-30 21:28:29 UTC (rev 18177) @@ -0,0 +1,420 @@ +/* + * ReactOS Authorization Framework + * Copyright (C) 2005 ReactOS Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +/* $Id: aclui.c 18173 2005-09-30 18:54:48Z weiden $ + * + * PROJECT: ReactOS Authorization Framework + * FILE: lib/authz/authz.c + * PURPOSE: Authorization Framework + * PROGRAMMER: Thomas Weidenmueller <w3seek(a)reactos.com> + * + * UPDATE HISTORY: + * 09/30/2005 Created + */ +#include <precomp.h> + +HINSTANCE hDllInstance; + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzAccessCheck(IN DWORD flags, + IN AUTHZ_CLIENT_CONTEXT_HANDLE AuthzClientContext, + IN PAUTHZ_ACCESS_REQUEST pRequest, + IN AUTHZ_AUDIT_INFO_HANDLE AuditInfo, + IN PSECURITY_DESCRIPTOR pSecurityDescriptor, + IN PSECURITY_DESCRIPTOR* OptionalSecurityDescriptorArray, + IN DWORD OptionalSecurityDescriptorCount OPTIONAL, + IN OUT PAUTHZ_ACCESS_REPLY pReply, + OUT PAUTHZ_ACCESS_CHECK_RESULTS_HANDLE pAuthzHandle) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzAddSidsToContext(IN AUTHZ_CLIENT_CONTEXT_HANDLE OrigClientContext, + IN PSID_AND_ATTRIBUTES Sids, + IN DWORD SidCount, + IN PSID_AND_ATTRIBUTES RestrictedSids, + IN DWORD RestrictedSidCount, + OUT PAUTHZ_CLIENT_CONTEXT_HANDLE pNewClientContext) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzCachedAccessCheck(IN DWORD Flags, + IN AUTHZ_ACCESS_CHECK_RESULTS_HANDLE AuthzHandle, + IN PAUTHZ_ACCESS_REQUEST pRequest, + IN AUTHZ_AUDIT_EVENT_HANDLE AuditInfo, + OUT PAUTHZ_ACCESS_REPLY pReply) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzEnumerateSecurityEventSources(IN DWORD dwFlags, + OUT PAUTHZ_SOURCE_SCHEMA_REGISTRATION Buffer, + OUT PDWORD pdwCount, + IN OUT PDWORD pdwLength) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzFreeAuditEvent(IN AUTHZ_AUDIT_EVENT_HANDLE pAuditEventInfo) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzFreeContext(IN AUTHZ_CLIENT_CONTEXT_HANDLE AuthzClientContext) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzFreeHandle(IN AUTHZ_ACCESS_CHECK_RESULTS_HANDLE AuthzHandle) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzFreeResourceManager(IN AUTHZ_RESOURCE_MANAGER_HANDLE AuthzResourceManager) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzGetInformationFromContext(IN AUTHZ_CLIENT_CONTEXT_HANDLE hAuthzClientContext, + IN AUTHZ_CONTEXT_INFORMATION_CLASS InfoClass, + IN DWORD BufferSize, + OUT PDWORD pSizeRequired, + OUT PVOID Buffer) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzInitializeContextFromAuthzContext(IN DWORD flags, + IN AUTHZ_CLIENT_CONTEXT_HANDLE AuthzHandle, + IN PLARGE_INTEGER ExpirationTime, + IN LUID Identifier, + IN PVOID DynamicGroupArgs, + OUT PAUTHZ_CLIENT_CONTEXT_HANDLE phNewAuthzHandle) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzInitializeContextFromSid(IN DWORD Flags, + IN PSID UserSid, + IN AUTHZ_RESOURCE_MANAGER_HANDLE AuthzResourceManager, + IN PLARGE_INTEGER pExpirationTime, + IN LUID Identifier, + IN PVOID DynamicGroupArgs, + OUT PAUTHZ_CLIENT_CONTEXT_HANDLE pAuthzClientContext) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzInitializeContextFromToken(IN DWORD Flags, + IN HANDLE TokenHandle, + IN AUTHZ_RESOURCE_MANAGER_HANDLE AuthzResourceManager, + IN PLARGE_INTEGER pExpirationTime, + IN LUID Identifier, + IN PVOID DynamicGroupArgs, + OUT PAUTHZ_CLIENT_CONTEXT_HANDLE pAuthzClientContext) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzInitializeObjectAccessAuditEvent(IN DWORD Flags, + IN AUTHZ_AUDIT_EVENT_TYPE_HANDLE hAuditEventType, + IN PWSTR szOperationType, + IN PWSTR szObjectType, + IN PWSTR szObjectName, + IN PWSTR szAdditionalInfo, + OUT PAUTHZ_AUDIT_EVENT_HANDLE phAuditEvent, + IN DWORD dwAdditionalParamCount) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzInitializeObjectAccessAuditEvent2(IN DWORD Flags, + IN AUTHZ_AUDIT_EVENT_TYPE_HANDLE hAuditEventType, + IN PWSTR szOperationType, + IN PWSTR szObjectType, + IN PWSTR szObjectName, + IN PWSTR szAdditionalInfo, + IN PWSTR szAdditionalInfo2, + OUT PAUTHZ_AUDIT_EVENT_HANDLE phAuditEvent, + IN DWORD dwAdditionalParameterCount) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzInitializeResourceManager(IN DWORD flags, + IN PFN_AUTHZ_DYNAMIC_ACCESS_CHECK pfnAccessCheck, + IN PFN_AUTHZ_COMPUTE_DYNAMIC_GROUPS pfnComputeDynamicGroups, + IN PFN_AUTHZ_FREE_DYNAMIC_GROUPS pfnFreeDynamicGroups, + IN PCWSTR ResourceManagerName, + IN PAUTHZ_RESOURCE_MANAGER_HANDLE pAuthzResourceManager) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzInstallSecurityEventSource(IN DWORD dwFlags, + IN PAUTHZ_SOURCE_SCHEMA_REGISTRATION pRegistration) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzOpenObjectAudit(IN DWORD Flags, + IN AUTHZ_CLIENT_CONTEXT_HANDLE hAuthzClientContext, + IN PAUTHZ_ACCESS_REQUEST pRequest, + IN AUTHZ_AUDIT_EVENT_HANDLE hAuditEvent, + IN PSECURITY_DESCRIPTOR pSecurityDescriptor, + IN PSECURITY_DESCRIPTOR* SecurityDescriptorArray, + IN DWORD SecurityDescriptorCount, + OUT PAUTHZ_ACCESS_REPLY pReply) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzRegisterSecurityEventSource(IN DWORD dwFlags, + IN PCWSTR szEventSourceName, + IN PAUTHZ_SECURITY_EVENT_PROVIDER_HANDLE phEventProvider) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzReportSecurityEvent(IN DWORD dwFlags, + IN AUTHZ_SECURITY_EVENT_PROVIDER_HANDLE hEventProvider, + IN DWORD dwAuditId, + IN PSID pUserSid OPTIONAL, + IN DWORD dwCount, + ...) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzReportSecurityEventFromParams(IN DWORD dwFlags, + IN AUTHZ_SECURITY_EVENT_PROVIDER_HANDLE hEventProvider, + IN DWORD dwAuditId, + IN PSID pUserSid OPTIONAL, + IN PAUDIT_PARAMS pParams) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzUninstallSecurityEventSource(IN DWORD dwFlags, + IN PWSTR szEventSourceName) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +AUTHZAPI +BOOL +WINAPI +AuthzUnregisterSecurityEventSource(IN DWORD dwFlags, + IN OUT PAUTHZ_SECURITY_EVENT_PROVIDER_HANDLE phEventProvider) +{ + UNIMPLEMENTED; + return FALSE; +} + + +BOOL STDCALL +DllMain(IN HINSTANCE hinstDLL, + IN DWORD dwReason, + IN LPVOID lpvReserved) +{ + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + hDllInstance = hinstDLL; + break; + + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + Property changes on: trunk/reactos/lib/authz/authz.c ___________________________________________________________________ Name: svn:keywords + author date revision Name: svn:eol-style + native _____ Added: trunk/reactos/lib/authz/authz.def --- trunk/reactos/lib/authz/authz.def 2005-09-30 21:19:12 UTC (rev 18176) +++ trunk/reactos/lib/authz/authz.def 2005-09-30 21:28:29 UTC (rev 18177) @@ -0,0 +1,46 @@ +LIBRARY authz.dll + +EXPORTS +AuthzAccessCheck@36 +AuthzAddSidsToContext@24 +AuthzCachedAccessCheck@20 +AuthzEnumerateSecurityEventSources@16 +AuthzFreeAuditEvent@4 +AuthzFreeContext@4 +AuthzFreeHandle@4 +AuthzFreeResourceManager@4 +AuthzGetInformationFromContext@20 +AuthzInitializeContextFromAuthzContext@28 +AuthzInitializeContextFromSid@32 +AuthzInitializeContextFromToken@32 +AuthzInitializeObjectAccessAuditEvent@32 +AuthzInitializeObjectAccessAuditEvent2@36 +AuthzInitializeResourceManager@24 +AuthzInstallSecurityEventSource@8 +AuthzOpenObjectAudit@32 +AuthzRegisterSecurityEventSource@12 +AuthzReportSecurityEvent@20=AuthzReportSecurityEvent +AuthzReportSecurityEventFromParams@20 +AuthzUninstallSecurityEventSource@8 +AuthzUnregisterSecurityEventSource@8 +;AuthziAllocateAuditParams +;AuthziFreeAuditEventType +;AuthziFreeAuditParams +;AuthziFreeAuditQueue +;AuthziInitializeAuditEvent +;AuthziInitializeAuditEventType +;AuthziInitializeAuditParams +;AuthziInitializeAuditParamsFromArray +;AuthziInitializeAuditParamsWithRM +;AuthziInitializeAuditQueue +;AuthziInitializeContextFromSid +;AuthziLogAuditEvent +;AuthziModifyAuditEvent2 +;AuthziModifyAuditEvent +;AuthziModifyAuditEventType +;AuthziModifyAuditQueue +;AuthziQueryAuditPolicy +;AuthziSetAuditPolicy +;AuthziSourceAudit + +; EOF _____ Added: trunk/reactos/lib/authz/authz.rc --- trunk/reactos/lib/authz/authz.rc 2005-09-30 21:19:12 UTC (rev 18176) +++ trunk/reactos/lib/authz/authz.rc 2005-09-30 21:28:29 UTC (rev 18177) @@ -0,0 +1,10 @@ +#include <windows.h> +#include <reactos/resource.h> +#include "resource.h" + +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Authorization Framework\0" +#define REACTOS_STR_INTERNAL_NAME "authz\0" +#define REACTOS_STR_ORIGINAL_FILENAME "authz.dll\0" +#include <reactos/version.rc> + Property changes on: trunk/reactos/lib/authz/authz.rc ___________________________________________________________________ Name: svn:keywords + author date revision Name: svn:eol-style + native _____ Added: trunk/reactos/lib/authz/authz.xml --- trunk/reactos/lib/authz/authz.xml 2005-09-30 21:19:12 UTC (rev 18176) +++ trunk/reactos/lib/authz/authz.xml 2005-09-30 21:28:29 UTC (rev 18177) @@ -0,0 +1,16 @@ +<module name="authz" type="win32dll" baseaddress="${BASEADDRESS_AUTHZ}" installbase="system32" installname="authz.dll"> + <importlibrary definition="authz.def" /> + <include base="authz">.</include> + <define name="UNICODE" /> + <define name="_UNICODE" /> + <define name="__USE_W32API" /> + <define name="_WIN32_IE">0x0500</define> + <define name="_WIN32_WINNT">0x0600</define> + <define name="WINVER">0x0600</define> + <library>ntdll</library> + <library>kernel32</library> + <library>advapi32</library> + <file>authz.c</file> + <file>authz.rc</file> + <pch>precomp.h</pch> +</module> Property changes on: trunk/reactos/lib/authz/authz.xml ___________________________________________________________________ Name: svn:eol-style + native _____ Added: trunk/reactos/lib/authz/precomp.h --- trunk/reactos/lib/authz/precomp.h 2005-09-30 21:19:12 UTC (rev 18176) +++ trunk/reactos/lib/authz/precomp.h 2005-09-30 21:28:29 UTC (rev 18177) @@ -0,0 +1,15 @@ +#define _AUTHZ_ +#include <windows.h> +#include <authz.h> + +ULONG DbgPrint(PCH Format,...); +#ifndef DPRINT1 +#define DPRINT1 DbgPrint +#endif + +#ifndef UNIMPLEMENTED +#define UNIMPLEMENTED DbgPrint("AUTHZ.DLL: %s is UNIMPLEMENTED!\n", __FUNCTION__) +#endif + + +/* EOF */ Property changes on: trunk/reactos/lib/authz/precomp.h ___________________________________________________________________ Name: svn:keywords + author date revision Name: svn:eol-style + native _____ Modified: trunk/reactos/lib/directory.xml --- trunk/reactos/lib/directory.xml 2005-09-30 21:19:12 UTC (rev 18176) +++ trunk/reactos/lib/directory.xml 2005-09-30 21:28:29 UTC (rev 18177) @@ -14,6 +14,9 @@ <directory name="advpack"> <xi:include href="advpack/advpack.xml" /> </directory> +<directory name="authz"> + <xi:include href="authz/authz.xml" /> +</directory> <directory name="cabinet"> <xi:include href="cabinet/cabinet.xml" /> </directory> _____ Added: trunk/reactos/w32api/include/authz.h --- trunk/reactos/w32api/include/authz.h 2005-09-30 21:19:12 UTC (rev 18176) +++ trunk/reactos/w32api/include/authz.h 2005-09-30 21:28:29 UTC (rev 18177) @@ -0,0 +1,317 @@ +/* + * authz.h + * + * Authorization Framework + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ +#ifndef __AUTHZ_H +#define __AUTHZ_H + +#if !defined(_AUTHZ_) +#define AUTHZAPI DECLSPEC_IMPORT +#else +#define AUTHZAPI DECLSPEC_EXPORT +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define AUTHZ_ACCESS_CHECK_NO_DEEP_COPY_SD 0x1 + +#define AUTHZ_GENERATE_SUCCESS_AUDIT 0x1 +#define AUTHZ_GENERATE_FAILURE_AUDIT 0x2 + +#define AUTHZ_SKIP_TOKEN_GROUPS 0x2 +#define AUTHZ_REQUIRE_S4U_LOGON 0x4 + +#define AUTHZ_NO_SUCCESS_AUDIT 0x1 +#define AUTHZ_NO_FAILURE_AUDIT 0x2 +#define AUTHZ_NO_ALLOC_STRINGS 0x4 + +#define AUTHZ_RM_FLAG_NO_AUDIT 0x1 +#define AUTHZ_RM_FLAG_INITIALIZE_UNDER_IMPERSONATION 0x2 + +typedef HANDLE AUTHZ_CLIENT_CONTEXT_HANDLE, *PAUTHZ_CLIENT_CONTEXT_HANDLE; +typedef HANDLE AUTHZ_AUDIT_INFO_HANDLE, *PAUTHZ_AUDIT_INFO_HANDLE; +typedef HANDLE AUTHZ_AUDIT_EVENT_HANDLE, *PAUTHZ_AUDIT_EVENT_HANDLE; +typedef HANDLE AUTHZ_AUDIT_EVENT_TYPE_HANDLE, *PAUTHZ_AUDIT_EVENT_TYPE_HANDLE; +typedef HANDLE AUTHZ_ACCESS_CHECK_RESULTS_HANDLE, *PAUTHZ_ACCESS_CHECK_RESULTS_HANDLE; +typedef HANDLE AUTHZ_RESOURCE_MANAGER_HANDLE, *PAUTHZ_RESOURCE_MANAGER_HANDLE; +typedef HANDLE AUTHZ_SECURITY_EVENT_PROVIDER_HANDLE, *PAUTHZ_SECURITY_EVENT_PROVIDER_HANDLE; + +#if !defined(_ADTGEN_H) +/* FIXME - AUDIT_PARAMS is defined in adtgen.h!!!!! */ +typedef PVOID PAUDIT_PARAMS; +#endif + +typedef enum _AUTHZ_CONTEXT_INFORMATION_CLASS +{ + AuthzContextInfoUserSid = 1, + AuthzContextInfoGroupsSids, + AuthzContextInfoRestrictedSids, + AuthzContextInfoPrivileges, + AuthzContextInfoExpirationTime, + AuthzContextInfoServerContext, + AuthzContextInfoIdentifier, + AuthzContextInfoSource, + AuthzContextInfoAll, + AuthzContextInfoAuthenticationId +} AUTHZ_CONTEXT_INFORMATION_CLASS, *PAUTHZ_CONTEXT_INFORMATION_CLASS; + +typedef struct _AUTHZ_ACCESS_REQUEST +{ + ACCESS_MASK DesiredAccess; + PSID PrincipalSelfSid; + POBJECT_TYPE_LIST ObjectTypeList; + DWORD ObjectTypeListLength; + PVOID OptionalArguments; +} AUTHZ_ACCESS_REQUEST, *PAUTHZ_ACCESS_REQUEST; + +typedef struct _AUTHZ_ACCESS_REPLY +{ + DWORD ResultListLength; + PACCESS_MASK GrantedAccessMask; + PDWORD SaclEvaluationResults; + PDWORD Error;; +} AUTHZ_ACCESS_REPLY, *PAUTHZ_ACCESS_REPLY; + +typedef struct _AUTHZ_REGISTRATION_OBJECT_TYPE_NAME_OFFSET +{ + PWSTR szObjectTypeName; + DWORD dwOffset; +} AUTHZ_REGISTRATION_OBJECT_TYPE_NAME_OFFSET, *PAUTHZ_REGISTRATION_OBJECT_TYPE_NAME_OFFSET; + +typedef struct _AUTHZ_SOURCE_SCHEMA_REGISTRATION +{ + DWORD dwFlags; + PWSTR szEventSourceName; + PWSTR szEventMessageFile; + PWSTR szEventSourceXmlSchemaFile; + PWSTR szEventAccessStringsFile; + PWSTR szExecutableImagePath; + PVOID pReserved; + DWORD dwObjectTypeNameCount; + AUTHZ_REGISTRATION_OBJECT_TYPE_NAME_OFFSET ObjectTypeNames[ANYSIZE_ARRAY]; +} AUTHZ_SOURCE_SCHEMA_REGISTRATION, *PAUTHZ_SOURCE_SCHEMA_REGISTRATION; + +typedef BOOL (CALLBACK *PFN_AUTHZ_DYNAMIC_ACCESS_CHECK)(IN AUTHZ_CLIENT_CONTEXT_HANDLE hAuthzClientContext, + IN PACE_HEADER pAce, + IN PVOID pArgs OPTIONAL, + IN OUT PBOOL pbAceApplicable); + +typedef BOOL (CALLBACK *PFN_AUTHZ_COMPUTE_DYNAMIC_GROUPS)(IN AUTHZ_CLIENT_CONTEXT_HANDLE hAuthzClientContext, + IN PVOID Args, + OUT PSID_AND_ATTRIBUTES* pSidAttrArray, + OUT PDWORD pSidCount, + OUT PSID_AND_ATTRIBUTES* pRestrictedSidAttrArray, + OUT PDWORD pRestrictedSidCount); + +typedef VOID (CALLBACK *PFN_AUTHZ_FREE_DYNAMIC_GROUPS)(IN PSID_AND_ATTRIBUTES pSidAttrArray); + +AUTHZAPI +BOOL +WINAPI +AuthzAccessCheck(IN DWORD flags, + IN AUTHZ_CLIENT_CONTEXT_HANDLE AuthzClientContext, + IN PAUTHZ_ACCESS_REQUEST pRequest, + IN AUTHZ_AUDIT_INFO_HANDLE AuditInfo, + IN PSECURITY_DESCRIPTOR pSecurityDescriptor, + IN PSECURITY_DESCRIPTOR* OptionalSecurityDescriptorArray, + IN DWORD OptionalSecurityDescriptorCount OPTIONAL, + IN OUT PAUTHZ_ACCESS_REPLY pReply, + OUT PAUTHZ_ACCESS_CHECK_RESULTS_HANDLE pAuthzHandle); + +AUTHZAPI +BOOL +WINAPI +AuthzAddSidsToContext(IN AUTHZ_CLIENT_CONTEXT_HANDLE OrigClientContext, + IN PSID_AND_ATTRIBUTES Sids, + IN DWORD SidCount, + IN PSID_AND_ATTRIBUTES RestrictedSids, + IN DWORD RestrictedSidCount, + OUT PAUTHZ_CLIENT_CONTEXT_HANDLE pNewClientContext); + +AUTHZAPI +BOOL +WINAPI +AuthzCachedAccessCheck(IN DWORD Flags, + IN AUTHZ_ACCESS_CHECK_RESULTS_HANDLE AuthzHandle, + IN PAUTHZ_ACCESS_REQUEST pRequest, + IN AUTHZ_AUDIT_EVENT_HANDLE AuditInfo, + OUT PAUTHZ_ACCESS_REPLY pReply); + +AUTHZAPI +BOOL +WINAPI +AuthzEnumerateSecurityEventSources(IN DWORD dwFlags, + OUT PAUTHZ_SOURCE_SCHEMA_REGISTRATION Buffer, + OUT PDWORD pdwCount, + IN OUT PDWORD pdwLength); + +AUTHZAPI +BOOL +WINAPI +AuthzFreeAuditEvent(IN AUTHZ_AUDIT_EVENT_HANDLE pAuditEventInfo); + +AUTHZAPI +BOOL +WINAPI +AuthzFreeContext(IN AUTHZ_CLIENT_CONTEXT_HANDLE AuthzClientContext); + +AUTHZAPI +BOOL +WINAPI +AuthzFreeHandle(IN AUTHZ_ACCESS_CHECK_RESULTS_HANDLE AuthzHandle); + +AUTHZAPI +BOOL +WINAPI +AuthzFreeResourceManager(IN AUTHZ_RESOURCE_MANAGER_HANDLE AuthzResourceManager); + +AUTHZAPI +BOOL +WINAPI +AuthzGetInformationFromContext(IN AUTHZ_CLIENT_CONTEXT_HANDLE hAuthzClientContext, + IN AUTHZ_CONTEXT_INFORMATION_CLASS InfoClass, + IN DWORD BufferSize, + OUT PDWORD pSizeRequired, + OUT PVOID Buffer); + +AUTHZAPI +BOOL +WINAPI +AuthzInitializeContextFromAuthzContext(IN DWORD flags, + IN AUTHZ_CLIENT_CONTEXT_HANDLE AuthzHandle, + IN PLARGE_INTEGER ExpirationTime, + IN LUID Identifier, + IN PVOID DynamicGroupArgs, + OUT PAUTHZ_CLIENT_CONTEXT_HANDLE phNewAuthzHandle); + +AUTHZAPI +BOOL +WINAPI +AuthzInitializeContextFromSid(IN DWORD Flags, + IN PSID UserSid, + IN AUTHZ_RESOURCE_MANAGER_HANDLE AuthzResourceManager, + IN PLARGE_INTEGER pExpirationTime, + IN LUID Identifier, + IN PVOID DynamicGroupArgs, + OUT PAUTHZ_CLIENT_CONTEXT_HANDLE pAuthzClientContext); + +AUTHZAPI +BOOL +WINAPI +AuthzInitializeContextFromToken(IN DWORD Flags, + IN HANDLE TokenHandle, + IN AUTHZ_RESOURCE_MANAGER_HANDLE AuthzResourceManager, + IN PLARGE_INTEGER pExpirationTime, + IN LUID Identifier, + IN PVOID DynamicGroupArgs, + OUT PAUTHZ_CLIENT_CONTEXT_HANDLE pAuthzClientContext); + +AUTHZAPI +BOOL +WINAPI +AuthzInitializeObjectAccessAuditEvent(IN DWORD Flags, + IN AUTHZ_AUDIT_EVENT_TYPE_HANDLE hAuditEventType, + IN PWSTR szOperationType, + IN PWSTR szObjectType, + IN PWSTR szObjectName, + IN PWSTR szAdditionalInfo, + OUT PAUTHZ_AUDIT_EVENT_HANDLE phAuditEvent, + IN DWORD dwAdditionalParamCount); + +AUTHZAPI +BOOL +WINAPI +AuthzInitializeObjectAccessAuditEvent2(IN DWORD Flags, + IN AUTHZ_AUDIT_EVENT_TYPE_HANDLE hAuditEventType, + IN PWSTR szOperationType, + IN PWSTR szObjectType, + IN PWSTR szObjectName, + IN PWSTR szAdditionalInfo, + IN PWSTR szAdditionalInfo2, + OUT PAUTHZ_AUDIT_EVENT_HANDLE phAuditEvent, + IN DWORD dwAdditionalParameterCount); + +AUTHZAPI +BOOL +WINAPI +AuthzInitializeResourceManager(IN DWORD flags, + IN PFN_AUTHZ_DYNAMIC_ACCESS_CHECK pfnAccessCheck, + IN PFN_AUTHZ_COMPUTE_DYNAMIC_GROUPS pfnComputeDynamicGroups, + IN PFN_AUTHZ_FREE_DYNAMIC_GROUPS pfnFreeDynamicGroups, + IN PCWSTR ResourceManagerName, + IN PAUTHZ_RESOURCE_MANAGER_HANDLE pAuthzResourceManager); + +AUTHZAPI +BOOL +WINAPI +AuthzInstallSecurityEventSource(IN DWORD dwFlags, + IN PAUTHZ_SOURCE_SCHEMA_REGISTRATION pRegistration); + +AUTHZAPI +BOOL +WINAPI +AuthzOpenObjectAudit(IN DWORD Flags, + IN AUTHZ_CLIENT_CONTEXT_HANDLE hAuthzClientContext, + IN PAUTHZ_ACCESS_REQUEST pRequest, + IN AUTHZ_AUDIT_EVENT_HANDLE hAuditEvent, + IN PSECURITY_DESCRIPTOR pSecurityDescriptor, + IN PSECURITY_DESCRIPTOR* SecurityDescriptorArray, + IN DWORD SecurityDescriptorCount, + OUT PAUTHZ_ACCESS_REPLY pReply); + +AUTHZAPI +BOOL +WINAPI +AuthzRegisterSecurityEventSource(IN DWORD dwFlags, + IN PCWSTR szEventSourceName, + IN PAUTHZ_SECURITY_EVENT_PROVIDER_HANDLE phEventProvider); + +AUTHZAPI +BOOL +WINAPI +AuthzReportSecurityEvent(IN DWORD dwFlags, + IN AUTHZ_SECURITY_EVENT_PROVIDER_HANDLE hEventProvider, + IN DWORD dwAuditId, + IN PSID pUserSid OPTIONAL, + IN DWORD dwCount, + ...); + +AUTHZAPI +BOOL +WINAPI +AuthzReportSecurityEventFromParams(IN DWORD dwFlags, + IN AUTHZ_SECURITY_EVENT_PROVIDER_HANDLE hEventProvider, + IN DWORD dwAuditId, + IN PSID pUserSid OPTIONAL, + IN PAUDIT_PARAMS pParams); + +AUTHZAPI +BOOL +WINAPI +AuthzUninstallSecurityEventSource(IN DWORD dwFlags, + IN PWSTR szEventSourceName); + +AUTHZAPI +BOOL +WINAPI +AuthzUnregisterSecurityEventSource(IN DWORD dwFlags, + IN OUT PAUTHZ_SECURITY_EVENT_PROVIDER_HANDLE phEventProvider); + +#ifdef __cplusplus +} +#endif +#endif /* __AUTHZ_H */ Property changes on: trunk/reactos/w32api/include/authz.h ___________________________________________________________________ Name: svn:keywords + author date revision Name: svn:eol-style + native
19 years, 2 months
1
0
0
0
[weiden] 18176: set eol-style to native
by weiden@svn.reactos.com
set eol-style to native Modified: trunk/reactos/subsys/system/devmgr/devmgr.xml _____ Modified: trunk/reactos/subsys/system/devmgr/devmgr.xml --- trunk/reactos/subsys/system/devmgr/devmgr.xml 2005-09-30 20:26:16 UTC (rev 18175) +++ trunk/reactos/subsys/system/devmgr/devmgr.xml 2005-09-30 21:19:12 UTC (rev 18176) @@ -1,11 +1,11 @@ -<module name="devmgr" type="win32cui" installbase="system32" installname="devmgr.exe"> - <define name="__USE_W32API" /> - <library>ntdll</library> - <library>setupapi</library> - <library>gdi32</library> - <library>kernel32</library> - <library>user32</library> - <library>comctl32</library> - <file>devmgr.c</file> - <efile>devmgr.rc</efile> -</module> +<module name="devmgr" type="win32cui" installbase="system32" installname="devmgr.exe"> + <define name="__USE_W32API" /> + <library>ntdll</library> + <library>setupapi</library> + <library>gdi32</library> + <library>kernel32</library> + <library>user32</library> + <library>comctl32</library> + <file>devmgr.c</file> + <efile>devmgr.rc</efile> +</module> Property changes on: trunk/reactos/subsys/system/devmgr/devmgr.xml ___________________________________________________________________ Name: svn:eol-style + native
19 years, 2 months
1
0
0
0
[sedwards] 18175: simple device manager program by Hervé Poussineau (hpoussin@reactos.org)
by sedwards@svn.reactos.com
simple device manager program by Hervé Poussineau (hpoussin(a)reactos.org) * GUI: Michael Fritsch Added: trunk/reactos/subsys/system/devmgr/ Added: trunk/reactos/subsys/system/devmgr/devmgr.c Added: trunk/reactos/subsys/system/devmgr/devmgr.rc Added: trunk/reactos/subsys/system/devmgr/devmgr.xml Modified: trunk/reactos/subsys/system/directory.xml _____ Added: trunk/reactos/subsys/system/devmgr/devmgr.c --- trunk/reactos/subsys/system/devmgr/devmgr.c 2005-09-30 19:42:45 UTC (rev 18174) +++ trunk/reactos/subsys/system/devmgr/devmgr.c 2005-09-30 20:26:16 UTC (rev 18175) @@ -0,0 +1,717 @@ +/* Device manager + * (C) 2005 - HervÚ Poussineau (hpoussin(a)reactos.org) + * GUI: Michael Fritscher (michael(a)fritscher.net) + * + */ + +#define INITGUID +#include <windows.h> +#include <setupapi.h> +#include <stdio.h> +#include <tchar.h> +#include <commctrl.h> +#include <windows.h> +#include <commctrl.h> + + +/* FIXME: should be in cfgmgr32.h */ +typedef DWORD CONFIGRET; +typedef DWORD DEVINST, *PDEVINST; +#define CM_DRP_DEVICEDESC 0x00000001 +#define MAX_DEVICE_ID_LEN 200 +#define MAX_CLASS_NAME_LEN 32 +#define CR_SUCCESS 0x00000000 +#define CR_NO_SUCH_DEVINST 0x0000000D +#define CR_NO_SUCH_VALUE 0x00000025 +#ifdef _UNICODE +typedef WCHAR *DEVINSTID_W; +CONFIGRET WINAPI CM_Get_DevNode_Registry_PropertyW(DEVINST, ULONG, PULONG, PVOID, PULONG, ULONG); +CONFIGRET WINAPI CM_Locate_DevNodeW(PDEVINST, DEVINSTID_W, ULONG); +#define CM_Get_DevNode_Registry_Property CM_Get_DevNode_Registry_PropertyW +#define CM_Locate_DevNode CM_Locate_DevNodeW +#else +typedef CHAR *DEVINSTID_A; +CONFIGRET WINAPI CM_Get_DevNode_Registry_PropertyA(DEVINST, ULONG, PULONG, PVOID, PULONG, ULONG); +CONFIGRET WINAPI CM_Locate_DevNodeA(PDEVINST, DEVINSTID_A, ULONG); +#define CM_Get_DevNode_Registry_Property CM_Get_DevNode_Registry_PropertyA +#define CM_Locate_DevNode CM_Locate_DevNodeA +#endif +CONFIGRET WINAPI CM_Enumerate_Classes(ULONG, LPGUID, ULONG); +CONFIGRET WINAPI CM_Get_Child(PDEVINST, DEVINST, ULONG); +CONFIGRET WINAPI CM_Get_Sibling(PDEVINST, DEVINST, ULONG); +/* end of cfgmgr32.h */ + +/********************************************************************** **** + Function Prototypes +*********************************************************************** ***/ + +BOOL InitApplication(HINSTANCE); +BOOL InitInstance(HINSTANCE, int); +LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM); +void CreateListView(HINSTANCE, HWND); +void ResizeListView(HWND); +BOOL InitListView(); +void InsertIntoListView(int, LPTSTR, LPTSTR); + + +LRESULT ListViewNotify(HWND, LPARAM); +void SwitchView(HWND, DWORD); +BOOL DoContextMenu(HWND, WPARAM, LPARAM); +void UpdateMenu(HWND, HMENU); +BOOL InsertListViewItems(); +void PositionHeader(); + +void CreateButtons(); +void ListByClass(); + +/********************************************************************** **** + Global Variables +*********************************************************************** ***/ + +HINSTANCE g_hInst; +TCHAR g_szClassName[] = TEXT("VListVwClass"); +HWND hWnd; +HWND hwndListView; +HWND hwndButtonListByClass; +HWND hwndButtonListByConnection; +HWND hwndButtonListByInterface; +HWND hwndButtonExit; +TCHAR temp [255]; +HDC hDC; +TCHAR empty [255] = TEXT(" "); + +void ListByClass() +{ + GUID ClassGuid; + TCHAR ClassDescription[MAX_PATH]; + TCHAR ClassName[MAX_CLASS_NAME_LEN]; + TCHAR PropertyBuffer[256]; + HKEY KeyClass; + HDEVINFO hDevInfo; + SP_DEVINFO_DATA DeviceInfoData; + int i = 0, j; + long Size; + long rc; + + ListView_DeleteAllItems(hwndListView); + while (1) + { + CONFIGRET res; + res = CM_Enumerate_Classes(i, &ClassGuid, 0); + if (res == CR_NO_SUCH_VALUE) + break; + + i++; + ClassName[0] = '\0'; + if (!SetupDiClassNameFromGuid( + &ClassGuid, + ClassName, + sizeof(ClassName) / sizeof(ClassName[0]), + NULL)) + { + _tprintf(_T("SetupDiClassNameFromGuid() failed with status 0x%lx\n"), GetLastError()); + continue; + } + + /* Get class description */ + KeyClass = SetupDiOpenClassRegKey( + &ClassGuid, + KEY_READ); + if (KeyClass == INVALID_HANDLE_VALUE) + { + _tprintf(_T("SetupDiOpenClassRegKey() failed with status 0x%lx\n"), GetLastError()); + continue; + } + Size = sizeof(ClassDescription); + rc = RegQueryValue(KeyClass, NULL, ClassDescription, &Size); + if (rc == ERROR_SUCCESS) + { + InsertIntoListView(i,ClassDescription,ClassName); + TextOut(hDC, 200, 40, empty, strlen(empty)); + TextOut(hDC, 200, 40, ClassDescription, strlen(ClassDescription)); + _tprintf(_T("%d %s (%s)\n"), i, ClassName, ClassDescription); + } + else + _tprintf(_T("RegQueryValue() failed with status 0x%lx\n"), rc); + RegCloseKey(KeyClass); + + /* Enumerate devices in the class */ + hDevInfo = SetupDiGetClassDevs( + &ClassGuid, + NULL, /* Enumerator */ + NULL, /* hWnd parent */ + DIGCF_PRESENT); + if (hDevInfo == INVALID_HANDLE_VALUE) + continue; + + j = 0; + while (1) + { + DeviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA); + if (!SetupDiEnumDeviceInfo( + hDevInfo, + j, + &DeviceInfoData)) + { + break; + } + j++; + if (SetupDiGetDeviceRegistryProperty( + hDevInfo, + &DeviceInfoData, + SPDRP_DEVICEDESC, + NULL, /* Property reg data type */ + (PBYTE)PropertyBuffer, + sizeof(PropertyBuffer), + NULL) /* Required size */) + { + _tprintf(_T("- %s\n"), PropertyBuffer); + InsertIntoListView(0,PropertyBuffer," "); + } + else if (SetupDiGetDeviceRegistryProperty( + hDevInfo, + &DeviceInfoData, + SPDRP_PHYSICAL_DEVICE_OBJECT_NAME, + NULL, /* Property reg data type */ + (PBYTE)PropertyBuffer, + sizeof(PropertyBuffer), + NULL) /* Required size */) + { + _tprintf(_T("- %s\n"), PropertyBuffer); + InsertIntoListView(0,PropertyBuffer," "); + TextOut(hDC, 200, 40, empty, strlen(empty)); + TextOut(hDC, 200, 40, PropertyBuffer, strlen(PropertyBuffer)); + } + else + _tprintf(_T("SetupDiGetDeviceRegistryProperty() failed with status 0x%lx\n"), GetLastError()); + } + SetupDiDestroyDeviceInfoList(hDevInfo); + } +} + +CONFIGRET GetDeviceName(DEVINST DevInst, LPTSTR Buffer, DWORD BufferLength) +{ + ULONG BufferSize = BufferLength * sizeof(TCHAR); + CONFIGRET cr; + cr = CM_Get_DevNode_Registry_Property(DevInst, CM_DRP_DEVICEDESC, NULL, Buffer, &BufferSize, 0); + if (cr != CR_SUCCESS) + { + _tprintf(_T("CM_Get_DevNode_Registry_Property() failed, cr= 0x%lx\n"), cr); + } + return cr; +} + +CONFIGRET ListSubNodes(DEVINST parent, DWORD Level) +{ + CONFIGRET cr; + DEVINST child; + + cr = CM_Get_Child(&child, parent, 0); + if (cr == CR_NO_SUCH_DEVINST) + return CR_SUCCESS; + else if (cr != CR_SUCCESS) + { + _tprintf(_T("CM_Get_Child() failed, cr= 0x%lx\n"), cr); + return cr; + } + + do + { +#define DISPLAY_LENGTH (MAX_PATH + MAX_DEVICE_ID_LEN) + DWORD DisplayLength = DISPLAY_LENGTH; + TCHAR DisplayName[DISPLAY_LENGTH]; + ULONG i = Level; + TCHAR LevelSpaces [ 255 ]; + cr = GetDeviceName(child, DisplayName, DisplayLength); + LevelSpaces[0] = '\0'; + while (i-- != 0) + { + _tprintf(_T(" ")); + sprintf(LevelSpaces,"%s%s",LevelSpaces," "); + } + if (cr == CR_SUCCESS) + { + _tprintf(_T("%s\n"), DisplayName); + sprintf(temp,"%s%s",LevelSpaces,DisplayName); + InsertIntoListView(0,temp," "); + TextOut(hDC, 200, 40, empty, strlen(empty)); + TextOut(hDC, 200, 40, DisplayName, strlen(DisplayName)); + } + else + { + _tprintf(_T("(unknown device)\n")); + sprintf(temp,"%s%s",LevelSpaces,"(unknown device)"); + InsertIntoListView(0,temp," "); + TextOut(hDC, 200, 40, empty, strlen(empty)); + TextOut(hDC, 200, 40, "(unknown device)", strlen("(unknown device)")); + } + cr = ListSubNodes(child, Level + 1); + if (cr != CR_SUCCESS) + return cr; + cr = CM_Get_Sibling(&child, child, 0); + if (cr != CR_SUCCESS && cr != CR_NO_SUCH_DEVINST) + { + _tprintf(_T("CM_Get_Sibling() failed, cr= 0x%lx\n"), cr); + return cr; + } + } while (cr == CR_SUCCESS); + return CR_SUCCESS; +} + +int ListByConnection() +{ + CONFIGRET cr; + DEVINST root; + ListView_DeleteAllItems(hwndListView); + + cr = CM_Locate_DevNode(&root, NULL, 0); + + if (cr != CR_SUCCESS) + { + _tprintf(_T("CM_Locate_DevNode() failed, cr= 0x%lx\n"), cr); + return 1; + } + + cr = ListSubNodes(root, 0); + if (cr != CR_SUCCESS) + return 2; + return 0; +} + +int ListByInterface(const GUID* guid) +{ + HDEVINFO hDevInfo; + CHAR Buffer[sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA) + 0x100]; + PSP_DEVICE_INTERFACE_DETAIL_DATA DeviceInterfaceDetailData; + DWORD i; + SP_DEVICE_INTERFACE_DATA DeviceInterfaceData; + + ListView_DeleteAllItems(hwndListView); + + DeviceInterfaceDetailData = (PSP_DEVICE_INTERFACE_DETAIL_DATA)Buffer; + DeviceInterfaceDetailData->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA); + + hDevInfo = SetupDiGetClassDevs( + guid, + NULL, /* Enumerator */ + NULL, /* hwndParent */ + DIGCF_DEVICEINTERFACE); + if (hDevInfo == INVALID_HANDLE_VALUE) + { + printf("SetupDiGetClassDevs() failed with status 0x%lx\n", GetLastError()); + return 1; + } + + i = 0; + DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); + while (TRUE) + { + if (!SetupDiEnumDeviceInterfaces( + hDevInfo, + NULL, + guid, + i, + &DeviceInterfaceData)) + { + if (GetLastError() != ERROR_NO_MORE_ITEMS) + printf("SetupDiEnumDeviceInterfaces() failed with status 0x%lx\n", GetLastError()); + break; + } + i++; + if (SetupDiGetDeviceInterfaceDetail(hDevInfo, &DeviceInterfaceData, DeviceInterfaceDetailData, sizeof(Buffer), NULL, NULL)) + { + _tprintf(_T("- device %-2ld: %s\n"), i, DeviceInterfaceDetailData->DevicePath); + TextOut(hDC, 200, 40, empty, strlen(empty)); + TextOut(hDC, 200, 40, DeviceInterfaceDetailData->DevicePath, strlen(DeviceInterfaceDetailData->DevicePath)); + InsertIntoListView(i,DeviceInterfaceDetailData->DevicePath," "); + } + else + { + _tprintf(_T("- device %ld\n"), i); + InsertIntoListView(i," "," "); + } + + } + SetupDiDestroyDeviceInfoList(hDevInfo); + return 0; +} + +DEFINE_GUID(GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR, + 0x4D36E978L, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); + +/*int main(void) +{ + ListByClass(); + ListByInterface(&GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR); + ListByConnection(); + return 0; +}*/ + + + +//GUI +int WINAPI WinMain( HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPSTR lpCmdLine, + int nCmdShow) +{ +MSG msg; + +g_hInst = hInstance; + +if(!hPrevInstance) + if(!InitApplication(hInstance)) + return FALSE; + +//required to use the common controls +InitCommonControls(); + +/* Perform initializations that apply to a specific instance */ + +if (!InitInstance(hInstance, nCmdShow)) + return FALSE; + +/* Acquire and dispatch messages until a WM_QUIT uMessage is received. */ + +while(GetMessage( &msg, NULL, 0x00, 0x00)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + +return (int)msg.wParam; +} + +BOOL InitApplication(HINSTANCE hInstance) +{ +WNDCLASSEX wcex; +ATOM aReturn; + +wcex.cbSize = sizeof(WNDCLASSEX); +wcex.style = 0; +wcex.lpfnWndProc = (WNDPROC)MainWndProc; +wcex.cbClsExtra = 0; +wcex.cbWndExtra = 0; +wcex.hInstance = hInstance; +wcex.hCursor = LoadCursor(NULL, IDC_ARROW); +wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW ); +wcex.lpszMenuName = 0; +wcex.lpszClassName = g_szClassName; +wcex.hIcon = 0; +wcex.hIconSm = 0; + +aReturn = RegisterClassEx(&wcex); + +if(0 == aReturn) + { + WNDCLASS wc; + + wc.style = 0; + wc.lpfnWndProc = (WNDPROC)MainWndProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = hInstance; + wc.hIcon = 0; + wc.hCursor = 0; + wc.hbrBackground = (HBRUSH)(COLOR_WINDOW); + wc.lpszMenuName = 0; + wc.lpszClassName = g_szClassName; + + aReturn = RegisterClass(&wc); + } + +return aReturn; +} + +BOOL InitInstance( HINSTANCE hInstance, + int nCmdShow) +{ +HWND hWnd; +TCHAR szTitle[MAX_PATH] = TEXT("Device viewer"); + +g_hInst = hInstance; + +/* Create a main window for this application instance. */ +hWnd = CreateWindowEx( 0, + g_szClassName, + szTitle, + WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + NULL, + NULL, + hInstance, + NULL); + +/* If window could not be created, return "failure" */ + +if (!hWnd) + return FALSE; + +/* Make the window visible; update its client area; and return "success" */ + +ShowWindow(hWnd, nCmdShow); +UpdateWindow(hWnd); +hDC = GetDC(hWnd); +return TRUE; + +} + +LRESULT CALLBACK MainWndProc( HWND hWnd, + UINT uMessage, + WPARAM wParam, + LPARAM lParam) +{ + + +switch (uMessage) + { + case WM_CREATE: + // create the TreeView control + CreateListView(g_hInst, hWnd); + + //initialize the TreeView control + InitListView(); + + CreateButtons(g_hInst, hWnd); + TextOut(hDC, 200, 40, empty, strlen(empty)); + break; + + + case WM_SIZE: + ResizeListView(hWnd); + break; + case WM_DESTROY: + PostQuitMessage(0); + break; + case WM_COMMAND: + if (HIWORD(wParam) == BN_CLICKED && + (HWND) lParam == hwndButtonListByClass) + { + ListByClass(); + } + if (HIWORD(wParam) == BN_CLICKED && + (HWND) lParam == hwndButtonListByConnection) + { + ListByConnection(); + } + if (HIWORD(wParam) == BN_CLICKED && + (HWND) lParam == hwndButtonListByInterface) + { + ListByInterface(&GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR); + } + if (HIWORD(wParam) == BN_CLICKED && + (HWND) lParam == hwndButtonExit) + { + /* Close the window. */ + DestroyWindow (hWnd); + } return 0; + break; + default: + break; + } +return DefWindowProc(hWnd, uMessage, wParam, lParam); +} + +void CreateListView(HINSTANCE hInstance, HWND hwndParent) +{ +DWORD dwStyle; + +dwStyle = WS_TABSTOP | + WS_CHILD | + WS_BORDER | + WS_VISIBLE | + LVS_AUTOARRANGE | + LVS_REPORT ;//| + //LVS_OWNERDATA; + +hwndListView = CreateWindowEx( WS_EX_CLIENTEDGE, // ex style + WC_LISTVIEW, // class name - defined in commctrl.h + TEXT(""), // dummy text + dwStyle, // style + 0, // x position + 0, // y position + 0, // width + 0, // height + hwndParent, // parent + 0,//(HMENU)ID_LISTVIEW, // ID + g_hInst, // instance + NULL); // no extra data + + +ResizeListView(hwndParent); +} + +void ResizeListView(HWND hwndParent) +{ +RECT rc; + +GetClientRect(hwndParent, &rc); + +MoveWindow( hwndListView, + rc.left, + rc.top+60, + rc.right - rc.left, + rc.bottom - rc.top-60, + TRUE); +} + +void PositionHeader() +{ +HWND hwndHeader = GetWindow(hwndListView, GW_CHILD); +DWORD dwStyle = GetWindowLong(hwndListView, GWL_STYLE); + +/*To ensure that the first item will be visible, create the control without +the LVS_NOSCROLL style and then add it here*/ +dwStyle |= LVS_NOSCROLL; +SetWindowLong(hwndListView, GWL_STYLE, dwStyle); + +//only do this if we are in report view and were able to get the header hWnd +if(((dwStyle & LVS_TYPEMASK) == LVS_REPORT) && hwndHeader) + { + RECT rc; + HD_LAYOUT hdLayout; + WINDOWPOS wpos; + + GetClientRect(hwndListView, &rc); + hdLayout.prc = &rc; + hdLayout.pwpos = &wpos; + + Header_Layout(hwndHeader, &hdLayout); + + SetWindowPos( hwndHeader, + wpos.hwndInsertAfter, + wpos.x, + wpos.y, + wpos.cx, + wpos.cy, + wpos.flags | SWP_SHOWWINDOW); + + ListView_EnsureVisible(hwndListView, 0, FALSE); + } +} + +BOOL InitListView() +{ +LV_COLUMN lvColumn; +int i; +TCHAR szString[3][20] = {TEXT("#"), TEXT("Name"), TEXT("Intern name")}; + +//empty the list +ListView_DeleteAllItems(hwndListView); + +//initialize the columns +lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; +lvColumn.fmt = LVCFMT_LEFT; +i=0; +lvColumn.cx = 20; +lvColumn.pszText = szString[i]; +ListView_InsertColumn(hwndListView, i, &lvColumn); +i=1; +lvColumn.cx = 400; +lvColumn.pszText = szString[i]; +ListView_InsertColumn(hwndListView, i, &lvColumn); +i=2; +lvColumn.cx = 150; +lvColumn.pszText = szString[i]; +ListView_InsertColumn(hwndListView, i, &lvColumn); + + +return TRUE; +} + +typedef struct tagLINE_INFO +{ + DWORD dwValType; + LPTSTR name; + void* val; + size_t val_len; +} LINE_INFO, *PLINE_INFO; + +void InsertIntoListView(int typ, LPTSTR name, LPTSTR intern_name) +{ + //MessageBox(hWnd, "You just pressed Ctrl+a", "Hotkey", MB_OK | MB_ICONINFORMATION); + TCHAR temp[ 255 ]; + //LINE_INFO* linfo; + LVITEM item; + int index; + //linfo->name = Name; + item.mask = LVIF_TEXT; + item.iItem = 9999; + item.iSubItem = 0; + item.state = 0; + //item.statemask = 0; + item.pszText=malloc(10); + if (typ>=1) + { + sprintf(temp,"%i",typ); + item.pszText = temp; + } + else + item.pszText = ""; + item.cchTextMax = _tcslen(item.pszText); + if (item.cchTextMax == 0) + item.pszText = LPSTR_TEXTCALLBACK; + item.iImage = 0; + //item.iIdent = 0; + //item.iGroupId = 0; + //item.cColumns = 0 ; + //item.puColumns = 0; + //item.lParam = (LPARAM)linfo; + index = ListView_InsertItem(hwndListView, &item); + ListView_SetItemText(hwndListView, index, 1, name); + ListView_SetItemText(hwndListView, index, 2, intern_name); +} + + + +void CreateButtons(HINSTANCE hInstance, HWND hwndParent) +{ + + hwndButtonListByClass = CreateWindowEx ( + 0, + "button", /* Builtin button class */ + "List by Class", + WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, + 0, 0, 190, 30, + hwndParent, /* Parent is this window. */ + 0, /* Control ID: 1 */ + g_hInst, + NULL + ); + hwndButtonListByConnection = CreateWindowEx ( + 0, + "button", /* Builtin button class */ + "List by Connection", + WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, + 200, 0, 190, 30, + hwndParent, /* Parent is this window. */ + 0, /* Control ID: 1 */ + g_hInst, + NULL + ); + hwndButtonListByInterface = CreateWindowEx ( + 0, + "button", /* Builtin button class */ + "List by Interface", + WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, + 400, 0, 190, 30, + hwndParent, /* Parent is this window. */ + 0, /* Control ID: 1 */ + g_hInst, + NULL + ); + hwndButtonExit = CreateWindowEx ( + 0, + "button", /* Builtin button class */ + "Exit", + WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, + 0, 30, 190, 30, + hwndParent, /* Parent is this window. */ + 0, /* Control ID: 1 */ + g_hInst, + NULL + ); +} Property changes on: trunk/reactos/subsys/system/devmgr/devmgr.c ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native _____ Added: trunk/reactos/subsys/system/devmgr/devmgr.rc --- trunk/reactos/subsys/system/devmgr/devmgr.rc 2005-09-30 19:42:45 UTC (rev 18174) +++ trunk/reactos/subsys/system/devmgr/devmgr.rc 2005-09-30 20:26:16 UTC (rev 18175) @@ -0,0 +1,6 @@ +/* $Id$ */ + +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS W32 Device Manager Utility\0" +#define REACTOS_STR_INTERNAL_NAME "devmgr\0" +#define REACTOS_STR_ORIGINAL_FILENAME "devmgr.exe\0" +#include <reactos/version.rc> Property changes on: trunk/reactos/subsys/system/devmgr/devmgr.rc ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native _____ Added: trunk/reactos/subsys/system/devmgr/devmgr.xml --- trunk/reactos/subsys/system/devmgr/devmgr.xml 2005-09-30 19:42:45 UTC (rev 18174) +++ trunk/reactos/subsys/system/devmgr/devmgr.xml 2005-09-30 20:26:16 UTC (rev 18175) @@ -0,0 +1,11 @@ +<module name="devmgr" type="win32cui" installbase="system32" installname="devmgr.exe"> + <define name="__USE_W32API" /> + <library>ntdll</library> + <library>setupapi</library> + <library>gdi32</library> + <library>kernel32</library> + <library>user32</library> + <library>comctl32</library> + <file>devmgr.c</file> + <efile>devmgr.rc</efile> +</module> _____ Modified: trunk/reactos/subsys/system/directory.xml --- trunk/reactos/subsys/system/directory.xml 2005-09-30 19:42:45 UTC (rev 18174) +++ trunk/reactos/subsys/system/directory.xml 2005-09-30 20:26:16 UTC (rev 18175) @@ -7,6 +7,9 @@ <directory name="cmd"> <xi:include href="cmd/cmd.xml" /> </directory> +<directory name="devmgr"> + <xi:include href="devmgr/devmgr.xml" /> +</directory> <directory name="dhcp"> <xi:include href="dhcp/dhcp.xml" /> </directory>
19 years, 2 months
1
0
0
0
[mf] 18174: patch applied from Christoph at ApiViewer.de: fix font handle leak
by mf@svn.reactos.com
patch applied from Christoph at ApiViewer.de: fix font handle leak Modified: trunk/reactos/subsys/system/winefile/winefile.c _____ Modified: trunk/reactos/subsys/system/winefile/winefile.c --- trunk/reactos/subsys/system/winefile/winefile.c 2005-09-30 18:54:48 UTC (rev 18173) +++ trunk/reactos/subsys/system/winefile/winefile.c 2005-09-30 19:42:45 UTC (rev 18174) @@ -2247,9 +2247,11 @@ if (ChooseFont(&chFont)) { HWND childWnd; + HFONT hFontOld; + DeleteObject(Globals.hfont); Globals.hfont = CreateFontIndirect(&lFont); - SelectFont(hdc, Globals.hfont); + hFontOld = SelectFont(hdc, Globals.hfont); GetTextExtentPoint32(hdc, sSpace, 1, &Globals.spaceSize); /* change font in all open child windows */ @@ -2262,6 +2264,8 @@ InvalidateRect(child->left.hwnd, NULL, TRUE); InvalidateRect(child->right.hwnd, NULL, TRUE); } + + SelectFont(hdc, hFontOld); } else if (CommDlgExtendedError()) { LoadString(Globals.hInstance, IDS_FONT_SEL_DLG_NAME, dlg_name, BUFFER_LEN); @@ -4774,6 +4778,7 @@ CoUninitialize(); #endif + DeleteObject(Globals.hfont); ImageList_Destroy(Globals.himl); }
19 years, 2 months
1
0
0
0
[weiden] 18173: - improved control resizing handling
by weiden@svn.reactos.com
- improved control resizing handling - don't fail when querying the account name length Modified: trunk/reactos/lib/aclui/aclui.c Modified: trunk/reactos/lib/aclui/misc.c _____ Modified: trunk/reactos/lib/aclui/aclui.c --- trunk/reactos/lib/aclui/aclui.c 2005-09-30 18:48:14 UTC (rev 18172) +++ trunk/reactos/lib/aclui/aclui.c 2005-09-30 18:54:48 UTC (rev 18173) @@ -115,7 +115,8 @@ &SidNameUse)) { LookupResult = GetLastError(); - if (LookupResult != ERROR_NONE_MAPPED) + if (LookupResult != ERROR_NONE_MAPPED && + LookupResult != ERROR_INSUFFICIENT_BUFFER) { return FALSE; } @@ -375,7 +376,9 @@ li.iSubItem = 0; li.state = (Selected ? LVIS_SELECTED : 0); li.stateMask = LVIS_SELECTED; - li.pszText = (PrincipalListItem->DisplayString != NULL ? PrincipalListItem->DisplayString : PrincipalListItem->AccountName); + li.pszText = (PrincipalListItem->DisplayString != NULL ? + PrincipalListItem->DisplayString : + PrincipalListItem->AccountName); switch (PrincipalListItem->SidNameUse) { @@ -632,192 +635,192 @@ nControls += 2; } - if (!(dwp = BeginDeferWindowPos(nControls))) + if ((dwp = BeginDeferWindowPos(nControls))) { - return; - } - - /* resize the Principal list view */ - GetWindowRect(sp->hWndPrincipalsList, - &rcControl); - if (!(dwp = DeferWindowPos(dwp, - sp->hWndPrincipalsList, - NULL, - 0, - 0, - cxWidth, - rcControl.bottom - rcControl.top, - SWP_NOMOVE | SWP_NOZORDER))) - { - return; - } - - /* move the Add Principal button */ - GetWindowRect(sp->hBtnAdd, - &rcControl); - GetWindowRect(sp->hBtnRemove, - &rcControl2); - btnSpacing = rcControl2.left - rcControl.right; - pt2.x = 0; - pt2.y = 0; - MapWindowPoints(sp->hBtnAdd, - sp->hWnd, - &pt2, - 1); - if (!(dwp = DeferWindowPos(dwp, - sp->hBtnAdd, - NULL, - pt.x + cxWidth - (rcControl2.right - rcControl2.left) - - (rcControl.right - rcControl.left) - - btnSpacing - cxEdge, - pt2.y, - 0, - 0, - SWP_NOSIZE | SWP_NOZORDER))) - { - return; - } - - /* move the Delete Principal button */ - pt2.x = 0; - pt2.y = 0; - MapWindowPoints(sp->hBtnRemove, - sp->hWnd, - &pt2, - 1); - if (!(dwp = DeferWindowPos(dwp, - sp->hBtnRemove, - NULL, - pt.x + cxWidth - (rcControl2.right - rcControl2.left) - cxEdge, - pt2.y, - 0, - 0, - SWP_NOSIZE | SWP_NOZORDER))) - { - return; - } - - /* move the Permissions For label */ - GetWindowRect(hWndAllow, - &rcControl); - GetWindowRect(hWndDeny, - &rcControl2); - GetWindowRect(sp->hPermissionsForLabel, - &rcControl3); - pt2.x = 0; - pt2.y = 0; - MapWindowPoints(sp->hPermissionsForLabel, - sp->hWnd, - &pt2, - 1); - if (!(dwp = DeferWindowPos(dwp, - sp->hPermissionsForLabel, - NULL, - 0, - 0, - cxWidth - (rcControl2.right - rcControl2.left) - - (rcControl.right - rcControl.left) - - (2 * btnSpacing) - cxEdge, - rcControl3.bottom - rcControl3.top, - SWP_NOMOVE | SWP_NOZORDER))) - { - return; - } - - /* move the Allow label */ - pt2.x = 0; - pt2.y = 0; - MapWindowPoints(hWndAllow, - sp->hWnd, - &pt2, - 1); - if (!(dwp = DeferWindowPos(dwp, - hWndAllow, - NULL, - cxWidth - (rcControl2.right - rcControl2.left) - - (rcControl.right - rcControl.left) - - btnSpacing - cxEdge, - pt2.y, - 0, - 0, - SWP_NOSIZE | SWP_NOZORDER))) - { - return; - } - - /* move the Deny label */ - pt2.x = 0; - pt2.y = 0; - MapWindowPoints(hWndDeny, - sp->hWnd, - &pt2, - 1); - if (!(dwp = DeferWindowPos(dwp, - hWndDeny, - NULL, - cxWidth - (rcControl2.right - rcControl2.left) - cxEdge, - pt2.y, - 0, - 0, - SWP_NOSIZE | SWP_NOZORDER))) - { - return; - } - - /* resize the Permissions check list box */ - GetWindowRect(sp->hAceCheckList, - &rcControl); - GetWindowRect(sp->hBtnAdvanced, - &rcControl2); - GetWindowRect(GetDlgItem(sp->hWnd, - IDC_LABEL_ADVANCED), - &rcControl3); - if (!(dwp = DeferWindowPos(dwp, - sp->hAceCheckList, - NULL, - 0, - 0, - cxWidth, - ((sp->ObjectInfo.dwFlags & SI_ADVANCED) ? - Height - (rcControl.top - rcWnd.top) - (rcControl3.bottom - rcControl3.top) - pt.x - btnSpacing : - Height - (rcControl.top - rcWnd.top) - pt.x), - SWP_NOMOVE | SWP_NOZORDER))) - { - return; - } - - if (sp->ObjectInfo.dwFlags & SI_ADVANCED) - { - /* move and resize the Advanced label */ + /* resize the Principal list view */ + GetWindowRect(sp->hWndPrincipalsList, + &rcControl); if (!(dwp = DeferWindowPos(dwp, - GetDlgItem(sp->hWnd, - IDC_LABEL_ADVANCED), + sp->hWndPrincipalsList, NULL, - pt.x, - Height - (rcControl3.bottom - rcControl3.top) - pt.x, - cxWidth - (rcControl2.right - rcControl2.left) - cxEdge, + 0, + 0, + cxWidth, + rcControl.bottom - rcControl.top, + SWP_NOMOVE | SWP_NOZORDER))) + { + goto EndDeferWnds; + } + + /* move the Add Principal button */ + GetWindowRect(sp->hBtnAdd, + &rcControl); + GetWindowRect(sp->hBtnRemove, + &rcControl2); + btnSpacing = rcControl2.left - rcControl.right; + pt2.x = 0; + pt2.y = 0; + MapWindowPoints(sp->hBtnAdd, + sp->hWnd, + &pt2, + 1); + if (!(dwp = DeferWindowPos(dwp, + sp->hBtnAdd, + NULL, + pt.x + cxWidth - (rcControl2.right - rcControl2.left) - + (rcControl.right - rcControl.left) - + btnSpacing - cxEdge, + pt2.y, + 0, + 0, + SWP_NOSIZE | SWP_NOZORDER))) + { + goto EndDeferWnds; + } + + /* move the Delete Principal button */ + pt2.x = 0; + pt2.y = 0; + MapWindowPoints(sp->hBtnRemove, + sp->hWnd, + &pt2, + 1); + if (!(dwp = DeferWindowPos(dwp, + sp->hBtnRemove, + NULL, + pt.x + cxWidth - (rcControl2.right - rcControl2.left) - cxEdge, + pt2.y, + 0, + 0, + SWP_NOSIZE | SWP_NOZORDER))) + { + goto EndDeferWnds; + } + + /* move the Permissions For label */ + GetWindowRect(hWndAllow, + &rcControl); + GetWindowRect(hWndDeny, + &rcControl2); + GetWindowRect(sp->hPermissionsForLabel, + &rcControl3); + pt2.x = 0; + pt2.y = 0; + MapWindowPoints(sp->hPermissionsForLabel, + sp->hWnd, + &pt2, + 1); + if (!(dwp = DeferWindowPos(dwp, + sp->hPermissionsForLabel, + NULL, + 0, + 0, + cxWidth - (rcControl2.right - rcControl2.left) - + (rcControl.right - rcControl.left) - + (2 * btnSpacing) - cxEdge, rcControl3.bottom - rcControl3.top, - SWP_NOZORDER))) + SWP_NOMOVE | SWP_NOZORDER))) { - return; + goto EndDeferWnds; } - - /* move and resize the Advanced button */ + + /* move the Allow label */ + pt2.x = 0; + pt2.y = 0; + MapWindowPoints(hWndAllow, + sp->hWnd, + &pt2, + 1); if (!(dwp = DeferWindowPos(dwp, - sp->hBtnAdvanced, + hWndAllow, NULL, - cxWidth - (rcControl2.right - rcControl2.left) + pt.x, - Height - (rcControl2.bottom - rcControl2.top) - pt.x, + cxWidth - (rcControl2.right - rcControl2.left) - + (rcControl.right - rcControl.left) - + btnSpacing - cxEdge, + pt2.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER))) { - return; + goto EndDeferWnds; } + + /* move the Deny label */ + pt2.x = 0; + pt2.y = 0; + MapWindowPoints(hWndDeny, + sp->hWnd, + &pt2, + 1); + if (!(dwp = DeferWindowPos(dwp, + hWndDeny, + NULL, + cxWidth - (rcControl2.right - rcControl2.left) - cxEdge, + pt2.y, + 0, + 0, + SWP_NOSIZE | SWP_NOZORDER))) + { + goto EndDeferWnds; + } + + /* resize the Permissions check list box */ + GetWindowRect(sp->hAceCheckList, + &rcControl); + GetWindowRect(sp->hBtnAdvanced, + &rcControl2); + GetWindowRect(GetDlgItem(sp->hWnd, + IDC_LABEL_ADVANCED), + &rcControl3); + if (!(dwp = DeferWindowPos(dwp, + sp->hAceCheckList, + NULL, + 0, + 0, + cxWidth, + ((sp->ObjectInfo.dwFlags & SI_ADVANCED) ? + Height - (rcControl.top - rcWnd.top) - + (rcControl3.bottom - rcControl3.top) - pt.x - btnSpacing : + Height - (rcControl.top - rcWnd.top) - pt.x), + SWP_NOMOVE | SWP_NOZORDER))) + { + goto EndDeferWnds; + } + + if (sp->ObjectInfo.dwFlags & SI_ADVANCED) + { + /* move and resize the Advanced label */ + if (!(dwp = DeferWindowPos(dwp, + GetDlgItem(sp->hWnd, + IDC_LABEL_ADVANCED), + NULL, + pt.x, + Height - (rcControl3.bottom - rcControl3.top) - pt.x, + cxWidth - (rcControl2.right - rcControl2.left) - cxEdge, + rcControl3.bottom - rcControl3.top, + SWP_NOZORDER))) + { + goto EndDeferWnds; + } + + /* move and resize the Advanced button */ + if (!(dwp = DeferWindowPos(dwp, + sp->hBtnAdvanced, + NULL, + cxWidth - (rcControl2.right - rcControl2.left) + pt.x, + Height - (rcControl2.bottom - rcControl2.top) - pt.x, + 0, + 0, + SWP_NOSIZE | SWP_NOZORDER))) + { + goto EndDeferWnds; + } + } + + EndDeferWindowPos(dwp); } - - EndDeferWindowPos(dwp); - + +EndDeferWnds: /* update the width of the principal list view column */ GetClientRect(sp->hWndPrincipalsList, &rcControl); _____ Modified: trunk/reactos/lib/aclui/misc.c --- trunk/reactos/lib/aclui/misc.c 2005-09-30 18:48:14 UTC (rev 18172) +++ trunk/reactos/lib/aclui/misc.c 2005-09-30 18:54:48 UTC (rev 18173) @@ -233,7 +233,7 @@ sizeof(DSOP_SCOPE_INIT_INFO), DSOP_SCOPE_TYPE_TARGET_COMPUTER, DSOP_SCOPE_FLAG_DEFAULT_FILTER_USERS | DSOP_SCOPE_FLAG_DEFAULT_FILTER_GROUPS | - DSOP_SCOPE_FLAG_STARTING_SCOPE, + DSOP_SCOPE_FLAG_STARTING_SCOPE, { { 0, @@ -241,7 +241,7 @@ 0 }, DSOP_DOWNLEVEL_FILTER_USERS | DSOP_DOWNLEVEL_FILTER_LOCAL_GROUPS | - DSOP_DOWNLEVEL_FILTER_GLOBAL_GROUPS | DSOP_DOWNLEVEL_FILTER_ALL_WELLKNOWN_SIDS + DSOP_DOWNLEVEL_FILTER_GLOBAL_GROUPS | DSOP_DOWNLEVEL_FILTER_ALL_WELLKNOWN_SIDS }, NULL, NULL, @@ -304,7 +304,7 @@ fe.dwAspect = DVASPECT_CONTENT; fe.lindex = -1; fe.tymed = TYMED_HGLOBAL; - + hRet = pdo->lpVtbl->GetData(pdo, &fe, &stm); @@ -317,11 +317,11 @@ PSID pSid; UINT i; BOOL contLoop = TRUE; - + for (i = 0; i < SelectionList->cItems && contLoop; i++) { vSid = SelectionList->aDsSelection[i].pvarFetchedAttributes; - + if (vSid != NULL && V_VT(vSid) == (VT_ARRAY | VT_UI1)) { hRet = SafeArrayAccessData(V_ARRAY(vSid), @@ -330,7 +330,7 @@ { break; } - + if (pSid != NULL) { contLoop = SelectedSidCallback(pDsObjectPicker, @@ -338,14 +338,14 @@ pSid, Context); } - + SafeArrayUnaccessData(V_ARRAY(vSid)); } } - + GlobalUnlock(stm.hGlobal); } - + ReleaseStgMedium(&stm); }
19 years, 2 months
1
0
0
0
[mf] 18172: Fix Bugzilla Bug 676: dynamic explorer start menu sidebar size
by mf@svn.reactos.com
Fix Bugzilla Bug 676: dynamic explorer start menu sidebar size Modified: trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp Modified: trunk/reactos/subsys/system/explorer/taskbar/startmenu.h _____ Modified: trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp --- trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp 2005-09-30 16:33:06 UTC (rev 18171) +++ trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp 2005-09-30 18:48:14 UTC (rev 18172) @@ -1555,12 +1555,18 @@ // ignore exception and don't show additional shortcuts } + ReadLogoSize(); +} + +void StartMenuRoot::ReadLogoSize() +{ // read size of logo bitmap BITMAP bmp_hdr; - GetObject(ResBitmap(IDB_LOGOV), sizeof(BITMAP), &bmp_hdr); + GetObject(ResBitmap(GetLogoResId()), sizeof(BITMAP), &bmp_hdr); _logo_size.cx = bmp_hdr.bmWidth; _logo_size.cy = bmp_hdr.bmHeight; + // cache logo width _border_left = _logo_size.cx + 1; } @@ -1776,6 +1782,11 @@ Paint(canvas); break;} + case WM_DISPLAYCHANGE: + // re-evaluate logo size using the correct color depth + ReadLogoSize(); + break; + default: return super::WndProc(nmsg, wparam, lparam); } @@ -1785,11 +1796,8 @@ void StartMenuRoot::Paint(PaintCanvas& canvas) { - int clr_bits; - {WindowCanvas dc(_hwnd); clr_bits=GetDeviceCaps(dc, BITSPIXEL);} - MemCanvas mem_dc; - ResBitmap bmp(clr_bits<=8? clr_bits<=4? IDB_LOGOV16: IDB_LOGOV256: IDB_LOGOV); + ResBitmap bmp(GetLogoResId()); BitmapSelection sel(mem_dc, bmp); ClientRect clnt(_hwnd); @@ -1807,7 +1815,21 @@ super::Paint(canvas); } +UINT StartMenuRoot::GetLogoResId() +{ + WindowCanvas dc(_hwnd); + int clr_bits = GetDeviceCaps(dc, BITSPIXEL); + + if (clr_bits > 8) + return IDB_LOGOV; + else if (clr_bits > 4) + return IDB_LOGOV256; + else + return IDB_LOGOV16; +} + + void StartMenuRoot::CloseStartMenu(int id) { if (_submenu) _____ Modified: trunk/reactos/subsys/system/explorer/taskbar/startmenu.h --- trunk/reactos/subsys/system/explorer/taskbar/startmenu.h 2005-09-30 16:33:06 UTC (rev 18171) +++ trunk/reactos/subsys/system/explorer/taskbar/startmenu.h 2005-09-30 18:48:14 UTC (rev 18172) @@ -377,6 +377,9 @@ void Paint(PaintCanvas& canvas); void CloseStartMenu(int id=0); + + void ReadLogoSize(); + UINT GetLogoResId(); };
19 years, 2 months
1
0
0
0
← Newer
1
2
3
4
...
59
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
Results per page:
10
25
50
100
200