Author: hbelusca
Date: Sun Oct 28 10:05:08 2012
New Revision: 57630
URL:
http://svn.reactos.org/svn/reactos?rev=57630&view=rev
Log:
Synchronize with trunk's revision r57629.
Added:
branches/ros-csrss/dll/opengl/glu32/
- copied from r57629, trunk/reactos/dll/opengl/glu32/
Removed:
branches/ros-csrss/dll/opengl/mesa/src/glu/
Modified:
branches/ros-csrss/ (props changed)
branches/ros-csrss/boot/freeldr/freeldr/CMakeLists.txt
branches/ros-csrss/configure.sh
branches/ros-csrss/dll/3rdparty/libjpeg/CMakeLists.txt
branches/ros-csrss/dll/3rdparty/libpng/CMakeLists.txt
branches/ros-csrss/dll/3rdparty/libtiff/CMakeLists.txt
branches/ros-csrss/dll/3rdparty/libxslt/CMakeLists.txt
branches/ros-csrss/dll/opengl/CMakeLists.txt
branches/ros-csrss/dll/opengl/mesa/src/CMakeLists.txt
branches/ros-csrss/dll/win32/advapi32/misc/logon.c
branches/ros-csrss/dll/win32/samsrv/database.c
branches/ros-csrss/dll/win32/samsrv/samrpc.c
branches/ros-csrss/dll/win32/samsrv/setup.c
branches/ros-csrss/dll/win32/shell32/iconcache.cpp
branches/ros-csrss/drivers/hid/mouhid/mouhid.c
branches/ros-csrss/drivers/usb/usbhub/ (props changed)
branches/ros-csrss/drivers/usb/usbhub/fdo.c
branches/ros-csrss/drivers/usb/usbhub/usbhub.c
branches/ros-csrss/drivers/usb/usbhub/usbhub.h
branches/ros-csrss/drivers/usb/usbstor/disk.c
branches/ros-csrss/lib/drivers/hidparser/api.c
branches/ros-csrss/ntoskrnl/po/power.c
branches/ros-csrss/win32ss/include/ntuser.h
branches/ros-csrss/win32ss/user/ntuser/main.c
branches/ros-csrss/win32ss/user/ntuser/ntuser.h
branches/ros-csrss/win32ss/user/ntuser/object.c
branches/ros-csrss/win32ss/user/ntuser/object.h
branches/ros-csrss/win32ss/user/ntuser/win32.h
branches/ros-csrss/win32ss/user/ntuser/win32kdebug.h
Propchange: branches/ros-csrss/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Oct 28 10:05:08 2012
@@ -13,4 +13,4 @@
/branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859
/branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567
/branches/wlan-bringup:54809-54998
-/trunk/reactos:57561-57599
+/trunk/reactos:57561-57629
Modified: branches/ros-csrss/boot/freeldr/freeldr/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/boot/freeldr/freeldr/…
==============================================================================
--- branches/ros-csrss/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] (original)
+++ branches/ros-csrss/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] Sun Oct 28
10:05:08 2012
@@ -1,7 +1,8 @@
if(SEPARATE_DBG)
# FIXME:
http://sourceware.org/bugzilla/show_bug.cgi?id=11822
- set(CMAKE_C_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER>
<CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS>
<CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS>
<LINK_LIBRARIES>")
+ set(CMAKE_LDR_PE_HELPER_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER>
<CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS>
<CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS>
<LINK_LIBRARIES>")
+ set(CMAKE_LDR_PE_HELPER_STANDARD_LIBRARIES "-lgcc" CACHE STRING
"Standard C Libraries")
endif()
spec2def(freeldr.sys freeldr.spec)
@@ -171,6 +172,10 @@
if((NOT MSVC) AND (CMAKE_VERSION VERSION_GREATER 2.8.7))
add_library(freeldr_pe SHARED $<TARGET_OBJECTS:freeldr_common>
${FREELDR_BASE_SOURCE})
add_library(freeldr_pe_dbg SHARED EXCLUDE_FROM_ALL
$<TARGET_OBJECTS:freeldr_common> ${FREELDR_BASE_SOURCE})
+ if(SEPARATE_DBG)
+ set_target_properties(freeldr_pe PROPERTIES LINKER_LANGUAGE LDR_PE_HELPER)
+ set_target_properties(freeldr_pe_dbg PROPERTIES LINKER_LANGUAGE LDR_PE_HELPER)
+ endif()
else()
add_library(freeldr_pe SHARED ${FREELDR_BASE_SOURCE})
add_library(freeldr_pe_dbg SHARED EXCLUDE_FROM_ALL ${FREELDR_BASE_SOURCE})
@@ -231,6 +236,10 @@
if((NOT MSVC) AND (CMAKE_VERSION VERSION_GREATER 2.8.7))
add_library(setupldr_pe SHARED $<TARGET_OBJECTS:freeldr_common>
${FREELDR_BASE_SOURCE} ${SETUPLDR_SOURCE})
add_library(setupldr_pe_dbg SHARED EXCLUDE_FROM_ALL
$<TARGET_OBJECTS:freeldr_common> ${FREELDR_BASE_SOURCE} ${SETUPLDR_SOURCE})
+ if(SEPARATE_DBG)
+ set_target_properties(setupldr_pe PROPERTIES LINKER_LANGUAGE LDR_PE_HELPER)
+ set_target_properties(setupldr_pe_dbg PROPERTIES LINKER_LANGUAGE LDR_PE_HELPER)
+ endif()
else()
add_library(setupldr_pe SHARED ${FREELDR_BASE_SOURCE} ${SETUPLDR_SOURCE})
add_library(setupldr_pe_dbg SHARED EXCLUDE_FROM_ALL ${FREELDR_BASE_SOURCE}
${SETUPLDR_SOURCE})
Modified: branches/ros-csrss/configure.sh
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/configure.sh?rev=5763…
==============================================================================
--- branches/ros-csrss/configure.sh [iso-8859-1] (original)
+++ branches/ros-csrss/configure.sh [iso-8859-1] Sun Oct 28 10:05:08 2012
@@ -9,6 +9,11 @@
ARCH=$ROS_ARCH
REACTOS_SOURCE_DIR=$(cd `dirname $0` && pwd)
REACTOS_OUTPUT_PATH=output-$BUILD_ENVIRONMENT-$ARCH
+if [ "$1" = "ninja" ]; then
+CMAKE_GENERATOR="Ninja"
+else
+CMAKE_GENERATOR="Unix Makefiles"
+fi
if [ "$REACTOS_SOURCE_DIR" = "$PWD" ]; then
echo Creating directories in $REACTOS_OUTPUT_PATH
@@ -23,12 +28,12 @@
rm -f CMakeCache.txt
REACTOS_BUILD_TOOLS_DIR="$PWD"
-cmake -G "Unix Makefiles" -DARCH=$ARCH "$REACTOS_SOURCE_DIR"
+cmake -G "$CMAKE_GENERATOR" -DARCH=$ARCH "$REACTOS_SOURCE_DIR"
echo Preparing reactos...
cd ../reactos
rm -f CMakeCache.txt
-cmake -G "Unix Makefiles" -DENABLE_CCACHE=0 -DPCH=0
-DCMAKE_TOOLCHAIN_FILE=toolchain-gcc.cmake -DARCH=$ARCH
-DREACTOS_BUILD_TOOLS_DIR="$REACTOS_BUILD_TOOLS_DIR"
"$REACTOS_SOURCE_DIR"
+cmake -G "$CMAKE_GENERATOR" -DENABLE_CCACHE=0 -DPCH=0
-DCMAKE_TOOLCHAIN_FILE=toolchain-gcc.cmake -DARCH=$ARCH
-DREACTOS_BUILD_TOOLS_DIR="$REACTOS_BUILD_TOOLS_DIR"
"$REACTOS_SOURCE_DIR"
echo Configure script complete! Enter directories and execute appropriate build
commands\(ex: make, makex, etc...\).
Modified: branches/ros-csrss/dll/3rdparty/libjpeg/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/3rdparty/libjpeg/…
==============================================================================
--- branches/ros-csrss/dll/3rdparty/libjpeg/CMakeLists.txt [iso-8859-1] (original)
+++ branches/ros-csrss/dll/3rdparty/libjpeg/CMakeLists.txt [iso-8859-1] Sun Oct 28
10:05:08 2012
@@ -58,7 +58,7 @@
jmemmgr.c
jmemnobs.c)
-set_entrypoint(libjpeg 0)
+set_module_type(libjpeg win32dll)
add_importlibs(libjpeg msvcrt kernel32)
add_dependencies(libjpeg psdk)
add_cd_file(TARGET libjpeg DESTINATION reactos/system32 FOR all)
Modified: branches/ros-csrss/dll/3rdparty/libpng/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/3rdparty/libpng/C…
==============================================================================
--- branches/ros-csrss/dll/3rdparty/libpng/CMakeLists.txt [iso-8859-1] (original)
+++ branches/ros-csrss/dll/3rdparty/libpng/CMakeLists.txt [iso-8859-1] Sun Oct 28 10:05:08
2012
@@ -26,7 +26,7 @@
pngwtran.c
pngwutil.c)
-set_entrypoint(libpng 0)
+set_module_type(libpng win32dll)
target_link_libraries(libpng zlib)
add_importlibs(libpng msvcrt kernel32 ntdll)
add_dependencies(libpng psdk)
Modified: branches/ros-csrss/dll/3rdparty/libtiff/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/3rdparty/libtiff/…
==============================================================================
--- branches/ros-csrss/dll/3rdparty/libtiff/CMakeLists.txt [iso-8859-1] (original)
+++ branches/ros-csrss/dll/3rdparty/libtiff/CMakeLists.txt [iso-8859-1] Sun Oct 28
10:05:08 2012
@@ -50,7 +50,7 @@
tif_write.c
tif_zip.c)
-set_module_type(libtiff win32dll ENTRYPOINT 0)
+set_module_type(libtiff win32dll)
target_link_libraries(libtiff zlib getopt)
add_importlibs(libtiff user32 msvcrt kernel32 ntdll)
add_dependencies(libtiff psdk)
Modified: branches/ros-csrss/dll/3rdparty/libxslt/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/3rdparty/libxslt/…
==============================================================================
--- branches/ros-csrss/dll/3rdparty/libxslt/CMakeLists.txt [iso-8859-1] (original)
+++ branches/ros-csrss/dll/3rdparty/libxslt/CMakeLists.txt [iso-8859-1] Sun Oct 28
10:05:08 2012
@@ -33,7 +33,7 @@
xsltlocale.c
xsltutils.c)
-set_module_type(libxslt win32dll ENTRYPOINT 0)
+set_module_type(libxslt win32dll)
target_link_libraries(libxslt libxml2)
add_importlibs(libxslt msvcrt ws2_32 kernel32)
Modified: branches/ros-csrss/dll/opengl/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/opengl/CMakeLists…
==============================================================================
--- branches/ros-csrss/dll/opengl/CMakeLists.txt [iso-8859-1] (original)
+++ branches/ros-csrss/dll/opengl/CMakeLists.txt [iso-8859-1] Sun Oct 28 10:05:08 2012
@@ -1,2 +1,3 @@
+add_subdirectory(glu32)
add_subdirectory(mesa)
-add_subdirectory(opengl32)
+add_subdirectory(opengl32)
Modified: branches/ros-csrss/dll/opengl/mesa/src/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/opengl/mesa/src/C…
==============================================================================
--- branches/ros-csrss/dll/opengl/mesa/src/CMakeLists.txt [iso-8859-1] (original)
+++ branches/ros-csrss/dll/opengl/mesa/src/CMakeLists.txt [iso-8859-1] Sun Oct 28 10:05:08
2012
@@ -1,6 +1,5 @@
add_subdirectory(gallium)
add_subdirectory(glsl)
-add_subdirectory(glu/sgi)
add_subdirectory(mapi/glapi)
-add_subdirectory(mesa)
+add_subdirectory(mesa)
Modified: branches/ros-csrss/dll/win32/advapi32/misc/logon.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/win32/advapi32/mi…
==============================================================================
--- branches/ros-csrss/dll/win32/advapi32/misc/logon.c [iso-8859-1] (original)
+++ branches/ros-csrss/dll/win32/advapi32/misc/logon.c [iso-8859-1] Sun Oct 28 10:05:08
2012
@@ -310,53 +310,72 @@
GetUserSid(LPCWSTR UserName,
PSID *Sid)
{
- PSID AccountDomainSid = NULL;
- ULONG ulUserRid;
- DWORD dwLength;
- HKEY hNamesKey = NULL;
- BOOL bResult = TRUE;
-
- if (!GetAccountDomainSid(&AccountDomainSid))
- {
- return FALSE;
- }
-
- /* Open the Users\Names key */
- if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
- L"SAM\\SAM\\Domains\\Account\\Users\\Names",
- 0,
- KEY_READ,
- &hNamesKey))
- {
- ERR("Failed to open Users\\Names key! (Error %lu)\n", GetLastError());
- bResult = FALSE;
+ PSID SidBuffer = NULL;
+ PWSTR DomainBuffer = NULL;
+ DWORD cbSidSize = 0;
+ DWORD cchDomSize = 0;
+ SID_NAME_USE Use;
+ BOOL res = TRUE;
+
+ *Sid = NULL;
+
+ LookupAccountNameW(NULL,
+ UserName,
+ NULL,
+ &cbSidSize,
+ NULL,
+ &cchDomSize,
+ &Use);
+
+ if (cbSidSize == 0 || cchDomSize == 0)
+ return FALSE;
+
+ SidBuffer = RtlAllocateHeap(RtlGetProcessHeap(),
+ HEAP_ZERO_MEMORY,
+ cbSidSize);
+ if (SidBuffer == NULL)
+ return FALSE;
+
+ DomainBuffer = RtlAllocateHeap(RtlGetProcessHeap(),
+ HEAP_ZERO_MEMORY,
+ cchDomSize * sizeof(WCHAR));
+ if (DomainBuffer == NULL)
+ {
+ res = FALSE;
goto done;
}
- /* Read the user RID */
- dwLength = sizeof(ULONG);
- if (RegQueryValueExW(hNamesKey,
- UserName,
- NULL,
- NULL,
- (LPBYTE)&ulUserRid,
- &dwLength))
- {
- ERR("Failed to read the SID! (Error %ld)\n", GetLastError());
- bResult = FALSE;
+ if (!LookupAccountNameW(NULL,
+ UserName,
+ SidBuffer,
+ &cbSidSize,
+ DomainBuffer,
+ &cchDomSize,
+ &Use))
+ {
+ res = FALSE;
goto done;
}
- *Sid = AppendRidToSid(AccountDomainSid, ulUserRid);
+ if (Use != SidTypeUser)
+ {
+ res = FALSE;
+ goto done;
+ }
+
+ *Sid = SidBuffer;
done:
- if (hNamesKey != NULL)
- RegCloseKey(hNamesKey);
-
- if (AccountDomainSid != NULL)
- RtlFreeHeap(RtlGetProcessHeap(), 0, AccountDomainSid);
-
- return bResult;
+ if (DomainBuffer != NULL)
+ RtlFreeHeap(RtlGetProcessHeap(), 0, DomainBuffer);
+
+ if (res == FALSE)
+ {
+ if (SidBuffer != NULL)
+ RtlFreeHeap(RtlGetProcessHeap(), 0, SidBuffer);
+ }
+
+ return res;
}
@@ -593,8 +612,8 @@
TOKEN_USER TokenUser;
TOKEN_OWNER TokenOwner;
TOKEN_PRIMARY_GROUP TokenPrimaryGroup;
- PTOKEN_GROUPS TokenGroups;
- PTOKEN_PRIVILEGES TokenPrivileges;
+ PTOKEN_GROUPS TokenGroups = NULL;
+ PTOKEN_PRIVILEGES TokenPrivileges = NULL;
TOKEN_DEFAULT_DACL TokenDefaultDacl;
LARGE_INTEGER ExpirationTime;
LUID AuthenticationId;
@@ -603,10 +622,10 @@
PSID PrimaryGroupSid = NULL;
PSID OwnerSid = NULL;
PSID LocalSystemSid;
- PACL Dacl;
- NTSTATUS Status;
+ PACL Dacl = NULL;
SID_IDENTIFIER_AUTHORITY SystemAuthority = {SECURITY_NT_AUTHORITY};
unsigned i;
+ NTSTATUS Status = STATUS_SUCCESS;
Qos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
Qos.ImpersonationLevel = SecurityAnonymous;
@@ -641,11 +660,10 @@
/* Allocate and initialize token groups */
TokenGroups = AllocateGroupSids(&PrimaryGroupSid,
&OwnerSid);
- if (NULL == TokenGroups)
- {
- RtlFreeSid(UserSid);
- SetLastError(ERROR_OUTOFMEMORY);
- return FALSE;
+ if (TokenGroups == NULL)
+ {
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ goto done;
}
/* Allocate and initialize token privileges */
@@ -653,12 +671,10 @@
sizeof(TOKEN_PRIVILEGES)
+ sizeof(DefaultPrivs) / sizeof(DefaultPrivs[0])
* sizeof(LUID_AND_ATTRIBUTES));
- if (NULL == TokenPrivileges)
- {
- FreeGroupSids(TokenGroups);
- RtlFreeSid(UserSid);
- SetLastError(ERROR_OUTOFMEMORY);
- return FALSE;
+ if (TokenPrivileges == NULL)
+ {
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ goto done;
}
TokenPrivileges->PrivilegeCount = 0;
@@ -683,21 +699,13 @@
Dacl = RtlAllocateHeap(GetProcessHeap(), 0, 1024);
if (Dacl == NULL)
{
- FreeGroupSids(TokenGroups);
- RtlFreeSid(UserSid);
- SetLastError(ERROR_OUTOFMEMORY);
- return FALSE;
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ goto done;
}
Status = RtlCreateAcl(Dacl, 1024, ACL_REVISION);
if (!NT_SUCCESS(Status))
- {
- RtlFreeHeap(GetProcessHeap(), 0, Dacl);
- FreeGroupSids(TokenGroups);
- RtlFreeHeap(GetProcessHeap(), 0, TokenPrivileges);
- RtlFreeSid(UserSid);
- return FALSE;
- }
+ goto done;
RtlAddAccessAllowedAce(Dacl,
ACL_REVISION,
@@ -754,10 +762,18 @@
&TokenDefaultDacl,
&TokenSource);
- RtlFreeHeap(GetProcessHeap(), 0, Dacl);
- FreeGroupSids(TokenGroups);
- RtlFreeHeap(GetProcessHeap(), 0, TokenPrivileges);
- RtlFreeSid(UserSid);
+done:
+ if (Dacl != NULL)
+ RtlFreeHeap(GetProcessHeap(), 0, Dacl);
+
+ if (TokenGroups != NULL)
+ FreeGroupSids(TokenGroups);
+
+ if (TokenPrivileges != NULL)
+ RtlFreeHeap(GetProcessHeap(), 0, TokenPrivileges);
+
+ if (UserSid != NULL)
+ RtlFreeHeap(GetProcessHeap(), 0, UserSid);
return NT_SUCCESS(Status);
}
Modified: branches/ros-csrss/dll/win32/samsrv/database.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/win32/samsrv/data…
==============================================================================
--- branches/ros-csrss/dll/win32/samsrv/database.c [iso-8859-1] (original)
+++ branches/ros-csrss/dll/win32/samsrv/database.c [iso-8859-1] Sun Oct 28 10:05:08 2012
@@ -764,8 +764,8 @@
goto done;
}
- String->Length = Length - sizeof(WCHAR);
- String->MaximumLength = Length;
+ String->Length = (USHORT)(Length - sizeof(WCHAR));
+ String->MaximumLength = (USHORT)Length;
String->Buffer = midl_user_allocate(Length);
if (String->Buffer == NULL)
{
Modified: branches/ros-csrss/dll/win32/samsrv/samrpc.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/win32/samsrv/samr…
==============================================================================
--- branches/ros-csrss/dll/win32/samsrv/samrpc.c [iso-8859-1] (original)
+++ branches/ros-csrss/dll/win32/samsrv/samrpc.c [iso-8859-1] Sun Oct 28 10:05:08 2012
@@ -16,6 +16,7 @@
/* GLOBALS ********************************************************************/
static SID_IDENTIFIER_AUTHORITY NtSidAuthority = {SECURITY_NT_AUTHORITY};
+
/* FUNCTIONS ***************************************************************/
@@ -3051,6 +3052,8 @@
Use->Count = 0;
}
+ TRACE("Returned Status %lx\n", Status);
+
return Status;
}
@@ -3145,8 +3148,8 @@
if (NT_SUCCESS(Status))
{
- Names->Element[i].MaximumLength = DataLength;
- Names->Element[i].Length = DataLength - sizeof(WCHAR);
+ Names->Element[i].MaximumLength = (USHORT)DataLength;
+ Names->Element[i].Length = (USHORT)(DataLength -
sizeof(WCHAR));
Status = SampRegQueryValue(AccountKeyHandle,
L"Name",
@@ -3201,8 +3204,8 @@
if (NT_SUCCESS(Status))
{
- Names->Element[i].MaximumLength = DataLength;
- Names->Element[i].Length = DataLength - sizeof(WCHAR);
+ Names->Element[i].MaximumLength = (USHORT)DataLength;
+ Names->Element[i].Length = (USHORT)(DataLength -
sizeof(WCHAR));
Status = SampRegQueryValue(AccountKeyHandle,
L"Name",
@@ -3259,8 +3262,8 @@
if (NT_SUCCESS(Status))
{
- Names->Element[i].MaximumLength = DataLength;
- Names->Element[i].Length = DataLength - sizeof(WCHAR);
+ Names->Element[i].MaximumLength = (USHORT)DataLength;
+ Names->Element[i].Length = (USHORT)(DataLength -
sizeof(WCHAR));
Status = SampRegQueryValue(AccountKeyHandle,
L"Name",
@@ -4319,6 +4322,7 @@
return Status;
}
+
/* Function 34 */
NTSTATUS
NTAPI
@@ -4366,6 +4370,7 @@
return STATUS_SUCCESS;
}
+
/* Function 35 */
NTSTATUS
@@ -4676,8 +4681,6 @@
return Status;
}
-
-
static
@@ -6283,6 +6286,7 @@
return Status;
}
+
/* Function 51 */
NTSTATUS
NTAPI
@@ -6299,15 +6303,34 @@
return STATUS_NOT_IMPLEMENTED;
}
+
/* Function 52 */
NTSTATUS
NTAPI
SamrAddMultipleMembersToAlias(IN SAMPR_HANDLE AliasHandle,
IN PSAMPR_PSID_ARRAY MembersBuffer)
{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
-}
+ ULONG i;
+ NTSTATUS Status = STATUS_SUCCESS;
+
+ TRACE("SamrAddMultipleMembersToAlias(%p %p)\n",
+ AliasHandle, MembersBuffer);
+
+ for (i = 0; i < MembersBuffer->Count; i++)
+ {
+ Status = SamrAddMemberToAlias(AliasHandle,
+ ((PSID *)MembersBuffer->Sids)[i]);
+
+ if (Status == STATUS_MEMBER_IN_ALIAS)
+ Status = STATUS_SUCCESS;
+
+ if (!NT_SUCCESS(Status))
+ break;
+ }
+
+ return Status;
+}
+
/* Function 53 */
NTSTATUS
Modified: branches/ros-csrss/dll/win32/samsrv/setup.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/win32/samsrv/setu…
==============================================================================
--- branches/ros-csrss/dll/win32/samsrv/setup.c [iso-8859-1] (original)
+++ branches/ros-csrss/dll/win32/samsrv/setup.c [iso-8859-1] Sun Oct 28 10:05:08 2012
@@ -224,6 +224,7 @@
ULONG ulRelativeId)
{
SAM_USER_FIXED_DATA FixedUserData;
+ LPWSTR lpEmptyString = L"";
DWORD dwDisposition;
WCHAR szAccountKeyName[32];
HKEY hAccountKey = NULL;
@@ -260,6 +261,62 @@
REG_SZ,
(LPVOID)lpAccountName,
(wcslen(lpAccountName) + 1) * sizeof(WCHAR));
+
+ RegSetValueEx(hAccountKey,
+ L"FullName",
+ 0,
+ REG_SZ,
+ (LPVOID)lpEmptyString,
+ sizeof(WCHAR));
+
+ RegSetValueEx(hAccountKey,
+ L"HomeDirectory",
+ 0,
+ REG_SZ,
+ (LPVOID)lpEmptyString,
+ sizeof(WCHAR));
+
+ RegSetValueEx(hAccountKey,
+ L"HomeDirectoryDrive",
+ 0,
+ REG_SZ,
+ (LPVOID)lpEmptyString,
+ sizeof(WCHAR));
+
+ RegSetValueEx(hAccountKey,
+ L"ScriptPath",
+ 0,
+ REG_SZ,
+ (LPVOID)lpEmptyString,
+ sizeof(WCHAR));
+
+ RegSetValueEx(hAccountKey,
+ L"ProfilePath",
+ 0,
+ REG_SZ,
+ (LPVOID)lpEmptyString,
+ sizeof(WCHAR));
+
+ RegSetValueEx(hAccountKey,
+ L"AdminComment",
+ 0,
+ REG_SZ,
+ (LPVOID)lpEmptyString,
+ sizeof(WCHAR));
+
+ RegSetValueEx(hAccountKey,
+ L"UserComment",
+ 0,
+ REG_SZ,
+ (LPVOID)lpEmptyString,
+ sizeof(WCHAR));
+
+ RegSetValueEx(hAccountKey,
+ L"WorkStations",
+ 0,
+ REG_SZ,
+ (LPVOID)lpEmptyString,
+ sizeof(WCHAR));
RegCloseKey(hAccountKey);
}
Modified: branches/ros-csrss/dll/win32/shell32/iconcache.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/win32/shell32/ico…
==============================================================================
--- branches/ros-csrss/dll/win32/shell32/iconcache.cpp [iso-8859-1] (original)
+++ branches/ros-csrss/dll/win32/shell32/iconcache.cpp [iso-8859-1] Sun Oct 28 10:05:08
2012
@@ -323,7 +323,7 @@
static INT SIC_IconAppend (LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallIcon,
HICON hBigIcon, DWORD dwFlags)
{
LPSIC_ENTRY lpsice;
- INT ret, index, index1;
+ INT ret, index, index1, indexDPA;
WCHAR path[MAX_PATH];
TRACE("%s %i %p %p\n", debugstr_w(sSourceFile), dwSourceIndex, hSmallIcon
,hBigIcon);
@@ -338,8 +338,8 @@
EnterCriticalSection(&SHELL32_SicCS);
- index = DPA_InsertPtr(sic_hdpa, 0x7fff, lpsice);
- if ( INVALID_INDEX == index )
+ indexDPA = DPA_InsertPtr(sic_hdpa, 0x7fff, lpsice);
+ if ( -1 == indexDPA )
{
ret = INVALID_INDEX;
goto leave;
@@ -370,6 +370,7 @@
leave:
if(ret == INVALID_INDEX)
{
+ if(indexDPA != -1) DPA_DeletePtr(sic_hdpa, indexDPA);
HeapFree(GetProcessHeap(), 0, lpsice->sSourceFile);
SHFree(lpsice);
}
Modified: branches/ros-csrss/drivers/hid/mouhid/mouhid.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/drivers/hid/mouhid/mo…
==============================================================================
--- branches/ros-csrss/drivers/hid/mouhid/mouhid.c [iso-8859-1] (original)
+++ branches/ros-csrss/drivers/hid/mouhid/mouhid.c [iso-8859-1] Sun Oct 28 10:05:08 2012
@@ -92,7 +92,8 @@
VOID
MouHid_GetButtonFlags(
IN PMOUHID_DEVICE_EXTENSION DeviceExtension,
- OUT PUSHORT ButtonFlags)
+ OUT PUSHORT ButtonFlags,
+ OUT PUSHORT Flags)
{
NTSTATUS Status;
USAGE Usage;
@@ -102,6 +103,7 @@
/* init flags */
*ButtonFlags = 0;
+ *Flags = 0;
/* get usages */
CurrentUsageListLength = DeviceExtension->UsageListLength;
@@ -170,7 +172,7 @@
if (DeviceExtension->MouseAbsolute)
{
// mouse operates absolute
- *ButtonFlags |= MOUSE_MOVE_ABSOLUTE;
+ *Flags |= MOUSE_MOVE_ABSOLUTE;
}
}
@@ -212,6 +214,7 @@
NTSTATUS Status;
LONG LastX, LastY;
MOUSE_INPUT_DATA MouseInputData;
+ USHORT Flags;
/* get device extension */
DeviceExtension = (PMOUHID_DEVICE_EXTENSION)Context;
@@ -239,13 +242,14 @@
MouHid_GetButtonMove(DeviceExtension, &LastX, &LastY);
/* get mouse change flags */
- MouHid_GetButtonFlags(DeviceExtension, &ButtonFlags);
+ MouHid_GetButtonFlags(DeviceExtension, &ButtonFlags, &Flags);
/* init input data */
RtlZeroMemory(&MouseInputData, sizeof(MOUSE_INPUT_DATA));
/* init input data */
MouseInputData.ButtonFlags = ButtonFlags;
+ MouseInputData.Flags = Flags;
MouseInputData.LastX = LastX;
MouseInputData.LastY = LastY;
Propchange: branches/ros-csrss/drivers/usb/usbhub/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Oct 28 10:05:08 2012
@@ -27,4 +27,4 @@
/branches/usb-bringup-trunk/drivers/usb/usbhub:55524-55543,55548-55554
/branches/wlan-bringup/drivers/usb/usbhub:54809-54998
/branches/wlan-bringup/drivers/usb/usbhub_new:54809-54998
-/trunk/reactos/drivers/usb/usbhub:57561-57599
+/trunk/reactos/drivers/usb/usbhub:57561-57629
Modified: branches/ros-csrss/drivers/usb/usbhub/fdo.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/drivers/usb/usbhub/fd…
==============================================================================
--- branches/ros-csrss/drivers/usb/usbhub/fdo.c [iso-8859-1] (original)
+++ branches/ros-csrss/drivers/usb/usbhub/fdo.c [iso-8859-1] Sun Oct 28 10:05:08 2012
@@ -1133,7 +1133,7 @@
ULONG ChildDeviceCount, UsbDeviceNumber = 0;
WCHAR CharDeviceName[64];
UNICODE_STRING DeviceName;
- ULONG ConfigDescSize, DeviceDescSize;
+ ULONG ConfigDescSize, DeviceDescSize, DeviceInfoSize;
PVOID HubInterfaceBusContext;
USB_CONFIGURATION_DESCRIPTOR ConfigDesc;
@@ -1312,6 +1312,14 @@
DPRINT1("USBHUB: GetUsbDeviceDescriptor failed with status %x\n",
Status);
goto Cleanup;
}
+
+ // query device details
+ Status = HubInterface->QueryDeviceInformation(HubInterfaceBusContext,
+ UsbChildExtension->UsbDeviceHandle,
+ &UsbChildExtension->DeviceInformation,
+ sizeof(USB_DEVICE_INFORMATION_0),
+ &DeviceInfoSize);
+
//DumpFullConfigurationDescriptor(UsbChildExtension->FullConfigDesc);
@@ -2047,8 +2055,183 @@
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
- DPRINT1("FdoHandleDeviceControl\n");
- UNIMPLEMENTED
- return STATUS_NOT_IMPLEMENTED;
+ PIO_STACK_LOCATION IoStack;
+ NTSTATUS Status = STATUS_NOT_IMPLEMENTED;
+ PUSB_NODE_INFORMATION NodeInformation;
+ PHUB_DEVICE_EXTENSION HubDeviceExtension;
+ PUSB_NODE_CONNECTION_INFORMATION NodeConnectionInfo;
+ PHUB_CHILDDEVICE_EXTENSION ChildDeviceExtension;
+ PUSB_NODE_CONNECTION_DRIVERKEY_NAME NodeKey;
+ PUSB_NODE_CONNECTION_NAME ConnectionName;
+ ULONG Index, Length;
+
+ // get stack location
+ IoStack = IoGetCurrentIrpStackLocation(Irp);
+
+ // get device extension
+ HubDeviceExtension = (PHUB_DEVICE_EXTENSION) DeviceObject->DeviceExtension;
+
+ if (IoStack->Parameters.DeviceIoControl.IoControlCode ==
IOCTL_USB_GET_NODE_INFORMATION)
+ {
+ // is the buffer big enough
+ if (IoStack->Parameters.DeviceIoControl.OutputBufferLength <
sizeof(USB_NODE_INFORMATION))
+ {
+ // buffer too small
+ Status = STATUS_BUFFER_TOO_SMALL;
+ }
+ else
+ {
+ // get buffer
+ NodeInformation = (PUSB_NODE_INFORMATION)Irp->AssociatedIrp.SystemBuffer;
+
+ // sanity check
+ ASSERT(NodeInformation);
+
+ // init buffer
+ NodeInformation->NodeType = UsbHub;
+ RtlCopyMemory(&NodeInformation->u.HubInformation.HubDescriptor,
&HubDeviceExtension->HubDescriptor, sizeof(USB_HUB_DESCRIPTOR));
+
+ // FIXME is hub powered
+ NodeInformation->u.HubInformation.HubIsBusPowered = TRUE;
+
+ // done
+ Irp->IoStatus.Information = sizeof(USB_NODE_INFORMATION);
+ Status = STATUS_SUCCESS;
+ }
+
+
+ }
+ else if (IoStack->Parameters.DeviceIoControl.IoControlCode ==
IOCTL_USB_GET_NODE_CONNECTION_INFORMATION)
+ {
+ if (IoStack->Parameters.DeviceIoControl.OutputBufferLength <
sizeof(USB_NODE_CONNECTION_INFORMATION))
+ {
+ // buffer too small
+ Status = STATUS_BUFFER_TOO_SMALL;
+ }
+ else
+ {
+ // get node connection info
+ NodeConnectionInfo =
(PUSB_NODE_CONNECTION_INFORMATION)Irp->AssociatedIrp.SystemBuffer;
+
+ // sanity checks
+ ASSERT(NodeConnectionInfo);
+
+ for(Index = 0; Index < USB_MAXCHILDREN; Index++)
+ {
+ if (HubDeviceExtension->ChildDeviceObject[Index] == NULL)
+ continue;
+
+ // get child device extension
+ ChildDeviceExtension =
(PHUB_CHILDDEVICE_EXTENSION)HubDeviceExtension->ChildDeviceObject[Index]->DeviceExtension;
+
+ if (ChildDeviceExtension->PortNumber !=
NodeConnectionInfo->ConnectionIndex)
+ continue;
+
+ // init node connection info
+ RtlCopyMemory(&NodeConnectionInfo->DeviceDescriptor,
&ChildDeviceExtension->DeviceDesc, sizeof(USB_DEVICE_DESCRIPTOR));
+ NodeConnectionInfo->CurrentConfigurationValue =
ChildDeviceExtension->FullConfigDesc->bConfigurationValue;
+ NodeConnectionInfo->DeviceIsHub = FALSE; //FIXME support hubs
+ NodeConnectionInfo->LowSpeed =
ChildDeviceExtension->DeviceInformation.DeviceSpeed == UsbLowSpeed;
+ NodeConnectionInfo->DeviceAddress =
ChildDeviceExtension->DeviceInformation.DeviceAddress;
+ NodeConnectionInfo->NumberOfOpenPipes =
ChildDeviceExtension->DeviceInformation.NumberOfOpenPipes;
+ NodeConnectionInfo->ConnectionStatus = DeviceConnected; //FIXME
+
+ if (NodeConnectionInfo->NumberOfOpenPipes)
+ {
+ DPRINT1("Need to copy pipe information\n");
+ }
+ break;
+ }
+ // done
+ Irp->IoStatus.Information = sizeof(USB_NODE_INFORMATION);
+ Status = STATUS_SUCCESS;
+ }
+ }
+ else if (IoStack->Parameters.DeviceIoControl.IoControlCode ==
IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME)
+ {
+ if (IoStack->Parameters.DeviceIoControl.OutputBufferLength <
sizeof(USB_NODE_CONNECTION_INFORMATION))
+ {
+ // buffer too small
+ Status = STATUS_BUFFER_TOO_SMALL;
+ }
+ else
+ {
+ // get node connection info
+ NodeKey =
(PUSB_NODE_CONNECTION_DRIVERKEY_NAME)Irp->AssociatedIrp.SystemBuffer;
+
+ // sanity checks
+ ASSERT(NodeKey);
+
+ for(Index = 0; Index < USB_MAXCHILDREN; Index++)
+ {
+ if (HubDeviceExtension->ChildDeviceObject[Index] == NULL)
+ continue;
+
+ // get child device extension
+ ChildDeviceExtension =
(PHUB_CHILDDEVICE_EXTENSION)HubDeviceExtension->ChildDeviceObject[Index]->DeviceExtension;
+
+ if (ChildDeviceExtension->PortNumber != NodeKey->ConnectionIndex)
+ continue;
+
+ // get driver key
+ Status =
IoGetDeviceProperty(HubDeviceExtension->ChildDeviceObject[Index],
DevicePropertyDriverKeyName,
+
IoStack->Parameters.DeviceIoControl.OutputBufferLength -
sizeof(USB_NODE_CONNECTION_DRIVERKEY_NAME),
+ NodeKey->DriverKeyName,
+ &Length);
+
+ if (Status == STATUS_BUFFER_TOO_SMALL)
+ {
+ // normalize status
+ Status = STATUS_SUCCESS;
+ }
+
+ if (Length + sizeof(USB_NODE_CONNECTION_DRIVERKEY_NAME) >
IoStack->Parameters.DeviceIoControl.OutputBufferLength)
+ {
+ // terminate node key name
+ NodeKey->DriverKeyName[0] = UNICODE_NULL;
+ Irp->IoStatus.Information =
sizeof(USB_NODE_CONNECTION_DRIVERKEY_NAME);
+ }
+ else
+ {
+ // result size
+ Irp->IoStatus.Information = Length +
sizeof(USB_NODE_CONNECTION_DRIVERKEY_NAME);
+ }
+
+ // length of driver name
+ NodeKey->ActualLength = Length +
sizeof(USB_NODE_CONNECTION_DRIVERKEY_NAME);
+ break;
+ }
+ }
+ }
+ else if (IoStack->Parameters.DeviceIoControl.IoControlCode ==
IOCTL_USB_GET_NODE_CONNECTION_NAME)
+ {
+ if (IoStack->Parameters.DeviceIoControl.OutputBufferLength <
sizeof(USB_NODE_CONNECTION_NAME))
+ {
+ // buffer too small
+ Status = STATUS_BUFFER_TOO_SMALL;
+ }
+ else
+ {
+ // FIXME support hubs
+ ConnectionName =
(PUSB_NODE_CONNECTION_NAME)Irp->AssociatedIrp.SystemBuffer;
+ ConnectionName->ActualLength = 0;
+ ConnectionName->NodeName[0] = UNICODE_NULL;
+
+ // done
+ Irp->IoStatus.Information = sizeof(USB_NODE_CONNECTION_NAME);
+ Status = STATUS_SUCCESS;
+ }
+ }
+ else
+ {
+ DPRINT1("UNIMPLEMENTED FdoHandleDeviceControl IoCtl %x InputBufferLength %x
OutputBufferLength %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode,
+ IoStack->Parameters.DeviceIoControl.InputBufferLength,
IoStack->Parameters.DeviceIoControl.OutputBufferLength);
+ }
+
+ // finish irp
+ Irp->IoStatus.Status = Status;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+
+ return Status;
}
Modified: branches/ros-csrss/drivers/usb/usbhub/usbhub.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/drivers/usb/usbhub/us…
==============================================================================
--- branches/ros-csrss/drivers/usb/usbhub/usbhub.c [iso-8859-1] (original)
+++ branches/ros-csrss/drivers/usb/usbhub/usbhub.c [iso-8859-1] Sun Oct 28 10:05:08 2012
@@ -184,8 +184,39 @@
PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
- return STATUS_NOT_SUPPORTED;
+ PIO_STACK_LOCATION IoStack;
+
+ IoStack = IoGetCurrentIrpStackLocation(Irp);
+ DPRINT1("Power Function %x\n", IoStack->MinorFunction);
+
+ if (IoStack->MinorFunction == IRP_MN_SET_POWER)
+ {
+ PoStartNextPowerIrp(Irp);
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_SUCCESS;
+
+ }
+ else if (IoStack->MinorFunction == IRP_MN_QUERY_POWER)
+ {
+ PoStartNextPowerIrp(Irp);
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_SUCCESS;
+
+ }
+ else if (IoStack->MinorFunction == IRP_MN_WAIT_WAKE)
+ {
+ PoStartNextPowerIrp(Irp);
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_SUCCESS;
+ }
+
+ PoStartNextPowerIrp(Irp);
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_SUCCESS;
}
VOID
Modified: branches/ros-csrss/drivers/usb/usbhub/usbhub.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/drivers/usb/usbhub/us…
==============================================================================
--- branches/ros-csrss/drivers/usb/usbhub/usbhub.h [iso-8859-1] (original)
+++ branches/ros-csrss/drivers/usb/usbhub/usbhub.h [iso-8859-1] Sun Oct 28 10:05:08 2012
@@ -68,6 +68,7 @@
PUSB_CONFIGURATION_DESCRIPTOR FullConfigDesc;
UNICODE_STRING SymbolicLinkName;
USB_BUS_INTERFACE_USBDI_V2 DeviceInterface;
+ USB_DEVICE_INFORMATION_0 DeviceInformation;
} HUB_CHILDDEVICE_EXTENSION, *PHUB_CHILDDEVICE_EXTENSION;
typedef struct _HUB_DEVICE_EXTENSION
Modified: branches/ros-csrss/drivers/usb/usbstor/disk.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/drivers/usb/usbstor/d…
==============================================================================
--- branches/ros-csrss/drivers/usb/usbstor/disk.c [iso-8859-1] (original)
+++ branches/ros-csrss/drivers/usb/usbstor/disk.c [iso-8859-1] Sun Oct 28 10:05:08 2012
@@ -174,11 +174,13 @@
{
DPRINT1("SRB_FUNCTION_FLUSH / SRB_FUNCTION_FLUSH_QUEUE /
SRB_FUNCTION_SHUTDOWN\n");
+ // HACK: don't flush pending requests
+#if 0 // we really need a proper storage stack
//
// wait for pending requests to finish
//
USBSTOR_QueueWaitForPendingRequests(PDODeviceExtension->LowerDeviceObject);
-
+#endif
//
// set status success
//
Modified: branches/ros-csrss/lib/drivers/hidparser/api.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/lib/drivers/hidparser…
==============================================================================
--- branches/ros-csrss/lib/drivers/hidparser/api.c [iso-8859-1] (original)
+++ branches/ros-csrss/lib/drivers/hidparser/api.c [iso-8859-1] Sun Oct 28 10:05:08 2012
@@ -630,11 +630,10 @@
ASSERT(ReportItem->ByteOffset < ReportDescriptorLength);
//
- // one extra shift for skipping the prepended report id
- //
- Data = 0;
- Parser->Copy(&Data, &ReportDescriptor[ReportItem->ByteOffset +1],
min(sizeof(ULONG), ReportDescriptorLength - (ReportItem->ByteOffset + 1)));
- //Data = ReportDescriptor[ReportItem->ByteOffset + 1];
+ // FIXME: support items with variable bitlength
+ //
+ ASSERT(ReportItem->BitCount == 16);
+ Data = (ReportDescriptor[ReportItem->ByteOffset +1] & 0xFF) |
(ReportDescriptor[ReportItem->ByteOffset +2] & 0xFF) << 8;
//
// shift data
Modified: branches/ros-csrss/ntoskrnl/po/power.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/ntoskrnl/po/power.c?r…
==============================================================================
--- branches/ros-csrss/ntoskrnl/po/power.c [iso-8859-1] (original)
+++ branches/ros-csrss/ntoskrnl/po/power.c [iso-8859-1] Sun Oct 28 10:05:08 2012
@@ -21,6 +21,7 @@
PREQUEST_POWER_COMPLETE CompletionRoutine;
POWER_STATE PowerState;
PVOID Context;
+ PDEVICE_OBJECT TopDeviceObject;
} REQUEST_POWER_ITEM, *PREQUEST_POWER_ITEM;
typedef struct _POWER_STATE_TRAVERSE_CONTEXT
@@ -56,10 +57,10 @@
RequestPowerItem->Context,
&Irp->IoStatus);
+ IoFreeIrp(Irp);
+
+ ObDereferenceObject(RequestPowerItem->TopDeviceObject);
ExFreePool(Context);
-
- IoFreeIrp(Irp);
- ObDereferenceObject(DeviceObject);
return STATUS_MORE_PROCESSING_REQUIRED;
}
@@ -573,6 +574,7 @@
RequestPowerItem->CompletionRoutine = CompletionFunction;
RequestPowerItem->PowerState = PowerState;
RequestPowerItem->Context = Context;
+ RequestPowerItem->TopDeviceObject = TopDeviceObject;
if (pIrp != NULL)
*pIrp = Irp;
Modified: branches/ros-csrss/win32ss/include/ntuser.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/include/ntuse…
==============================================================================
--- branches/ros-csrss/win32ss/include/ntuser.h [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/include/ntuser.h [iso-8859-1] Sun Oct 28 10:05:08 2012
@@ -56,7 +56,8 @@
otHidData,
otDeviceInfo,
otTouchInput,
- otGestureInfo
+ otGestureInfo,
+ USER_HANDLE_TYPE_COUNT
} USER_OBJECT_TYPE;
typedef enum _USERTHREADINFOCLASS
Modified: branches/ros-csrss/win32ss/user/ntuser/main.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/ntuser/m…
==============================================================================
--- branches/ros-csrss/win32ss/user/ntuser/main.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/ntuser/main.c [iso-8859-1] Sun Oct 28 10:05:08 2012
@@ -26,6 +26,7 @@
SHORT gusLanguageID;
PPROCESSINFO ppiScrnSaver;
+PPROCESSINFO gppiList = NULL;
extern ULONG_PTR Win32kSSDT[];
extern UCHAR Win32kSSPT[];
@@ -55,7 +56,7 @@
Win32kProcessCallback(struct _EPROCESS *Process,
BOOLEAN Create)
{
- PPROCESSINFO ppiCurrent;
+ PPROCESSINFO ppiCurrent, *pppi;
DECLARE_RETURN(NTSTATUS);
ASSERT(Process->Peb);
@@ -160,6 +161,10 @@
ASSERT(ppiCurrent->pPoolDcAttr);
ASSERT(ppiCurrent->pPoolBrushAttr);
ASSERT(ppiCurrent->pPoolRgnAttr);
+
+ /* Add the process to the global list */
+ ppiCurrent->ppiNext = gppiList;
+ gppiList = ppiCurrent;
}
else
{
@@ -212,11 +217,25 @@
if (gppiInputProvider == ppiCurrent) gppiInputProvider = NULL;
+ pppi = &gppiList;
+ while (*pppi != NULL && *pppi != ppiCurrent)
+ pppi = &(*pppi)->ppiNext;
+
+ ASSERT(*pppi == ppiCurrent);
+
+ *pppi = ppiCurrent->ppiNext;
+
TRACE_CH(UserProcess,"Freeing ppi 0x%p\n", ppiCurrent);
/* Ftee the PROCESSINFO */
PsSetProcessWin32Process(Process, NULL);
ExFreePoolWithTag(ppiCurrent, USERTAG_PROCESSINFO);
+#if DBG
+ if (DBG_IS_CHANNEL_ENABLED(ppiCurrent, DbgChUserObj, WARN_LEVEL))
+ {
+ DbgUserDumpHandleTable();
+ }
+#endif
}
RETURN( STATUS_SUCCESS);
Modified: branches/ros-csrss/win32ss/user/ntuser/ntuser.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/ntuser/n…
==============================================================================
--- branches/ros-csrss/win32ss/user/ntuser/ntuser.h [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/ntuser/ntuser.h [iso-8859-1] Sun Oct 28 10:05:08 2012
@@ -12,6 +12,7 @@
extern BOOL gbInitialized;
extern PSERVERINFO gpsi;
extern PTHREADINFO gptiCurrent;
+extern PPROCESSINFO gppiList;
extern PPROCESSINFO ppiScrnSaver;
extern PPROCESSINFO gppiInputProvider;
Modified: branches/ros-csrss/win32ss/user/ntuser/object.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/ntuser/o…
==============================================================================
--- branches/ros-csrss/win32ss/user/ntuser/object.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/ntuser/object.c [iso-8859-1] Sun Oct 28 10:05:08 2012
@@ -12,6 +12,66 @@
//int usedHandles=0;
PUSER_HANDLE_TABLE gHandleTable = NULL;
+#if DBG
+
+void DbgUserDumpHandleTable()
+{
+ int HandleCounts[USER_HANDLE_TYPE_COUNT];
+ PPROCESSINFO ppiList;
+ int i;
+ PWCHAR TypeNames[] = {L"Free",L"Window",L"Menu",
L"CursorIcon", L"SMWP", L"Hook", L"ClipBoardData",
L"CallProc",
+ L"Accel", L"DDEaccess",
L"DDEconv", L"DDExact", L"Monitor", L"KBDlayout",
L"KBDfile",
+ L"Event", L"Timer",
L"InputContext", L"HidData", L"DeviceInfo",
L"TouchInput",L"GestureInfo"};
+
+ ERR("Total handles count: %d\n", gpsi->cHandleEntries);
+
+ memset(HandleCounts, 0, sizeof(HandleCounts));
+
+ /* First of all count the number of handles per tpe */
+ ppiList = gppiList;
+ while (ppiList)
+ {
+ ERR("Process %s (%d) handles count: %d\n\t",
ppiList->peProcess->ImageFileName, ppiList->peProcess->UniqueProcessId,
ppiList->UserHandleCount);
+
+ for (i = 1 ;i < USER_HANDLE_TYPE_COUNT; i++)
+ {
+ HandleCounts[i] += ppiList->DbgHandleCount[i];
+
+ DbgPrint("%S: %d, ", TypeNames[i], ppiList->DbgHandleCount[i]);
+ if (i % 6 == 0)
+ DbgPrint("\n\t");
+ }
+ DbgPrint("\n");
+
+ ppiList = ppiList->ppiNext;
+ }
+
+ /* Print total type counts */
+ ERR("Total handles of the running processes: \n\t");
+ for (i = 1 ;i < USER_HANDLE_TYPE_COUNT; i++)
+ {
+ DbgPrint("%S: %d, ", TypeNames[i], HandleCounts[i]);
+ if (i % 6 == 0)
+ DbgPrint("\n\t");
+ }
+ DbgPrint("\n");
+
+ /* Now count the handle counts that are allocated from the handle table */
+ memset(HandleCounts, 0, sizeof(HandleCounts));
+ for (i = 0; i < gHandleTable->nb_handles; i++)
+ HandleCounts[gHandleTable->handles[i].type]++;
+
+ ERR("Total handles count allocated: \n\t");
+ for (i = 1 ;i < USER_HANDLE_TYPE_COUNT; i++)
+ {
+ DbgPrint("%S: %d, ", TypeNames[i], HandleCounts[i]);
+ if (i % 6 == 0)
+ DbgPrint("\n\t");
+ }
+ DbgPrint("\n");
+}
+
+#endif
PUSER_HANDLE_ENTRY handle_to_entry(PUSER_HANDLE_TABLE ht, HANDLE handle )
{
@@ -51,55 +111,12 @@
if (ht->nb_handles >= ht->allocated_handles) /* Need to grow the array */
{
-/**/
- int i, iFree = 0, iWindow = 0, iMenu = 0, iCursorIcon = 0,
- iHook = 0, iCallProc = 0, iAccel = 0, iMonitor = 0, iTimer = 0, iEvent = 0,
iSMWP = 0;
- /**/
- ERR("Out of user handles! Used -> %i, NM_Handle -> %d\n",
gpsi->cHandleEntries, ht->nb_handles);
-//#if 0
- for(i = 0; i < ht->nb_handles; i++)
- {
- switch (ht->handles[i].type)
- {
- case otFree: // Should be zero.
- iFree++;
- break;
- case otWindow:
- iWindow++;
- break;
- case otMenu:
- iMenu++;
- break;
- case otCursorIcon:
- iCursorIcon++;
- break;
- case otHook:
- iHook++;
- break;
- case otCallProc:
- iCallProc++;
- break;
- case otAccel:
- iAccel++;
- break;
- case otMonitor:
- iMonitor++;
- break;
- case otTimer:
- iTimer++;
- break;
- case otEvent:
- iEvent++;
- break;
- case otSMWP:
- iSMWP++;
- default:
- break;
- }
- }
- ERR("Handle Count by Type:\n Free = %d Window = %d Menu = %d CursorIcon = %d
Hook = %d\n CallProc = %d Accel = %d Monitor = %d Timer = %d Event = %d SMWP =
%d\n",
- iFree, iWindow, iMenu, iCursorIcon, iHook, iCallProc, iAccel, iMonitor, iTimer,
iEvent, iSMWP );
-//#endif
+ ERR("Out of user handles! Used -> %i, NM_Handle -> %d\n",
gpsi->cHandleEntries, ht->nb_handles);
+
+#if DBG
+ DbgUserDumpHandleTable();
+#endif
+
return NULL;
#if 0
PUSER_HANDLE_ENTRY new_handles;
@@ -138,6 +155,11 @@
{
PPROCESSINFO ppi = PsGetCurrentProcessWin32Process();
void *ret;
+
+#if DBG
+ ppi->DbgHandleCount[entry->type]--;
+#endif
+
ret = entry->ptr;
entry->ptr = ht->freelist;
entry->type = 0;
@@ -261,11 +283,11 @@
BOOL FASTCALL UserCreateHandleTable(VOID)
{
-
PVOID mem;
+ INT HandleCount = 1024 * 4;
// FIXME: Don't alloc all at once! Must be mapped into umode also...
- mem = UserHeapAlloc(sizeof(USER_HANDLE_ENTRY) * 1024*2);
+ mem = UserHeapAlloc(sizeof(USER_HANDLE_ENTRY) * HandleCount);
if (!mem)
{
ERR("Failed creating handle table\n");
@@ -281,7 +303,7 @@
}
// FIXME: Make auto growable
- UserInitHandleTable(gHandleTable, mem, sizeof(USER_HANDLE_ENTRY) * 1024*2);
+ UserInitHandleTable(gHandleTable, mem, sizeof(USER_HANDLE_ENTRY) * HandleCount);
return TRUE;
}
@@ -339,6 +361,10 @@
return NULL;
}
+#if DBG
+ ppi->DbgHandleCount[type]++;
+#endif
+
RtlZeroMemory(Object, size);
switch (type)
Modified: branches/ros-csrss/win32ss/user/ntuser/object.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/ntuser/o…
==============================================================================
--- branches/ros-csrss/win32ss/user/ntuser/object.h [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/ntuser/object.h [iso-8859-1] Sun Oct 28 10:05:08 2012
@@ -39,6 +39,7 @@
PVOID UserGetObjectNoErr(PUSER_HANDLE_TABLE, HANDLE, USER_OBJECT_TYPE);
BOOL FASTCALL UserCreateHandleTable(VOID);
BOOL FASTCALL UserObjectInDestroy(HANDLE);
+void DbgUserDumpHandleTable();
static __inline VOID
UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Modified: branches/ros-csrss/win32ss/user/ntuser/win32.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/ntuser/w…
==============================================================================
--- branches/ros-csrss/win32ss/user/ntuser/win32.h [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/ntuser/win32.h [iso-8859-1] Sun Oct 28 10:05:08 2012
@@ -195,6 +195,7 @@
PTHREADINFO ptiList;
PTHREADINFO ptiMainThread;
struct _DESKTOP* rpdeskStartup;
+ PPROCESSINFO ppiNext;
PCLS pclsPrivateList;
PCLS pclsPublicList;
INT cThreads;
@@ -224,6 +225,7 @@
#if DBG
BYTE DbgChannelLevel[DbgChCount];
+ DWORD DbgHandleCount[USER_HANDLE_TYPE_COUNT];
#endif
} PROCESSINFO;
Modified: branches/ros-csrss/win32ss/user/ntuser/win32kdebug.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/ntuser/w…
==============================================================================
--- branches/ros-csrss/win32ss/user/ntuser/win32kdebug.h [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/ntuser/win32kdebug.h [iso-8859-1] Sun Oct 28 10:05:08
2012
@@ -125,7 +125,7 @@
#define DBG_ENABLE_CHANNEL(ppi,ch,level) ((ppi)->DbgChannelLevel[ch] |= level)
#define DBG_DISABLE_CHANNEL(ppi,ch,level) ((ppi)->DbgChannelLevel[ch] &=
~level)
- #define DBG_IS_CHANNEL_ENABLED(ppi,ch,level) ((ppi)->DbgChannelLevel[ch] &
level)
+ #define DBG_IS_CHANNEL_ENABLED(ppi,ch,level) (((ppi)->DbgChannelLevel[ch] &
level) == level)
#define DBG_PRINT(ppi,ch,level,fmt, ...) do { \
if((level == ERR_LEVEL) || (ppi && DBG_IS_CHANNEL_ENABLED(ppi,ch,level))) \