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
July 2009
----- 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
27 participants
605 discussions
Start a n
N
ew thread
[janderwald] 42051: [USERINIT] - Move code for playing logon sound to winlogon where it should belong [WINLOGON] - Create a thread for playing the logon sound - Query the status of sysaudio. If sysaudio isnt running yet, wait a second. - Wait for max 20 seconds to get sysaudio running - Finally logon sound should work
by janderwald@svn.reactos.org
Author: janderwald Date: Sat Jul 18 17:19:57 2009 New Revision: 42051 URL:
http://svn.reactos.org/svn/reactos?rev=42051&view=rev
Log: [USERINIT] - Move code for playing logon sound to winlogon where it should belong [WINLOGON] - Create a thread for playing the logon sound - Query the status of sysaudio. If sysaudio isnt running yet, wait a second. - Wait for max 20 seconds to get sysaudio running - Finally logon sound should work Modified: trunk/reactos/base/system/userinit/userinit.c trunk/reactos/base/system/winlogon/winlogon.c Modified: trunk/reactos/base/system/userinit/userinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/userinit/useri…
============================================================================== --- trunk/reactos/base/system/userinit/userinit.c [iso-8859-1] (original) +++ trunk/reactos/base/system/userinit/userinit.c [iso-8859-1] Sat Jul 18 17:19:57 2009 @@ -447,51 +447,6 @@ WARN("RegOpenKeyEx() failed with error %lu\n", rc); } -static VOID -PlayLogonSound() -{ - HKEY hKey; - WCHAR szBuffer[MAX_PATH] = {0}; - WCHAR szDest[MAX_PATH]; - DWORD dwSize = sizeof(szBuffer); - HMODULE hLibrary; - typedef BOOL WINAPI (*PLAYSOUNDW)(LPCWSTR,HMODULE,DWORD); - PLAYSOUNDW Play; - - if (RegOpenKeyExW(HKEY_CURRENT_USER, L"AppEvents\\Schemes\\Apps\\.Default\\WindowsLogon\\.Current", 0, KEY_READ, &hKey) != ERROR_SUCCESS) - { - return; - } - - if (RegQueryValueExW(hKey, NULL, NULL, NULL, (LPBYTE)szBuffer, &dwSize) != ERROR_SUCCESS) - { - RegCloseKey(hKey); - return; - } - - - RegCloseKey(hKey); - - if (!szBuffer[0]) - return; - - - szBuffer[MAX_PATH-1] = L'\0'; - if (ExpandEnvironmentStringsW(szBuffer, szDest, MAX_PATH)) - { - hLibrary = LoadLibraryW(L"winmm.dll"); - if (hLibrary) - { - Play = (PLAYSOUNDW)GetProcAddress(hLibrary, "PlaySoundW"); - if (Play) - { - Play(szDest, NULL, SND_FILENAME); - } - FreeLibrary(hLibrary); - } - } -} - static VOID SetUserSettings(VOID) { @@ -540,7 +495,6 @@ SetUserSettings(); StartShell(); NotifyLogon(); - PlayLogonSound(); return 0; } Modified: trunk/reactos/base/system/winlogon/winlogon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/winlo…
============================================================================== --- trunk/reactos/base/system/winlogon/winlogon.c [iso-8859-1] (original) +++ trunk/reactos/base/system/winlogon/winlogon.c [iso-8859-1] Sat Jul 18 17:19:57 2009 @@ -22,6 +22,94 @@ PWLSESSION WLSession = NULL; /* FUNCTIONS *****************************************************************/ + +DWORD +WINAPI +PlayLogonSoundThread( + IN LPVOID lpParameter) +{ + HKEY hKey; + WCHAR szBuffer[MAX_PATH] = {0}; + WCHAR szDest[MAX_PATH]; + DWORD dwSize = sizeof(szBuffer); + HMODULE hLibrary; + SERVICE_STATUS_PROCESS Info; + typedef BOOL WINAPI (*PLAYSOUNDW)(LPCWSTR,HMODULE,DWORD); + PLAYSOUNDW Play; + ULONG Index = 0; + + if (RegOpenKeyExW(HKEY_CURRENT_USER, L"AppEvents\\Schemes\\Apps\\.Default\\WindowsLogon\\.Current", 0, KEY_READ, &hKey) != ERROR_SUCCESS) + { + ExitThread(0); + } + + if (RegQueryValueExW(hKey, NULL, NULL, NULL, (LPBYTE)szBuffer, &dwSize) != ERROR_SUCCESS) + { + RegCloseKey(hKey); + ExitThread(0); + } + + + RegCloseKey(hKey); + + if (!szBuffer[0]) + ExitThread(0); + + + szBuffer[MAX_PATH-1] = L'\0'; + if (ExpandEnvironmentStringsW(szBuffer, szDest, MAX_PATH)) + { + SC_HANDLE hSCManager, hService; + + hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT); + if (!hSCManager) + ExitThread(0);; + + hService = OpenServiceW(hSCManager, L"sysaudio", GENERIC_READ); + if (!hService) + { + CloseServiceHandle(hSCManager); + TRACE("WL: failed to open sysaudio Status %x", GetLastError()); + ExitThread(0); + } + + do + { + if (!QueryServiceStatusEx(hService, SC_STATUS_PROCESS_INFO, (LPBYTE)&Info, sizeof(SERVICE_STATUS_PROCESS), &dwSize)) + { + TRACE("WL: QueryServiceStatusEx failed %x\n", GetLastError()); + break; + } + + if (Info.dwCurrentState == SERVICE_RUNNING) + break; + + Sleep(1000); + + }while(Index < 20); + + CloseServiceHandle(hService); + CloseServiceHandle(hSCManager); + + if (Info.dwCurrentState != SERVICE_RUNNING) + ExitThread(0); + + + hLibrary = LoadLibraryW(L"winmm.dll"); + if (hLibrary) + { + Play = (PLAYSOUNDW)GetProcAddress(hLibrary, "PlaySoundW"); + if (Play) + { + Play(szDest, NULL, SND_FILENAME); + } + FreeLibrary(hLibrary); + } + } + ExitThread(0); +} + + static BOOL StartServicesManager(VOID) @@ -201,6 +289,7 @@ #endif ULONG HardErrorResponse; MSG Msg; + HANDLE hThread; UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); @@ -317,6 +406,13 @@ else PostMessageW(WLSession->SASWindow, WLX_WM_SAS, WLX_SAS_TYPE_TIMEOUT, 0); + /* Play logon sound */ + hThread = CreateThread(NULL, 0, PlayLogonSoundThread, NULL, 0, NULL); + if (hThread) + { + CloseHandle(hThread); + } + /* Tell kernel that CurrentControlSet is good (needed * to support Last good known configuration boot) */ NtInitializeRegistry(CM_BOOT_FLAG_ACCEPTED);
15 years, 5 months
1
0
0
0
[fireball] 42050: - Include csr.c into the build. - Temporarily add EngGetTickCount implementation to winesup.c. - win32k now fully builds.
by fireball@svn.reactos.org
Author: fireball Date: Sat Jul 18 15:37:05 2009 New Revision: 42050 URL:
http://svn.reactos.org/svn/reactos?rev=42050&view=rev
Log: - Include csr.c into the build. - Temporarily add EngGetTickCount implementation to winesup.c. - win32k now fully builds. Modified: branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild branches/arwinss/reactos/subsystems/win32/win32k/wine/winesup.c Modified: branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild [iso-8859-1] Sat Jul 18 15:37:05 2009 @@ -24,6 +24,7 @@ <pch>win32k.h</pch> </directory> <directory name="main"> + <file>csr.c</file> <file>err.c</file> <file>init.c</file> <file>usrheap.c</file> Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/winesup.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/wine/winesup.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/wine/winesup.c [iso-8859-1] Sat Jul 18 15:37:05 2009 @@ -181,4 +181,20 @@ return NewPtr; } +ULONGLONG +APIENTRY +EngGetTickCount(VOID) +{ + ULONG Multiplier; + LARGE_INTEGER TickCount; + + /* Get the multiplier and current tick count */ + KeQueryTickCount(&TickCount); + Multiplier = SharedUserData->TickCountMultiplier; + + /* Convert to milliseconds and return */ + return (Int64ShrlMod32(UInt32x32To64(Multiplier, TickCount.LowPart), 24) + + (Multiplier * (TickCount.HighPart << 8))); +} + /* EOF */
15 years, 5 months
1
0
0
0
[fireball] 42049: - Fix two memory freeing leftovers.
by fireball@svn.reactos.org
Author: fireball Date: Sat Jul 18 15:35:10 2009 New Revision: 42049 URL:
http://svn.reactos.org/svn/reactos?rev=42049&view=rev
Log: - Fix two memory freeing leftovers. Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/window.c Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/window.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/wine/window.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/wine/window.c [iso-8859-1] Sat Jul 18 15:35:10 2009 @@ -1703,9 +1703,9 @@ if (win->win_region) free_region( win->win_region ); if (win->update_region) free_region( win->update_region ); if (win->class) release_class( win->class ); - free( win->text ); + ExFreePool( win->text ); memset( win, 0x55, sizeof(*win) + win->nb_extra_bytes - 1 ); - free( win ); + ExFreePool( win ); }
15 years, 5 months
1
0
0
0
[fireball] 42048: - Fix some of build problems related to newer headers.
by fireball@svn.reactos.org
Author: fireball Date: Sat Jul 18 15:33:33 2009 New Revision: 42048 URL:
http://svn.reactos.org/svn/reactos?rev=42048&view=rev
Log: - Fix some of build problems related to newer headers. Added: branches/arwinss/reactos/subsystems/win32/win32k/include/csr.h (with props) branches/arwinss/reactos/subsystems/win32/win32k/include/tags.h (with props) Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/request.h branches/arwinss/reactos/subsystems/win32/win32k/include/win32k.h branches/arwinss/reactos/subsystems/win32/win32k/include/win32kp.h branches/arwinss/reactos/subsystems/win32/win32k/main/init.c branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild Added: branches/arwinss/reactos/subsystems/win32/win32k/include/csr.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/csr.h (added) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/csr.h [iso-8859-1] Sat Jul 18 15:33:33 2009 @@ -1,0 +1,8 @@ +#ifndef __WIN32K_CSR_H +#define __WIN32K_CSR_H + +/* Notifies CSR about a new desktop */ +NTSTATUS NTAPI +CsrNotifyCreateDesktop(HDESK Desktop); + +#endif Propchange: branches/arwinss/reactos/subsystems/win32/win32k/include/csr.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/request.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/request.h [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/request.h [iso-8859-1] Sat Jul 18 15:33:33 2009 @@ -28,6 +28,16 @@ #define DECL_HANDLER(name) \ void req_##name( const struct name##_request *req, struct name##_reply *reply ) +extern void *set_reply_data_size( void *req, data_size_t size ); + +extern PVOID RequestData; + +/* get the request vararg data */ +static inline const void *get_req_data() +{ + return RequestData; +} + /* get the request vararg size */ static inline data_size_t get_req_data_size(struct __server_request_info *req) { @@ -38,9 +48,26 @@ static inline void get_req_unicode_str( void *req, struct unicode_str *str ) { struct __server_request_info *serv_req = (struct __server_request_info *)req; - str->str = serv_req->data[0].ptr; + str->str = get_req_data(); str->len = (get_req_data_size(serv_req) / sizeof(WCHAR)) * sizeof(WCHAR); } + +/* get the reply maximum vararg size */ +static inline data_size_t get_reply_max_size(void *req) +{ + struct __server_request_info *serv_req = (struct __server_request_info *)req; + return serv_req->u.req.request_header.reply_size; +} + +/* allocate and fill the reply data */ +static inline void *set_reply_data( void *req, const void *data, data_size_t size ) +{ + void *ret = set_reply_data_size( req, size ); + if (ret) memcpy( ret, data, size ); + return ret; +} + +void set_reply_data_ptr( void *req, void *data, data_size_t size ); /* Everything below this line is generated automatically by tools/make_requests */ /* ### make_requests begin ### */ @@ -529,6 +556,7 @@ (req_handler)req_set_window_layered_info, }; +#if 0 C_ASSERT( sizeof(affinity_t) == 8 ); C_ASSERT( sizeof(apc_call_t) == 40 ); C_ASSERT( sizeof(apc_param_t) == 8 ); @@ -1828,7 +1856,7 @@ C_ASSERT( FIELD_OFFSET(struct set_window_layered_info_request, alpha) == 20 ); C_ASSERT( FIELD_OFFSET(struct set_window_layered_info_request, flags) == 24 ); C_ASSERT( sizeof(struct set_window_layered_info_request) == 32 ); - +#endif #endif /* WANT_REQUEST_HANDLERS */ /* ### make_requests end ### */ Added: branches/arwinss/reactos/subsystems/win32/win32k/include/tags.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/tags.h (added) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/tags.h [iso-8859-1] Sat Jul 18 15:33:33 2009 @@ -1,0 +1,16 @@ +#ifndef _WIN32K_TAGS_H +#define _WIN32K_TAGS_H + +#define TAG_BRUSHOBJ TAG('B', 'R', 'H', 'O') /* brush object */ +#define TAG_CLIP TAG('C', 'L', 'I', 'P') /* clipping */ +#define TAG_CLIPOBJ TAG('C', 'L', 'P', 'O') /* clip object */ +#define TAG_COLORMAP TAG('C', 'O', 'L', 'M') /* color map */ +#define TAG_DFSM TAG('D', 'f', 's', 'm') /* Eng event allocation */ +#define TAG_DIB TAG('D', 'I', 'B', ' ') /* dib */ +#define TAG_DRIVER TAG('G', 'D', 'R', 'V') /* video drivers */ +#define TAG_GSEM TAG('G', 's', 'e', 'm') /* Gdi Semaphore */ +#define TAG_PALETTE TAG('G', 'l', 'a', '8') +#define TAG_RTLREGISTRY TAG('R', 'q', 'r', 'v') /* RTL registry */ +#define TAG_XLATEOBJ TAG('X', 'L', 'A', 'O') /* xlate object */ + +#endif /* _WIN32K_TAGS_H */ Propchange: branches/arwinss/reactos/subsystems/win32/win32k/include/tags.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/win32k.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/win32k.h [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/win32k.h [iso-8859-1] Sat Jul 18 15:33:33 2009 @@ -8,21 +8,14 @@ /* INCLUDES ******************************************************************/ -/* Version Data */ -#undef __MSVCRT__ -#include <psdk/ntverp.h> -#define _WIN32_WINNT _WIN32_WINNT_WS03 -#define NTDDI_VERSION NTDDI_WS03SP1 -#define WINVER 0x600 +#define _NO_COM -/* Initial DDK/IFS Headers */ -#ifdef _MSC_VER -#include <excpt.h> -#include <ntdef.h> -#undef DECLSPEC_IMPORT -#define DECLSPEC_IMPORT -#endif -#include <ntifs.h> +/* DDK/NDK/SDK Headers */ +#include <ddk/ntddk.h> +#include <ddk/ntddmou.h> +#include <ddk/ntifs.h> +#include <ddk/tvout.h> +#include <ndk/ntndk.h> /* Win32 Headers */ /* FIXME: Defines in winbase.h that we need... */ @@ -40,30 +33,14 @@ #include <prntfont.h> #include <dde.h> #include <wincon.h> - -/* This set of headers is greatly incompatible */ -/* TODO: Either fix ddrawi.h + all dependencies, or create a new temporary - header */ #define _NOCSECT_TYPE // #include <ddrawi.h> -typedef LPVOID LPVIDMEM; -typedef LPVOID LPVMEMHEAP; -typedef LPVOID LPSURFACEALIGNMENT; - -/* NDK Headers */ -#include <ntndk.h> /* SEH Support with PSEH */ -#include <pseh/pseh.h> +#include <pseh/pseh2.h> /* CSRSS Header */ #include <csrss/csrss.h> - -/* Helper Header */ -#include <reactos/helper.h> - -/* Probe and capture */ -#include <reactos/probe.h> /* Public Win32K Headers */ #include <win32k/callback.h> @@ -76,3 +53,6 @@ /* Internal Win32K Header */ #include <win32kp.h> + +/* Probe and capture */ +#include <reactos/probe.h> Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/win32kp.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/win32kp.h [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/win32kp.h [iso-8859-1] Sat Jul 18 15:33:33 2009 @@ -25,13 +25,13 @@ //#include <win32k/rosuser.h> /* CSR interaction */ -//#include <csr.h> +#include <csr.h> #include <win32.h> #include <heap.h> #include <tags.h> -#include <dib.h> +//#include <dib.h> /* Eng and GRE stuff */ #if 0 Modified: branches/arwinss/reactos/subsystems/win32/win32k/main/init.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/main/init.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/main/init.c [iso-8859-1] Sat Jul 18 15:33:33 2009 @@ -331,7 +331,7 @@ init_directories(); /* Initialize GDI objects implementation */ - if (!GDIOBJ_Init()) return STATUS_UNSUCCESSFUL; + //if (!GDIOBJ_Init()) return STATUS_UNSUCCESSFUL; /* Init video driver implementation */ //InitDcImpl(); Modified: branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild [iso-8859-1] Sat Jul 18 15:33:33 2009 @@ -4,10 +4,17 @@ <module name="win32k" type="kernelmodedriver" installbase="system32" installname="win32k.sys"> <importlibrary definition="win32k.def" /> <define name="_WIN32K_" /> + + <include base="win32k">.</include> <include base="win32k">include</include> - <include base="win32k" root="intermediate"></include> - <include base="win32k" root="intermediate">include</include> + <include base="win32k" root="intermediate">.</include> + <include base="ntoskrnl">include</include> + <include base="freetype">include</include> <include base="ReactOS">include/reactos/subsys</include> + <include base="ReactOS">include/reactos/drivers</include> + + <compilerflag compilerset="gcc">-fms-extensions</compilerflag> + <library>ntoskrnl</library> <library>hal</library> <library>freetype</library> @@ -22,11 +29,20 @@ <file>usrheap.c</file> </directory> <directory name="wine"> + <file>atom.c</file> <file>class.c</file> + <file>directory.c</file> + <file>handle.c</file> + <file>hook.c</file> <file>main.c</file> <file>object.c</file> + <file>queue.c</file> + <file>region.c</file> <file>stubs.c</file> + <file>user.c</file> + <file>window.c</file> <file>winesup.c</file> + <file>winstation.c</file> </directory> <file>win32k.rc</file> </module>
15 years, 5 months
1
0
0
0
[fireball] 42047: - Implement CSR interaction function - ReactOS specific!
by fireball@svn.reactos.org
Author: fireball Date: Sat Jul 18 15:31:51 2009 New Revision: 42047 URL:
http://svn.reactos.org/svn/reactos?rev=42047&view=rev
Log: - Implement CSR interaction function - ReactOS specific! Added: branches/arwinss/reactos/subsystems/win32/win32k/main/csr.c (with props) Added: branches/arwinss/reactos/subsystems/win32/win32k/main/csr.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/main/csr.c (added) +++ branches/arwinss/reactos/subsystems/win32/win32k/main/csr.c [iso-8859-1] Sat Jul 18 15:31:51 2009 @@ -1,0 +1,209 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * PURPOSE: Interface to csrss. ROS SPECIFIC! + * FILE: subsys/win32k/ntuser/csr.c + * PROGRAMER: Parts are by Ge van Geldorp (ge(a)gse.nl) + */ + +#include <win32k.h> +#include <handle.h> + +//#define NDEBUG +#include <debug.h> + +static HANDLE WindowsApiPort = NULL; +PEPROCESS CsrProcess = NULL; + +VOID NTAPI +RosUserConnectCsrss(void) +{ + NTSTATUS Status; + UNICODE_STRING PortName; + ULONG ConnectInfoLength; + SECURITY_QUALITY_OF_SERVICE Qos; + + RtlInitUnicodeString(&PortName, L"\\Windows\\ApiPort"); + ConnectInfoLength = 0; + Qos.Length = sizeof(Qos); + Qos.ImpersonationLevel = SecurityDelegation; + Qos.ContextTrackingMode = SECURITY_STATIC_TRACKING; + Qos.EffectiveOnly = FALSE; + + Status = ZwConnectPort(&WindowsApiPort, + &PortName, + &Qos, + NULL, + NULL, + NULL, + NULL, + &ConnectInfoLength); + if (! NT_SUCCESS(Status)) + { + DPRINT1("There is a problem connecting to CSRSS, Status=0x%08x\n", Status); + SetLastNtError(Status); + } + + CsrProcess = PsGetCurrentProcess(); + DPRINT("Win32k registered with CSRSS\n"); +} + + +NTSTATUS FASTCALL +co_CsrNotify(PCSR_API_MESSAGE Request) +{ + NTSTATUS Status; + PEPROCESS OldProcess; + + if (NULL == CsrProcess) + { + return STATUS_INVALID_PORT_HANDLE; + } + + Request->Header.u2.ZeroInit = 0; + Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE); + Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE); + + /* Switch to the process in which the WindowsApiPort handle is valid */ + OldProcess = PsGetCurrentProcess(); + if (CsrProcess != OldProcess) + { + KeAttachProcess(&CsrProcess->Pcb); + } + + UserLeave(); + + Status = ZwRequestWaitReplyPort(WindowsApiPort, + &Request->Header, + &Request->Header); + + UserEnterExclusive(); + + if (CsrProcess != OldProcess) + { + KeDetachProcess(); + } + + if (NT_SUCCESS(Status)) + { + Status = Request->Status; + } + + return Status; +} + + +NTSTATUS +APIENTRY +CsrInsertObject(HANDLE ObjectHandle, + ACCESS_MASK DesiredAccess, + PHANDLE Handle) +{ +#ifdef WIN32K_USES_PROPER_OB + NTSTATUS Status; + HANDLE CsrProcessHandle; + OBJECT_ATTRIBUTES ObjectAttributes; + CLIENT_ID Cid; + + /* Put CSR'S CID */ + Cid.UniqueProcess = CsrProcess->UniqueProcessId; + Cid.UniqueThread = 0; + + /* Empty Attributes */ + InitializeObjectAttributes(&ObjectAttributes, + NULL, + 0, + NULL, + NULL); + + /* Get a Handle to Csrss */ + Status = ZwOpenProcess(&CsrProcessHandle, + PROCESS_DUP_HANDLE, + &ObjectAttributes, + &Cid); + + if ((NT_SUCCESS(Status))) + { + /* Duplicate the Handle */ + Status = ZwDuplicateObject(NtCurrentProcess(), + ObjectHandle, + CsrProcessHandle, + Handle, + DesiredAccess, + OBJ_INHERIT, + 0); + + /* Close our handle to CSRSS */ + ZwClose(CsrProcessHandle); + } + + return Status; +#else + /* No csrss - no luck */ + if (!CsrProcess) return STATUS_UNSUCCESSFUL; + + /* Duplicate the handle */ + *Handle = (HANDLE)duplicate_handle(PsGetCurrentProcessWin32Process(), + (obj_handle_t)ObjectHandle, PsGetProcessWin32Process(CsrProcess), 0, 0, DUP_HANDLE_SAME_ACCESS); + + return STATUS_SUCCESS; +#endif +} + +NTSTATUS FASTCALL +CsrCloseHandle(HANDLE Handle) +{ + NTSTATUS Status; + PEPROCESS OldProcess; + + /* Switch to the process in which the handle is valid */ + OldProcess = PsGetCurrentProcess(); + if (CsrProcess != OldProcess) + { + KeAttachProcess(&CsrProcess->Pcb); + } + + Status = ZwClose(Handle); + + if (CsrProcess != OldProcess) + { + KeDetachProcess(); + } + + return Status; +} + +/* Below is a part written by me */ +NTSTATUS +NTAPI +CsrNotifyCreateDesktop(HDESK Desktop) +{ + CSR_API_MESSAGE Request; + NTSTATUS Status; + + /* Create a handle for CSRSS and notify CSRSS */ + Request.Type = MAKE_CSR_API(CREATE_DESKTOP, CSR_GUI); + + /* Create a duplicate handle in csrss's process space */ + Status = CsrInsertObject(Desktop, + GENERIC_ALL, + (HANDLE*)&Request.Data.CreateDesktopRequest.DesktopHandle); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to create desktop handle for CSRSS\n"); + return Status; + } + + /* Notify CSRSS */ + Status = co_CsrNotify(&Request); + if (!NT_SUCCESS(Status)) + { + //CsrCloseHandle(Request.Data.CreateDesktopRequest.DesktopHandle); + DPRINT1("Failed to notify CSRSS about new desktop, Status 0x%08x\n", Status); + return Status; + } + + return STATUS_SUCCESS; +} + +/* EOF */ Propchange: branches/arwinss/reactos/subsystems/win32/win32k/main/csr.c ------------------------------------------------------------------------------ svn:eol-style = native
15 years, 5 months
1
0
0
0
[fireball] 42046: - Port server headers too (use our process/thread structures instead of theirs, etc). - Start improving the win32k private header.
by fireball@svn.reactos.org
Author: fireball Date: Sat Jul 18 14:48:05 2009 New Revision: 42046 URL:
http://svn.reactos.org/svn/reactos?rev=42046&view=rev
Log: - Port server headers too (use our process/thread structures instead of theirs, etc). - Start improving the win32k private header. Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/handle.h branches/arwinss/reactos/subsystems/win32/win32k/include/object.h branches/arwinss/reactos/subsystems/win32/win32k/include/user.h branches/arwinss/reactos/subsystems/win32/win32k/include/win32kp.h Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/handle.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/handle.h [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/handle.h [iso-8859-1] Sat Jul 18 14:48:05 2009 @@ -22,7 +22,6 @@ #define __WINE_SERVER_HANDLE_H #include <stdlib.h> -#include "windef.h" #include "wine/server_protocol.h" struct process; @@ -34,23 +33,23 @@ /* alloc_handle takes a void *obj for convenience, but you better make sure */ /* that the thing pointed to starts with a struct object... */ -extern obj_handle_t alloc_handle( struct process *process, void *obj, +extern obj_handle_t alloc_handle( PPROCESSINFO process, void *obj, unsigned int access, unsigned int attr ); -extern obj_handle_t alloc_handle_no_access_check( struct process *process, void *ptr, +extern obj_handle_t alloc_handle_no_access_check( PPROCESSINFO process, void *ptr, unsigned int access, unsigned int attr ); -extern int close_handle( struct process *process, obj_handle_t handle ); -extern struct object *get_handle_obj( struct process *process, obj_handle_t handle, +extern int close_handle( PPROCESSINFO process, obj_handle_t handle ); +extern struct object *get_handle_obj( PPROCESSINFO process, obj_handle_t handle, unsigned int access, const struct object_ops *ops ); -extern unsigned int get_handle_access( struct process *process, obj_handle_t handle ); -extern obj_handle_t duplicate_handle( struct process *src, obj_handle_t src_handle, struct process *dst, +extern unsigned int get_handle_access( PPROCESSINFO process, obj_handle_t handle ); +extern obj_handle_t duplicate_handle( PPROCESSINFO src, obj_handle_t src_handle, PPROCESSINFO dst, unsigned int access, unsigned int attr, unsigned int options ); extern obj_handle_t open_object( const struct namespace *namespace, const struct unicode_str *name, const struct object_ops *ops, unsigned int access, unsigned int attr ); -extern obj_handle_t find_inherited_handle( struct process *process, const struct object_ops *ops ); -extern obj_handle_t enumerate_handles( struct process *process, const struct object_ops *ops, +extern obj_handle_t find_inherited_handle( PPROCESSINFO process, const struct object_ops *ops ); +extern obj_handle_t enumerate_handles( PPROCESSINFO process, const struct object_ops *ops, unsigned int *index ); -extern struct handle_table *alloc_handle_table( struct process *process, int count ); -extern struct handle_table *copy_handle_table( struct process *process, struct process *parent ); -extern unsigned int get_handle_table_count( struct process *process); +extern struct handle_table *alloc_handle_table( PPROCESSINFO process, int count ); +extern struct handle_table *copy_handle_table( PPROCESSINFO process, PPROCESSINFO parent ); +extern unsigned int get_handle_table_count( PPROCESSINFO process); #endif /* __WINE_SERVER_HANDLE_H */ Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/object.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/object.h [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/object.h [iso-8859-1] Sat Jul 18 14:48:05 2009 @@ -37,7 +37,6 @@ struct object; struct object_name; struct thread; -struct process; struct token; struct file; struct wait_queue_entry; @@ -68,9 +67,9 @@ /* remove a thread from the object wait queue */ void (*remove_queue)(struct object *,struct wait_queue_entry *); /* is object signaled? */ - int (*signaled)(struct object *,struct thread *); + int (*signaled)(struct object *,PTHREADINFO); /* wait satisfied; return 1 if abandoned */ - int (*satisfied)(struct object *,struct thread *); + int (*satisfied)(struct object *,PTHREADINFO); /* signal an object */ int (*signal)(struct object *, unsigned int); /* return an fd object that can be used to read/write from the object */ @@ -87,7 +86,7 @@ struct object *(*open_file)(struct object *, unsigned int access, unsigned int sharing, unsigned int options); /* close a handle to this object */ - int (*close_handle)(struct object *,struct process *,obj_handle_t); + int (*close_handle)(struct object *,PPROCESSINFO,obj_handle_t); /* destroy on refcount == 0 */ void (*destroy)(struct object *); }; @@ -108,7 +107,7 @@ { struct list entry; struct object *obj; - struct thread *thread; + PTHREADINFO thread; }; extern void *mem_alloc( size_t size ); /* malloc wrapper */ @@ -141,7 +140,7 @@ extern struct object *no_lookup_name( struct object *obj, struct unicode_str *name, unsigned int attributes ); extern struct object *no_open_file( struct object *obj, unsigned int access, unsigned int sharing, unsigned int options ); -extern int no_close_handle( struct object *obj, struct process *process, obj_handle_t handle ); +extern int no_close_handle( struct object *obj, PPROCESSINFO process, obj_handle_t handle ); extern void no_destroy( struct object *obj ); #ifdef DEBUG_OBJECTS extern void dump_objects(void); @@ -155,7 +154,7 @@ extern struct event *create_event( struct directory *root, const struct unicode_str *name, unsigned int attr, int manual_reset, int initial_state, const struct security_descriptor *sd ); -extern struct event *get_event_obj( struct process *process, obj_handle_t handle, unsigned int access ); +extern struct event *get_event_obj( PPROCESSINFO process, obj_handle_t handle, unsigned int access ); extern void pulse_event( struct event *event ); extern void set_event( struct event *event ); extern void reset_event( struct event *event ); @@ -174,9 +173,9 @@ /* debugger functions */ -extern int set_process_debugger( struct process *process, struct thread *debugger ); +extern int set_process_debugger( PPROCESSINFO process, struct thread *debugger ); extern void generate_debug_event( struct thread *thread, int code, const void *arg ); -extern void generate_startup_debug_events( struct process *process, client_ptr_t entry ); +extern void generate_startup_debug_events( PPROCESSINFO process, client_ptr_t entry ); extern void debug_exit_thread( struct thread *thread ); /* mapping functions */ @@ -204,7 +203,7 @@ /* directory functions */ -extern struct directory *get_directory_obj( struct process *process, obj_handle_t handle, unsigned int access ); +extern struct directory *get_directory_obj( PPROCESSINFO process, obj_handle_t handle, unsigned int access ); extern struct object *find_object_dir( struct directory *root, const struct unicode_str *name, unsigned int attr, struct unicode_str *name_left ); extern void *create_named_object_dir( struct directory *root, const struct unicode_str *name, Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/user.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/user.h [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/user.h [iso-8859-1] Sat Jul 18 14:48:05 2009 @@ -78,22 +78,22 @@ /* hook functions */ -extern void remove_thread_hooks( struct thread *thread ); +extern void remove_thread_hooks( PTHREADINFO thread ); extern unsigned int get_active_hooks(void); /* queue functions */ -extern void free_msg_queue( struct thread *thread ); -extern struct hook_table *get_queue_hooks( struct thread *thread ); -extern void set_queue_hooks( struct thread *thread, struct hook_table *hooks ); -extern void inc_queue_paint_count( struct thread *thread, int incr ); -extern void queue_cleanup_window( struct thread *thread, user_handle_t win ); -extern int init_thread_queue( struct thread *thread ); -extern int attach_thread_input( struct thread *thread_from, struct thread *thread_to ); -extern void detach_thread_input( struct thread *thread_from ); +extern void free_msg_queue( PTHREADINFO thread ); +extern struct hook_table *get_queue_hooks( PTHREADINFO thread ); +extern void set_queue_hooks( PTHREADINFO thread, struct hook_table *hooks ); +extern void inc_queue_paint_count( PTHREADINFO thread, int incr ); +extern void queue_cleanup_window( PTHREADINFO thread, user_handle_t win ); +extern int init_thread_queue( PTHREADINFO thread ); +extern int attach_thread_input( PTHREADINFO thread_from, PTHREADINFO thread_to ); +extern void detach_thread_input( PTHREADINFO thread_from ); extern void post_message( user_handle_t win, unsigned int message, lparam_t wparam, lparam_t lparam ); -extern void post_win_event( struct thread *thread, unsigned int event, +extern void post_win_event( PTHREADINFO thread, unsigned int event, user_handle_t win, unsigned int object_id, unsigned int child_id, client_ptr_t proc, const WCHAR *module, data_size_t module_size, @@ -126,23 +126,23 @@ /* window functions */ -extern struct process *get_top_window_owner( struct desktop *desktop ); +extern PPROCESSINFO get_top_window_owner( struct desktop *desktop ); extern void close_desktop_window( struct desktop *desktop ); extern void destroy_window( struct window *win ); -extern void destroy_thread_windows( struct thread *thread ); +extern void destroy_thread_windows( PTHREADINFO thread ); extern int is_child_window( user_handle_t parent, user_handle_t child ); extern int is_top_level_window( user_handle_t window ); extern int is_window_visible( user_handle_t window ); extern int make_window_active( user_handle_t window ); -extern struct thread *get_window_thread( user_handle_t handle ); +extern PTHREADINFO get_window_thread( user_handle_t handle ); extern user_handle_t window_from_point( struct desktop *desktop, int x, int y ); -extern user_handle_t find_window_to_repaint( user_handle_t parent, struct thread *thread ); +extern user_handle_t find_window_to_repaint( user_handle_t parent, PTHREADINFO thread ); extern struct window_class *get_window_class( user_handle_t window ); /* window class functions */ -extern void destroy_process_classes( struct process *process ); -extern struct window_class *grab_class( struct process *process, atom_t atom, +extern void destroy_process_classes( PPROCESSINFO process ); +extern struct window_class *grab_class( PPROCESSINFO process, atom_t atom, mod_handle_t instance, int *extra_bytes ); extern void release_class( struct window_class *class ); extern int is_desktop_class( struct window_class *class ); @@ -152,13 +152,13 @@ /* windows station functions */ -extern struct desktop *get_desktop_obj( struct process *process, obj_handle_t handle, unsigned int access ); -extern struct winstation *get_process_winstation( struct process *process, unsigned int access ); -extern struct desktop *get_thread_desktop( struct thread *thread, unsigned int access ); -extern void connect_process_winstation( struct process *process, struct thread *parent ); -extern void set_process_default_desktop( struct process *process, struct desktop *desktop, +extern struct desktop *get_desktop_obj( PPROCESSINFO process, obj_handle_t handle, unsigned int access ); +extern struct winstation *get_process_winstation( PPROCESSINFO process, unsigned int access ); +extern struct desktop *get_thread_desktop( PTHREADINFO thread, unsigned int access ); +extern void connect_process_winstation( PPROCESSINFO process, PTHREADINFO parent ); +extern void set_process_default_desktop( PPROCESSINFO process, struct desktop *desktop, obj_handle_t handle ); -extern void close_process_desktop( struct process *process ); -extern void close_thread_desktop( struct thread *thread ); +extern void close_process_desktop( PPROCESSINFO process ); +extern void close_thread_desktop( PTHREADINFO thread ); #endif /* __WINE_SERVER_USER_H */ Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/win32kp.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/win32kp.h [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/win32kp.h [iso-8859-1] Sat Jul 18 14:48:05 2009 @@ -14,11 +14,41 @@ /* Prototypes */ W32KAPI UINT APIENTRY wine_server_call(void *req_ptr); -/* Internal Win32K Headers */ +/* Internal Win32K Headers */ #include <error.h> + +/* Wine protocol */ #include <wine/server_protocol.h> + +/* RosGdi syscalls */ +//#include <ntrosgdi.h> +//#include <win32k/rosuser.h> + +/* CSR interaction */ +//#include <csr.h> + #include <win32.h> #include <heap.h> +#include <tags.h> + +#include <dib.h> + +/* Eng and GRE stuff */ +#if 0 +#include <driver.h> +#include <engevent.h> +#include <devobj.h> +#include <gdiobj.h> +#include <surfobj.h> +#include <brushobj.h> +#include <dc.h> +#include <palobj.h> +#include <clipobj.h> +#include <floatobj.h> +#include <xformobj.h> +#include <xlateobj.h> +#include <gre.h> +#endif #include "winesup.h" @@ -43,4 +73,15 @@ struct __server_iovec data[__SERVER_MAX_DATA]; /* request variable size data */ }; +/* TODO: Move to eng.h */ +ULONGLONG +APIENTRY +EngGetTickCount(VOID); + +/* TODO: Move to user.h */ +VOID UserEnterExclusive(VOID); +VOID UserLeave(VOID); +VOID UserCleanup(VOID); +VOID UserInitialize(VOID); + #endif
15 years, 5 months
1
0
0
0
[fireball] 42045: - Improve header for ported code.
by fireball@svn.reactos.org
Author: fireball Date: Sat Jul 18 14:46:44 2009 New Revision: 42045 URL:
http://svn.reactos.org/svn/reactos?rev=42045&view=rev
Log: - Improve header for ported code. Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/winesup.h Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/winesup.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/winesup.h [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/winesup.h [iso-8859-1] Sat Jul 18 14:46:44 2009 @@ -11,12 +11,58 @@ /* INCLUDES ******************************************************************/ +/* from wine/unicode.h */ +#define memicmpW(s1,s2,n) _wcsnicmp((const wchar_t *)(s1),(const wchar_t *)(s2),(n)) +#define strlenW(s) wcslen((const wchar_t *)(s)) +#define strcpyW(d,s) wcscpy((wchar_t *)(d),(const wchar_t *)(s)) +#define strcatW(d,s) wcscat((wchar_t *)(d),(const wchar_t *)(s)) +#define strcspnW(d,s) wcscspn((wchar_t *)(d),(const wchar_t *)(s)) +#define strstrW(d,s) wcsstr((const wchar_t *)(d),(const wchar_t *)(s)) +#define strtolW(s,e,b) wcstol((const wchar_t *)(s),(wchar_t **)(e),(b)) +#define strchrW(s,c) wcschr((const wchar_t *)(s),(wchar_t)(c)) +#define strrchrW(s,c) wcsrchr((const wchar_t *)(s),(wchar_t)(c)) +#define strncmpW(s1,s2,n) wcsncmp((const wchar_t *)(s1),(const wchar_t *)(s2),(n)) +#define strncpyW(s1,s2,n) wcsncpy((wchar_t *)(s1),(const wchar_t *)(s2),(n)) +#define strcmpW(s1,s2) wcscmp((const wchar_t *)(s1),(const wchar_t *)(s2)) +#define strcmpiW(s1,s2) _wcsicmp((const wchar_t *)(s1),(const wchar_t *)(s2)) +#define strncmpiW(s1,s2,n) _wcsnicmp((const wchar_t *)(s1),(const wchar_t *)(s2),(n)) +#define strtoulW(s1,s2,b) wcstoul((const wchar_t *)(s1),(wchar_t **)(s2),(b)) +#define strspnW(str, accept) wcsspn((const wchar_t *)(str), (const wchar_t *)(accept)) +#define tolowerW(n) towlower((n)) +#define toupperW(n) towupper((n)) +#define islowerW(n) iswlower((n)) +#define isupperW(n) iswupper((n)) +#define isalphaW(n) iswalpha((n)) +#define isalnumW(n) iswalnum((n)) +#define isdigitW(n) iswdigit((n)) +#define isxdigitW(n) iswxdigit((n)) +#define isspaceW(n) iswspace((n)) +#define atoiW(s) _wtoi((const wchar_t *)(s)) +#define atolW(s) _wtol((const wchar_t *)(s)) +#define strlwrW(s) _wcslwr((wchar_t *)(s)) +#define struprW(s) _wcsupr((wchar_t *)(s)) +#define sprintfW swprintf +#define vsprintfW vswprintf +#define snprintfW _snwprintf +#define vsnprintfW _vsnwprintf + +#define set_win32_error(x) SetLastWin32Error(x) #define assert ASSERT -#define tolowerW(n) towlower((n)) -#define strncmpiW(s1,s2,n) _wcsnicmp((const wchar_t *)(s1),(const wchar_t *)(s2),(n)) -#define set_win32_error(x) SetLastWin32Error(x) +/* HACK */ +int memcmp(const void *s1, const void *s2, size_t n); + +/* from winbase.h */ +#define HANDLE_FLAG_INHERIT 0x00000001 +#define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x00000002 + +/* from winuser.h */ +#define XBUTTON1 0x0001 +#define XBUTTON2 0x0002 + +// misc stuff, should be moved elsewhere void set_error( unsigned int err ); +unsigned int get_error(void); static inline void clear_error(void) { set_error(0); } struct window_class* get_window_class( user_handle_t window ); @@ -62,10 +108,78 @@ return NULL; } +static inline wchar_t *memchrW( const wchar_t *ptr, wchar_t ch, size_t n ) +{ + const wchar_t *end; + for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) return (wchar_t *)(ULONG_PTR)ptr; + return NULL; +} + + int dump_strW( const WCHAR *str, data_size_t len, FILE *f, const char escape[2] ); const SID *token_get_user( void *token ); +static inline int sd_is_valid( const struct security_descriptor *sd, data_size_t size ) { return TRUE; }; +struct object; +static inline int check_object_access(struct object *obj, unsigned int *access) { return TRUE; }; -// misc stuff, should be moved elsewhere -#define DESKTOP_ATOM ((atom_t)32769) +// timeout stuff +struct timeout_user; +enum timeout_t; +typedef PKDEFERRED_ROUTINE timeout_callback; +#define TICKS_PER_SEC 10000000 +void remove_timeout_user( struct timeout_user *user ); +struct timeout_user *add_timeout_user( timeout_t when, timeout_callback func, void *private ); + +void wake_up( struct object *obj, int max ); + +thread_id_t get_thread_id (PTHREADINFO Thread); +process_id_t get_process_id(PPROCESSINFO Process); + +// fd stuff +struct wait_queue_entry; + +struct fd {}; + +struct event {}; + +struct async_queue {}; + +unsigned int default_fd_map_access( struct object *obj, unsigned int access ); +void set_fd_events( struct fd *fd, int events ); +int check_fd_events( struct fd *fd, int events ); +void *get_fd_user( struct fd *fd ); +int add_queue( struct object *obj, struct wait_queue_entry *entry ); +void remove_queue( struct object *obj, struct wait_queue_entry *entry ); + +#define POLLIN 0x0001 +#define POLLPRI 0x0002 +#define POLLOUT 0x0004 +#define POLLERR 0x0008 +#define POLLHUP 0x0010 +#define POLLNVAL 0x0020 + +/* operations valid on file descriptor objects */ +struct fd_ops +{ + /* get the events we want to poll() for on this object */ + int (*get_poll_events)(struct fd *); + /* a poll() event occurred */ + void (*poll_event)(struct fd *,int event); + /* flush the object buffers */ + void (*flush)(struct fd *, struct event **); + /* get file information */ + enum server_fd_type (*get_fd_type)(struct fd *fd); + /* perform an ioctl on the file */ + obj_handle_t (*ioctl)(struct fd *fd, ioctl_code_t code, const async_data_t *async, int blocking, + const void *data, data_size_t size); + /* queue an async operation */ + void (*queue_async)(struct fd *, const async_data_t *data, int type, int count); + /* selected events for async i/o need an update */ + void (*reselect_async)( struct fd *, struct async_queue *queue ); + /* cancel an async operation */ + void (*cancel_async)(struct fd *); +}; + +PVOID NTAPI ExReallocPool(PVOID OldPtr, ULONG NewSize, ULONG OldSize); #endif
15 years, 5 months
1
0
0
0
[fireball] 42044: - Use custom PROCESSINFO and THREADINFO structures for keeping Win32 specific information.
by fireball@svn.reactos.org
Author: fireball Date: Sat Jul 18 14:44:11 2009 New Revision: 42044 URL:
http://svn.reactos.org/svn/reactos?rev=42044&view=rev
Log: - Use custom PROCESSINFO and THREADINFO structures for keeping Win32 specific information. Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/win32.h Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/win32.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/win32.h [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/win32.h [iso-8859-1] Sat Jul 18 14:44:11 2009 @@ -2,20 +2,6 @@ #define __INCLUDE_NAPI_WIN32_H typedef struct _WIN32HEAP WIN32HEAP, *PWIN32HEAP; - -#include <pshpack1.h> -typedef struct _W32THREAD -{ - PETHREAD pEThread; -} W32THREAD, *PW32THREAD; - -typedef struct _THREADINFO -{ - W32THREAD W32Thread; - PVOID ppi; // FIXME: use PPROCESSINFO -} THREADINFO, *PTHREADINFO; - -#include <poppack.h> typedef struct _W32HEAP_USER_MAPPING { @@ -31,6 +17,24 @@ PEPROCESS peProcess; W32HEAP_USER_MAPPING HeapMappings; LIST_ENTRY Classes; /* window classes owned by the process */ -} PROCESSINFO, *PPROCESSINFO; + struct handle_table *handles; /* handle entries */ + struct event *idle_event; /* event for input idle */ + struct msg_queue *queue; /* main message queue */ + obj_handle_t winstation; /* main handle to process window station */ + obj_handle_t desktop; /* handle to desktop to use for new threads */ +} PROCESSINFO; + +#include <pshpack1.h> + +typedef struct _THREADINFO +{ + PETHREAD peThread; + PPROCESSINFO process; + struct msg_queue *queue; /* message queue */ + obj_handle_t desktop; /* desktop handle */ + int desktop_users; /* number of objects using the thread desktop */ +} THREADINFO, *PTHREADINFO; + +#include <poppack.h> #endif /* __INCLUDE_NAPI_WIN32_H */
15 years, 5 months
1
0
0
0
[fireball] 42043: - Fix win32k process and thread callouts. - Do proper initialization.
by fireball@svn.reactos.org
Author: fireball Date: Sat Jul 18 14:41:27 2009 New Revision: 42043 URL:
http://svn.reactos.org/svn/reactos?rev=42043&view=rev
Log: - Fix win32k process and thread callouts. - Do proper initialization. Modified: branches/arwinss/reactos/subsystems/win32/win32k/main/init.c Modified: branches/arwinss/reactos/subsystems/win32/win32k/main/init.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/main/init.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/main/init.c [iso-8859-1] Sat Jul 18 14:41:27 2009 @@ -13,8 +13,12 @@ /* System service call table */ #include <include/napi.h> -//#define NDEBUG +#include <handle.h> + +#define NDEBUG #include <debug.h> + +void init_directories(void); /* GLOBALS *******************************************************************/ @@ -34,25 +38,8 @@ /* Get the Win32 Process */ Win32Process = PsGetProcessWin32Process(Process); - - /* Allocate one if needed */ - if (!Win32Process) - { - /* FIXME - lock the process */ - Win32Process = ExAllocatePoolWithTag(NonPagedPool, - sizeof(PROCESSINFO), - TAG('W', '3', '2', 'p')); - - if (!Win32Process) - return STATUS_NO_MEMORY; - - RtlZeroMemory(Win32Process, sizeof(PROCESSINFO)); - - PsSetProcessWin32Process(Process, Win32Process); - /* FIXME - unlock the process */ - } - - if (Create) + DPRINT("Win32Process %p, Create %d\n", Win32Process, Create); + if (Create && !Win32Process) { SIZE_T ViewSize = 0; LARGE_INTEGER Offset; @@ -60,6 +47,20 @@ NTSTATUS Status; extern PSECTION_OBJECT GlobalUserHeapSection; DPRINT("Creating W32 process PID:%d at IRQ level: %lu\n", Process->UniqueProcessId, KeGetCurrentIrql()); + + /* Allocate one if needed */ + /* FIXME - lock the process */ + Win32Process = ExAllocatePoolWithTag(NonPagedPool, + sizeof(PROCESSINFO), + TAG('W', '3', '2', 'p')); + + if (!Win32Process) return STATUS_NO_MEMORY; + + RtlZeroMemory(Win32Process, sizeof(PROCESSINFO)); + + PsSetProcessWin32Process(Process, Win32Process); + Win32Process->peProcess = Process; + /* FIXME - unlock the process */ /* map the global heap into the process */ Offset.QuadPart = 0; @@ -82,7 +83,9 @@ Win32Process->HeapMappings.KernelMapping = (PVOID)GlobalUserHeap; Win32Process->HeapMappings.UserMapping = UserBase; Win32Process->HeapMappings.Count = 1; + InitializeListHead(&Win32Process->Classes); + Win32Process->handles = alloc_handle_table(Win32Process, 0); } else { @@ -100,14 +103,16 @@ { struct _EPROCESS *Process; PTHREADINFO Win32Thread; - - DPRINT("Enter Win32kThreadCallback\n"); + PPROCESSINFO Win32Process; + + DPRINT("Enter Win32kThreadCallback, current thread id %d, process id %d\n", PsGetCurrentThread()->Tcb.Teb->ClientId.UniqueThread, PsGetCurrentThread()->Tcb.Teb->ClientId.UniqueProcess); Process = Thread->ThreadsProcess; - /* Get the Win32 Thread */ + /* Get the Win32 Thread and Process */ Win32Thread = PsGetThreadWin32Thread(Thread); - + Win32Process = PsGetProcessWin32Process(Process); + DPRINT("Win32 thread %p, process %p\n", Win32Thread, Win32Process); /* Allocate one if needed */ if (!Win32Thread) { @@ -126,28 +131,15 @@ } if (Type == PsW32ThreadCalloutInitialize) { - //PTEB pTeb; - - DPRINT("Creating W32 thread TID:%d at IRQ level: %lu\n", Thread->Cid.UniqueThread, KeGetCurrentIrql()); - - Win32Thread->ppi = PsGetCurrentProcessWin32Process(); - /*pTeb = NtCurrentTeb(); - if (pTeb) - { - Win32Thread->pClientInfo = (PCLIENTINFO)pTeb->Win32ClientInfo; - Win32Thread->pClientInfo->pClientThreadInfo = NULL; - }*/ + DPRINT("Creating W32 thread TID:%d at IRQ level: %lu. Win32Process %p\n", Thread->Tcb.Teb->ClientId.UniqueThread, KeGetCurrentIrql(), Win32Process); + + Win32Thread->process = Win32Process; + Win32Thread->peThread = Thread; + Win32Thread->desktop = Win32Process->desktop; } else { - DPRINT("Destroying W32 thread TID:%d at IRQ level: %lu\n", Thread->Cid.UniqueThread, KeGetCurrentIrql()); - - /*if (Win32Thread->ThreadInfo != NULL) - { - UserHeapFree(Win32Thread->ThreadInfo); - Win32Thread->ThreadInfo = NULL; - }*/ - + DPRINT("Destroying W32 thread TID:%d at IRQ level: %lu\n", Thread->Tcb.Teb->ClientId.UniqueThread, KeGetCurrentIrql()); PsSetThreadWin32Thread(Thread, NULL); } @@ -160,7 +152,7 @@ APIENTRY Win32kGlobalAtomTableCallout(VOID) { - UNIMPLEMENTED; + DPRINT("Win32kGlobalAtomTableCallout() is UNIMPLEMENTED\n"); return STATUS_SUCCESS; } @@ -322,6 +314,9 @@ /* Register them */ PsEstablishWin32Callouts(&CalloutData); + /* Initialize user implementation */ + UserInitialize(); + /* Create global heap */ GlobalUserHeap = UserCreateHeap(&GlobalUserHeapSection, &GlobalUserHeapBase, @@ -332,5 +327,14 @@ return STATUS_UNSUCCESSFUL; } - return STATUS_SUCCESS; -} + /* Init object directories implementation */ + init_directories(); + + /* Initialize GDI objects implementation */ + if (!GDIOBJ_Init()) return STATUS_UNSUCCESSFUL; + + /* Init video driver implementation */ + //InitDcImpl(); + + return STATUS_SUCCESS; +}
15 years, 5 months
1
0
0
0
[fireball] 42042: - Implement set_error, get_error. - Implement add_timeout_user, remove_timeout_user (Testmode implementation! Currently leaks memory!). - Implement a ExReallocPool routine. The name is stupid, but it reallocates the given paged pool to another (smaller or bigger) size preserving the data. - Other misc routines needed for ported server code.
by fireball@svn.reactos.org
Author: fireball Date: Sat Jul 18 14:38:04 2009 New Revision: 42042 URL:
http://svn.reactos.org/svn/reactos?rev=42042&view=rev
Log: - Implement set_error, get_error. - Implement add_timeout_user, remove_timeout_user (Testmode implementation! Currently leaks memory!). - Implement a ExReallocPool routine. The name is stupid, but it reallocates the given paged pool to another (smaller or bigger) size preserving the data. - Other misc routines needed for ported server code. Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/winesup.c Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/winesup.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/wine/winesup.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/wine/winesup.c [iso-8859-1] Sat Jul 18 14:38:04 2009 @@ -10,23 +10,175 @@ #include <win32k.h> +#undef LIST_FOR_EACH +#undef LIST_FOR_EACH_SAFE +#include "object.h" + #define NDEBUG #include <debug.h> + +timeout_t current_time = 0ULL; +int debug_level = 0; /* PRIVATE FUNCTIONS *********************************************************/ void set_error( unsigned int err ) { + SetLastNtError(err); +} + +unsigned int get_error(void) +{ + return GetLastNtError(); } const SID *token_get_user( void *token ) { + UNIMPLEMENTED; return NULL; } -struct window_class* get_window_class( user_handle_t window ) +struct timeout_user *add_timeout_user( timeout_t when, timeout_callback func, void *private ) { - return NULL; + PKTIMER Timer; + PKDPC Dpc; + LARGE_INTEGER DueTime; + + DueTime.QuadPart = (LONGLONG)when; + + DPRINT1("add_timeout_user(when %I64d, func %p)\n", when, func); + + Timer = ExAllocatePool(NonPagedPool, sizeof(KTIMER)); + KeInitializeTimer(Timer); + + Dpc = ExAllocatePool(NonPagedPool, sizeof(KDPC)); + KeInitializeDpc(Dpc, func, private); + + KeSetTimer(Timer, DueTime, Dpc); + + return (struct timeout_user *)Timer; +} + +/* remove a timeout user */ +void remove_timeout_user( struct timeout_user *user ) +{ + PKTIMER Timer = (PKTIMER)user; + DPRINT1("remove_timeout_user %p\n", user); + + KeCancelTimer(Timer); + ExFreePool(Timer); + + // FIXME: Dpc memory is not freed! +} + +/* default map_access() routine for objects that behave like an fd */ +unsigned int default_fd_map_access( struct object *obj, unsigned int access ) +{ + if (access & GENERIC_READ) access |= FILE_GENERIC_READ; + if (access & GENERIC_WRITE) access |= FILE_GENERIC_WRITE; + if (access & GENERIC_EXECUTE) access |= FILE_GENERIC_EXECUTE; + if (access & GENERIC_ALL) access |= FILE_ALL_ACCESS; + return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL); +} + +thread_id_t get_thread_id (PTHREADINFO Thread) +{ + return (thread_id_t)Thread->peThread->Cid.UniqueThread; +} + +process_id_t get_process_id(PPROCESSINFO Process) +{ + return (process_id_t)Process->peProcess->UniqueProcessId; +} + +void wake_up( struct object *obj, int max ) +{ + struct list *ptr, *next; + + LIST_FOR_EACH_SAFE( ptr, next, &obj->wait_queue ) + { + struct wait_queue_entry *entry = LIST_ENTRY( ptr, struct wait_queue_entry, entry ); + DPRINT1("wake_thread 0x%x / process 0x%x\n", + entry->thread->peThread->Tcb.Teb->ClientId.UniqueThread, + entry->thread->peThread->Tcb.Teb->ClientId.UniqueProcess); + /*if (wake_thread( entry->thread )) + { + if (max && !--max) break; + }*/ + } +} + +void set_fd_events( struct fd *fd, int events ) +{ + UNIMPLEMENTED; +} + +int check_fd_events( struct fd *fd, int events ) +{ + UNIMPLEMENTED; + return 0; +} + +/* add a thread to an object wait queue; return 1 if OK, 0 on error */ +int add_queue( struct object *obj, struct wait_queue_entry *entry ) +{ +#if 0 + grab_object( obj ); + entry->obj = obj; + list_add_tail( &obj->wait_queue, &entry->entry ); +#else + UNIMPLEMENTED; +#endif + return 1; +} + +/* remove a thread from an object wait queue */ +void remove_queue( struct object *obj, struct wait_queue_entry *entry ) +{ +#if 0 + list_remove( &entry->entry ); + release_object( obj ); +#else + UNIMPLEMENTED; +#endif +} + +void set_event( struct event *event ) +{ + UNIMPLEMENTED; +} + +void reset_event( struct event *event ) +{ + UNIMPLEMENTED; +} + +/* Stupid thing to hack around missing export of memcmp from the kernel */ +int memcmp(const void *s1, const void *s2, size_t n) +{ + if (n != 0) { + const unsigned char *p1 = s1, *p2 = s2; + do { + if (*p1++ != *p2++) + return (*--p1 - *--p2); + } while (--n != 0); + } + return 0; +} + +PVOID +NTAPI +ExReallocPool(PVOID OldPtr, ULONG NewSize, ULONG OldSize) +{ + PVOID NewPtr = ExAllocatePool(PagedPool, NewSize); + + if (OldPtr) + { + RtlCopyMemory(NewPtr, OldPtr, (NewSize < OldSize) ? NewSize : OldSize); + ExFreePool(OldPtr); + } + + return NewPtr; } /* EOF */
15 years, 5 months
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
61
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Results per page:
10
25
50
100
200