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
August 2005
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
23 participants
669 discussions
Start a n
N
ew thread
[weiden] 17529: implemented RegSetKeyValueA/W
by weiden@svn.reactos.com
implemented RegSetKeyValueA/W Modified: trunk/reactos/lib/advapi32/advapi32.def Modified: trunk/reactos/lib/advapi32/reg/reg.c _____ Modified: trunk/reactos/lib/advapi32/advapi32.def --- trunk/reactos/lib/advapi32/advapi32.def 2005-08-24 23:33:34 UTC (rev 17528) +++ trunk/reactos/lib/advapi32/advapi32.def 2005-08-24 23:44:27 UTC (rev 17529) @@ -513,6 +513,8 @@ ;RegSaveKeyExW RegSaveKeyW@12 RegSetKeySecurity@12 +RegSetKeyValueA@24 +RegSetKeyValueW@24 RegSetValueA@20 RegSetValueExA@24 RegSetValueExW@24 _____ Modified: trunk/reactos/lib/advapi32/reg/reg.c --- trunk/reactos/lib/advapi32/reg/reg.c 2005-08-24 23:33:34 UTC (rev 17528) +++ trunk/reactos/lib/advapi32/reg/reg.c 2005-08-24 23:44:27 UTC (rev 17529) @@ -803,6 +803,138 @@ /*********************************************************************** * + * RegSetKeyValueW + * + * @implemented + */ +LONG STDCALL +RegSetKeyValueW(IN HKEY hKey, + IN LPCWSTR lpSubKey OPTIONAL, + IN LPCWSTR lpValueName OPTIONAL, + IN DWORD dwType, + IN LPCVOID lpData OPTIONAL, + IN DWORD cbData) +{ + HANDLE KeyHandle, SubKeyHandle = NULL; + NTSTATUS Status; + LONG Ret; + + Status = MapDefaultKey(&KeyHandle, + hKey); + if (!NT_SUCCESS(Status)) + { + return RtlNtStatusToDosError(Status); + } + + if (lpSubKey != NULL) + { + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING SubKeyName; + + RtlInitUnicodeString(&SubKeyName, + (LPWSTR)lpSubKey); + + InitializeObjectAttributes(&ObjectAttributes, + &SubKeyName, + OBJ_CASE_INSENSITIVE, + KeyHandle, + NULL); + + Status = NtOpenKey(&SubKeyHandle, + KEY_SET_VALUE, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + return RtlNtStatusToDosError(Status); + } + } + + Ret = RegSetValueExW((SubKeyHandle != NULL) ? SubKeyHandle : KeyHandle, + lpValueName, + 0, + dwType, + lpData, + cbData); + + if (SubKeyHandle != NULL) + { + NtClose(SubKeyHandle); + } + + return Ret; +} + + +/********************************************************************** ** + * RegSetKeyValueA + * + * @implemented + */ +LONG STDCALL +RegSetKeyValueA(IN HKEY hKey, + IN LPCSTR lpSubKey OPTIONAL, + IN LPCSTR lpValueName OPTIONAL, + IN DWORD dwType, + IN LPCVOID lpData OPTIONAL, + IN DWORD cbData) +{ + HANDLE KeyHandle, SubKeyHandle = NULL; + NTSTATUS Status; + LONG Ret; + + Status = MapDefaultKey(&KeyHandle, + hKey); + if (!NT_SUCCESS(Status)) + { + return RtlNtStatusToDosError(Status); + } + + if (lpSubKey != NULL) + { + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING SubKeyName; + + if (!RtlCreateUnicodeStringFromAsciiz(&SubKeyName, + (LPSTR)lpSubKey)) + { + return RtlNtStatusToDosError(Status); + } + + InitializeObjectAttributes(&ObjectAttributes, + &SubKeyName, + OBJ_CASE_INSENSITIVE, + KeyHandle, + NULL); + + Status = NtOpenKey(&SubKeyHandle, + KEY_SET_VALUE, + &ObjectAttributes); + + RtlFreeUnicodeString(&SubKeyName); + + if (!NT_SUCCESS(Status)) + { + return RtlNtStatusToDosError(Status); + } + } + + Ret = RegSetValueExA((SubKeyHandle != NULL) ? SubKeyHandle : KeyHandle, + lpValueName, + 0, + dwType, + lpData, + cbData); + + if (SubKeyHandle != NULL) + { + NtClose(SubKeyHandle); + } + + return Ret; +} + + +/********************************************************************** ** * RegDeleteValueA * * @implemented
19 years, 4 months
1
0
0
0
[greatlrd] 17528: fixing a bug in searching for cmd for bat/cmd files, thx ravelo to found this stupied bug
by greatlrd@svn.reactos.com
fixing a bug in searching for cmd for bat/cmd files, thx ravelo to found this stupied bug Modified: trunk/reactos/subsys/system/cmd/start.c _____ Modified: trunk/reactos/subsys/system/cmd/start.c --- trunk/reactos/subsys/system/cmd/start.c 2005-08-24 23:29:51 UTC (rev 17527) +++ trunk/reactos/subsys/system/cmd/start.c 2005-08-24 23:33:34 UTC (rev 17528) @@ -130,11 +130,12 @@ error_bad_command (); return 1; } - - memcpy(&szFullCmdLine[_tcslen(szFullCmdLine)],_T("\" /K "), 5 * sizeof(TCHAR)); - memcpy(&szFullCmdLine[_tcslen(szFullCmdLine)], szFullName, _tcslen(szFullName) * sizeof(TCHAR)); - memcpy(&szFullCmdLine[1], &szFullCmdLine[2], _tcslen(szFullCmdLine) * sizeof(TCHAR)); - szFullCmdLine[0] = _T('\"'); + + memcpy(&szFullCmdLine[_tcslen(szFullCmdLine)],_T("\" /K "), 5 * sizeof(TCHAR)); + memcpy(&szFullCmdLine[_tcslen(szFullCmdLine)], szFullName, _tcslen(szFullName) * sizeof(TCHAR)); + memcpy(&szFullCmdLine[1], &szFullCmdLine[0], _tcslen(szFullCmdLine) * sizeof(TCHAR)); + szFullCmdLine[0] = _T('\"'); + } #ifdef _DEBUG
19 years, 4 months
1
0
0
0
[weiden] 17527: implemented RegDeleteKeyValueA/W()
by weiden@svn.reactos.com
implemented RegDeleteKeyValueA/W() Modified: trunk/reactos/lib/advapi32/advapi32.def Modified: trunk/reactos/lib/advapi32/reg/reg.c _____ Modified: trunk/reactos/lib/advapi32/advapi32.def --- trunk/reactos/lib/advapi32/advapi32.def 2005-08-24 23:07:51 UTC (rev 17526) +++ trunk/reactos/lib/advapi32/advapi32.def 2005-08-24 23:29:51 UTC (rev 17527) @@ -473,6 +473,8 @@ RegCreateKeyW@12 RegDeleteKeyA@8 RegDeleteKeyW@8 +RegDeleteKeyValueA@12 +RegDeleteKeyValueW@12 RegDeleteValueA@8 RegDeleteValueW@8 ;RegDisablePredefinedCache _____ Modified: trunk/reactos/lib/advapi32/reg/reg.c --- trunk/reactos/lib/advapi32/reg/reg.c 2005-08-24 23:07:51 UTC (rev 17526) +++ trunk/reactos/lib/advapi32/reg/reg.c 2005-08-24 23:29:51 UTC (rev 17527) @@ -690,6 +690,119 @@ /*********************************************************************** * + * RegDeleteKeyValueW + * + * @implemented + */ +LONG STDCALL +RegDeleteKeyValueW(IN HKEY hKey, + IN LPCWSTR lpSubKey OPTIONAL, + IN LPCWSTR lpValueName OPTIONAL) +{ + UNICODE_STRING ValueName; + HANDLE KeyHandle, SubKeyHandle = NULL; + NTSTATUS Status; + + Status = MapDefaultKey(&KeyHandle, + hKey); + if (!NT_SUCCESS(Status)) + { + return RtlNtStatusToDosError(Status); + } + + if (lpSubKey != NULL) + { + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING SubKeyName; + + RtlInitUnicodeString(&SubKeyName, + (LPWSTR)lpSubKey); + + InitializeObjectAttributes(&ObjectAttributes, + &SubKeyName, + OBJ_CASE_INSENSITIVE, + KeyHandle, + NULL); + + Status = NtOpenKey(&SubKeyHandle, + KEY_SET_VALUE, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + return RtlNtStatusToDosError(Status); + } + } + + RtlInitUnicodeString(&ValueName, + (LPWSTR)lpValueName); + + Status = NtDeleteValueKey((SubKeyHandle != NULL) ? SubKeyHandle : KeyHandle, + &ValueName); + + if (SubKeyHandle != NULL) + { + NtClose(SubKeyHandle); + } + + if (!NT_SUCCESS(Status)) + { + return RtlNtStatusToDosError(Status); + } + + return ERROR_SUCCESS; +} + + +/********************************************************************** ** + * RegDeleteKeyValueA + * + * @implemented + */ +LONG STDCALL +RegDeleteKeyValueA(IN HKEY hKey, + IN LPCSTR lpSubKey OPTIONAL, + IN LPCSTR lpValueName OPTIONAL) +{ + UNICODE_STRING SubKey, ValueName; + LONG Ret; + + if (lpSubKey != NULL) + { + if (!RtlCreateUnicodeStringFromAsciiz(&SubKey, + (LPSTR)lpSubKey)) + { + return ERROR_NOT_ENOUGH_MEMORY; + } + } + else + RtlInitUnicodeString(&SubKey, + NULL); + + if (lpValueName != NULL) + { + if (!RtlCreateUnicodeStringFromAsciiz(&ValueName, + (LPSTR)lpValueName)) + { + RtlFreeUnicodeString(&SubKey); + return ERROR_NOT_ENOUGH_MEMORY; + } + } + else + RtlInitUnicodeString(&ValueName, + NULL); + + Ret = RegDeleteKeyValueW(hKey, + SubKey.Buffer, + SubKey.Buffer); + + RtlFreeUnicodeString(&SubKey); + RtlFreeUnicodeString(&ValueName); + + return Ret; +} + + +/********************************************************************** ** * RegDeleteValueA * * @implemented
19 years, 4 months
1
0
0
0
[greatlrd] 17526: Implement start execute support for bat/cmd file. woking in windows
by greatlrd@svn.reactos.com
Implement start execute support for bat/cmd file. woking in windows Modified: trunk/reactos/subsys/system/cmd/start.c _____ Modified: trunk/reactos/subsys/system/cmd/start.c --- trunk/reactos/subsys/system/cmd/start.c 2005-08-24 23:05:07 UTC (rev 17525) +++ trunk/reactos/subsys/system/cmd/start.c 2005-08-24 23:07:51 UTC (rev 17526) @@ -24,6 +24,12 @@ TCHAR rest[CMDLINE_LENGTH]; TCHAR param[CMDLINE_LENGTH]; BOOL bWait = FALSE; + BOOL bBat = FALSE; + BOOL bCreate = FALSE; + TCHAR szFullCmdLine [CMDLINE_LENGTH]; + PROCESS_INFORMATION prci; + STARTUPINFO stui; + param[0] = _T('\0'); if (_tcsncmp (Rest, _T("/?"), 2) == 0) @@ -115,39 +121,61 @@ if (!_tcsicmp (_tcsrchr (szFullName, _T('.')), _T(".bat")) || !_tcsicmp (_tcsrchr (szFullName, _T('.')), _T(".cmd"))) { + bBat = TRUE; + memset(szFullCmdLine,0,CMDLINE_LENGTH * sizeof(TCHAR)); + + /* FIXME : use comspec instead */ + if (!SearchForExecutable (_T("CMD"), szFullCmdLine)) + { + error_bad_command (); + return 1; + } + + memcpy(&szFullCmdLine[_tcslen(szFullCmdLine)],_T("\" /K "), 5 * sizeof(TCHAR)); + memcpy(&szFullCmdLine[_tcslen(szFullCmdLine)], szFullName, _tcslen(szFullName) * sizeof(TCHAR)); + memcpy(&szFullCmdLine[1], &szFullCmdLine[2], _tcslen(szFullCmdLine) * sizeof(TCHAR)); + szFullCmdLine[0] = _T('\"'); + } + #ifdef _DEBUG DebugPrintf (_T("[BATCH: %s %s]\n"), szFullName, rest); #endif + - ConErrResPuts(STRING_START_ERROR1); - } - else - { - /* exec the program */ - TCHAR szFullCmdLine [CMDLINE_LENGTH]; - PROCESS_INFORMATION prci; - STARTUPINFO stui; - #ifdef _DEBUG DebugPrintf (_T("[EXEC: %s %s]\n"), szFullName, rest); #endif /* build command line for CreateProcess() */ - _tcscpy (szFullCmdLine, first); - if( param ) + if (bBat == FALSE) + { + _tcscpy (szFullCmdLine, first); + if( param ) { _tcscat(szFullCmdLine, _T(" ") ); _tcscat (szFullCmdLine, param); } + } /* fill startup info */ memset (&stui, 0, sizeof (STARTUPINFO)); stui.cb = sizeof (STARTUPINFO); stui.dwFlags = STARTF_USESHOWWINDOW; stui.wShowWindow = SW_SHOWDEFAULT; - - if (CreateProcess (szFullName, szFullCmdLine, NULL, NULL, FALSE, - CREATE_NEW_CONSOLE, NULL, NULL, &stui, &prci)) + + if (bBat == TRUE) { + bCreate = CreateProcess (NULL, szFullCmdLine, NULL, NULL, FALSE, + CREATE_NEW_CONSOLE, NULL, NULL, &stui, &prci); + } + else + { + bCreate = CreateProcess (szFullName, szFullCmdLine, NULL, NULL, FALSE, + DETACHED_PROCESS, NULL, NULL, &stui, &prci); + + } + + if (bCreate) + { if (bWait) { DWORD dwExitCode; @@ -166,7 +194,7 @@ ErrorMessage(GetLastError (), _T("Error executing CreateProcess()!!\n")); } - } +// } return 0; }
19 years, 4 months
1
0
0
0
[weiden] 17525: implemented IsThreadAFiber()
by weiden@svn.reactos.com
implemented IsThreadAFiber() Modified: trunk/reactos/lib/kernel32/kernel32.def Modified: trunk/reactos/lib/kernel32/thread/fiber.c _____ Modified: trunk/reactos/lib/kernel32/kernel32.def --- trunk/reactos/lib/kernel32/kernel32.def 2005-08-24 22:38:10 UTC (rev 17524) +++ trunk/reactos/lib/kernel32/kernel32.def 2005-08-24 23:05:07 UTC (rev 17525) @@ -586,6 +586,7 @@ IsProcessInJob@12 IsProcessorFeaturePresent@4 IsSystemResumeAutomatic@0 +IsThreadAFiber@0 IsValidCodePage@4 IsValidLanguageGroup@8 IsValidLocale@8 _____ Modified: trunk/reactos/lib/kernel32/thread/fiber.c --- trunk/reactos/lib/kernel32/thread/fiber.c 2005-08-24 22:38:10 UTC (rev 17524) +++ trunk/reactos/lib/kernel32/thread/fiber.c 2005-08-24 23:05:07 UTC (rev 17525) @@ -235,6 +235,17 @@ MEM_RELEASE); } +/* + * @implemented + */ +BOOL +WINAPI +IsThreadAFiber(VOID) +{ + return NtCurrentTeb()->HasFiberData; +} + + __declspec(noreturn) VOID WINAPI
19 years, 4 months
1
0
0
0
[royce] 17524: zero the entire buffer
by royce@svn.reactos.com
zero the entire buffer Modified: trunk/reactos/subsys/system/hostname/hostname.c _____ Modified: trunk/reactos/subsys/system/hostname/hostname.c --- trunk/reactos/subsys/system/hostname/hostname.c 2005-08-24 21:54:13 UTC (rev 17523) +++ trunk/reactos/subsys/system/hostname/hostname.c 2005-08-24 22:38:10 UTC (rev 17524) @@ -35,7 +35,7 @@ TCHAR ComputerName [MAX_COMPUTERNAME_LENGTH + 1]; DWORD ComputerNameSize = sizeof ComputerName / sizeof ComputerName[0]; - ZeroMemory (ComputerName, ComputerNameSize); + ZeroMemory (ComputerName, sizeof ComputerName ); if (GetComputerName(ComputerName, & ComputerNameSize)) { printf ("%s\n", ComputerName);
19 years, 4 months
1
0
0
0
[weiden] 17523: install the registry keys before enabling the driver
by weiden@svn.reactos.com
install the registry keys before enabling the driver Modified: trunk/reactos/subsys/system/vmwinst/vmwinst.c _____ Modified: trunk/reactos/subsys/system/vmwinst/vmwinst.c --- trunk/reactos/subsys/system/vmwinst/vmwinst.c 2005-08-24 21:52:41 UTC (rev 17522) +++ trunk/reactos/subsys/system/vmwinst/vmwinst.c 2005-08-24 21:54:13 UTC (rev 17523) @@ -503,14 +503,7 @@ { if(DriverFilesFound) { - if(!AddVmwareRegistryEntries()) - { - WCHAR Msg[1024]; - LoadString(hAppInstance, IDS_FAILEDTOADDREGENTRIES, Msg, sizeof(Msg) / sizeof(WCHAR)); - MessageBox(GetParent(hwndDlg), Msg, NULL, MB_ICONWARNING); - SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_WELCOMEPAGE); - return TRUE; - } + /* FIXME - check for existing registry entries! */ if(!EnableVmwareDriver(TRUE, TRUE, TRUE)) { @@ -633,6 +626,11 @@ if(AbortInstall != 0) goto done; PostMessage(hInstallationNotifyWnd, WM_INSTSTATUSUPDATE, IDS_ENABLINGDRIVER, 0); + if(!AddVmwareRegistryEntries()) + { + PostMessage(hInstallationNotifyWnd, WM_INSTABORT, IDS_FAILEDTOADDREGENTRIES, 0); + goto cleanup; + } if(!EnableVmwareDriver(TRUE, TRUE, TRUE)) { PostMessage(hInstallationNotifyWnd, WM_INSTABORT, IDS_FAILEDTOACTIVATEDRIVER, 0);
19 years, 4 months
1
0
0
0
[navaraf] 17522: REVISON -> REVISION
by navaraf@svn.reactos.com
REVISON -> REVISION Modified: trunk/reactos/drivers/video/videoprt/videoprt.c _____ Modified: trunk/reactos/drivers/video/videoprt/videoprt.c --- trunk/reactos/drivers/video/videoprt/videoprt.c 2005-08-24 21:40:01 UTC (rev 17521) +++ trunk/reactos/drivers/video/videoprt/videoprt.c 2005-08-24 21:52:41 UTC (rev 17522) @@ -539,7 +539,7 @@ if (HwInitializationData->HwInitDataSize > sizeof(VIDEO_HW_INITIALIZATION_DATA)) { - return STATUS_REVISON_MISMATCH; + return STATUS_REVISION_MISMATCH; } if (HwInitializationData->HwFindAdapter == NULL ||
19 years, 4 months
1
0
0
0
[greatlrd] 17521: implemented "" remove for the start command. This makes 'start dir1\"dir2a dir2b"\dir3\foo.exe param' work change by Martin Rottensteiner 2005only@pianonote.at irc nick ravelo
by greatlrd@svn.reactos.com
implemented "" remove for the start command. This makes 'start dir1\"dir2a dir2b"\dir3\foo.exe param' work change by Martin Rottensteiner 2005only(a)pianonote.at irc nick ravelo Modified: trunk/reactos/subsys/system/cmd/start.c _____ Modified: trunk/reactos/subsys/system/cmd/start.c --- trunk/reactos/subsys/system/cmd/start.c 2005-08-24 21:29:24 UTC (rev 17520) +++ trunk/reactos/subsys/system/cmd/start.c 2005-08-24 21:40:01 UTC (rev 17521) @@ -17,13 +17,16 @@ #ifdef INCLUDE_CMD_START -INT cmd_start (LPTSTR first, LPTSTR rest) +INT cmd_start (LPTSTR First, LPTSTR Rest) { TCHAR szFullName[MAX_PATH]; + TCHAR first[CMDLINE_LENGTH]; + TCHAR rest[CMDLINE_LENGTH]; + TCHAR param[CMDLINE_LENGTH]; BOOL bWait = FALSE; - TCHAR *param; - - if (_tcsncmp (rest, _T("/?"), 2) == 0) + param[0] = _T('\0'); + + if (_tcsncmp (Rest, _T("/?"), 2) == 0) { ConOutResPaging(TRUE,STRING_START_HELP1); return 0; @@ -31,6 +34,60 @@ nErrorLevel = 0; + if( !*Rest ) + { + // FIXME: use comspec instead + Rest = _T("cmd"); + } + + _tcscpy(rest,Rest); + + /* Parsing the command that gets called by start, and it's parameters */ + if(!_tcschr(rest,_T('\"'))) + { + INT i = 0; + INT count = _tcslen(rest); + + /* find the end of the command and start of the args */ + for(i = 0; i < count; i++) + { + if(rest[i] == _T(' ')) + { + _tcscpy(param,&rest[i]); + rest[i] = _T('\0'); + break; + } + } + } + else + { + INT i = 0; + INT count = _tcslen(rest); + BOOL bInside = FALSE; + + /* find the end of the command and put the arguments in param */ + for(i = 0; i < count; i++) + { + if(rest[i] == _T('\"')) + bInside = !bInside; + if((rest[i] == _T(' ')) && !bInside) + { + _tcscpy(param,&rest[i]); + rest[i] = _T('\0'); + break; + } + } + i = 0; + /* remove any slashes */ + while(i < count) + { + if(rest[i] == _T('\"')) + memmove(&rest[i],&rest[i + 1], _tcslen(&rest[i]) * sizeof(TCHAR)); + else + i++; + } + } + /* check for a drive change */ if (!_tcscmp (first + 1, _T(":")) && _istalpha (*first)) { @@ -45,22 +102,9 @@ return 0; } - - if( !*rest ) - { - // FIXME: use comspec instead - rest = _T("cmd"); - } - + /* get the PATH environment variable and parse it */ /* search the PATH environment variable for the binary */ - param = _tcschr( rest, _T(' ') ); // skip program name to reach parameters - if( param ) - { - *param = 0; - param++; - } - if (!SearchForExecutable (rest, szFullName)) { error_bad_command ();
19 years, 4 months
1
0
0
0
[navaraf] 17520: Fix a memory leak if VideoPortInitialize is called more than once from the same miniport.
by navaraf@svn.reactos.com
Fix a memory leak if VideoPortInitialize is called more than once from the same miniport. Replace STDCALL with NTAPI. Modified: trunk/reactos/drivers/video/videoprt/agp.c Modified: trunk/reactos/drivers/video/videoprt/ddc.c Modified: trunk/reactos/drivers/video/videoprt/dispatch.c Modified: trunk/reactos/drivers/video/videoprt/dma.c Modified: trunk/reactos/drivers/video/videoprt/event.c Modified: trunk/reactos/drivers/video/videoprt/int10.c Modified: trunk/reactos/drivers/video/videoprt/interrupt.c Modified: trunk/reactos/drivers/video/videoprt/resource.c Modified: trunk/reactos/drivers/video/videoprt/services.c Modified: trunk/reactos/drivers/video/videoprt/spinlock.c Modified: trunk/reactos/drivers/video/videoprt/timer.c Modified: trunk/reactos/drivers/video/videoprt/videoprt.c Modified: trunk/reactos/drivers/video/videoprt/videoprt.h _____ Modified: trunk/reactos/drivers/video/videoprt/agp.c --- trunk/reactos/drivers/video/videoprt/agp.c 2005-08-24 20:34:50 UTC (rev 17519) +++ trunk/reactos/drivers/video/videoprt/agp.c 2005-08-24 21:29:24 UTC (rev 17520) @@ -91,7 +91,7 @@ } -BOOLEAN STDCALL +BOOLEAN NTAPI IntAgpCommitPhysical( IN PVOID HwDeviceExtension, IN PVOID PhysicalContext, @@ -123,7 +123,7 @@ return NT_SUCCESS(Status); } -VOID STDCALL +VOID NTAPI IntAgpFreePhysical( IN PVOID HwDeviceExtension, IN PVOID PhysicalContext, @@ -151,7 +151,7 @@ } } -VOID STDCALL +VOID NTAPI IntAgpReleasePhysical( IN PVOID HwDeviceExtension, IN PVOID PhysicalContext) @@ -180,7 +180,7 @@ ExFreePool(AgpMapping); } -PHYSICAL_ADDRESS STDCALL +PHYSICAL_ADDRESS NTAPI IntAgpReservePhysical( IN PVOID HwDeviceExtension, IN ULONG Pages, @@ -245,7 +245,7 @@ } -PVOID STDCALL +PVOID NTAPI IntAgpCommitVirtual( IN PVOID HwDeviceExtension, IN PVOID VirtualContext, @@ -327,7 +327,7 @@ return BaseAddress; } -VOID STDCALL +VOID NTAPI IntAgpFreeVirtual( IN PVOID HwDeviceExtension, IN PVOID VirtualContext, @@ -381,7 +381,7 @@ } } -VOID STDCALL +VOID NTAPI IntAgpReleaseVirtual( IN PVOID HwDeviceExtension, IN PVOID VirtualContext) @@ -415,7 +415,7 @@ ExFreePool(VirtualMapping); } -PVOID STDCALL +PVOID NTAPI IntAgpReserveVirtual( IN PVOID HwDeviceExtension, IN HANDLE ProcessHandle, @@ -475,7 +475,7 @@ } -BOOLEAN STDCALL +BOOLEAN NTAPI IntAgpSetRate( IN PVOID HwDeviceExtension, IN ULONG Rate) @@ -492,7 +492,7 @@ } -NTSTATUS STDCALL +NTSTATUS NTAPI IntAgpGetInterface( IN PVOID HwDeviceExtension, IN OUT PINTERFACE Interface) _____ Modified: trunk/reactos/drivers/video/videoprt/ddc.c --- trunk/reactos/drivers/video/videoprt/ddc.c 2005-08-24 20:34:50 UTC (rev 17519) +++ trunk/reactos/drivers/video/videoprt/ddc.c 2005-08-24 21:29:24 UTC (rev 17520) @@ -168,7 +168,7 @@ * @implemented */ -BOOLEAN STDCALL +BOOLEAN NTAPI VideoPortDDCMonitorHelper( PVOID HwDeviceExtension, PVOID I2CFunctions, _____ Modified: trunk/reactos/drivers/video/videoprt/dispatch.c --- trunk/reactos/drivers/video/videoprt/dispatch.c 2005-08-24 20:34:50 UTC (rev 17519) +++ trunk/reactos/drivers/video/videoprt/dispatch.c 2005-08-24 21:29:24 UTC (rev 17520) @@ -25,8 +25,8 @@ /* EXTERNAL FUNCTIONS *********************************************************/ -VOID STDCALL HalAcquireDisplayOwnership(IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters); -VOID STDCALL HalReleaseDisplayOwnership(); +VOID NTAPI HalAcquireDisplayOwnership(IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters); +VOID NTAPI HalReleaseDisplayOwnership(); /* GLOBAL VARIABLES ***********************************************************/ @@ -38,7 +38,7 @@ * Reset display to blue screen */ -BOOLEAN STDCALL +BOOLEAN NTAPI IntVideoPortResetDisplayParameters(ULONG Columns, ULONG Rows) { PVIDEO_PORT_DRIVER_EXTENSION DriverExtension; @@ -63,7 +63,7 @@ return FALSE; } -NTSTATUS STDCALL +NTSTATUS NTAPI IntVideoPortAddDevice( IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject) @@ -96,7 +96,7 @@ * PASSIVE_LEVEL */ -NTSTATUS STDCALL +NTSTATUS NTAPI IntVideoPortDispatchOpen( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) @@ -166,7 +166,7 @@ * PASSIVE_LEVEL */ -NTSTATUS STDCALL +NTSTATUS NTAPI IntVideoPortDispatchClose( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) @@ -198,7 +198,7 @@ * PASSIVE_LEVEL */ -NTSTATUS STDCALL +NTSTATUS NTAPI IntVideoPortDispatchDeviceControl( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) @@ -264,7 +264,7 @@ return Status; } -NTSTATUS STDCALL +NTSTATUS NTAPI IntVideoPortPnPStartDevice( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) @@ -352,7 +352,7 @@ NTSTATUS -STDCALL +NTAPI IntVideoPortForwardIrpAndWaitCompletionRoutine( PDEVICE_OBJECT Fdo, PIRP Irp, @@ -368,7 +368,7 @@ NTSTATUS -STDCALL +NTAPI IntVideoPortForwardIrpAndWait(PDEVICE_OBJECT DeviceObject, PIRP Irp) { KEVENT Event; @@ -390,7 +390,7 @@ } -NTSTATUS STDCALL +NTSTATUS NTAPI IntVideoPortDispatchPnp( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) @@ -442,7 +442,7 @@ return Status; } -NTSTATUS STDCALL +NTSTATUS NTAPI IntVideoPortDispatchCleanup( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) @@ -459,7 +459,7 @@ return STATUS_SUCCESS; } -NTSTATUS STDCALL +NTSTATUS NTAPI IntVideoPortDispatchPower( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) @@ -467,7 +467,7 @@ return STATUS_NOT_IMPLEMENTED; } -VOID STDCALL +VOID NTAPI IntVideoPortUnload(PDRIVER_OBJECT DriverObject) { } _____ Modified: trunk/reactos/drivers/video/videoprt/dma.c --- trunk/reactos/drivers/video/videoprt/dma.c 2005-08-24 20:34:50 UTC (rev 17519) +++ trunk/reactos/drivers/video/videoprt/dma.c 2005-08-24 21:29:24 UTC (rev 17520) @@ -29,7 +29,7 @@ * @implemented */ -PVOID STDCALL +PVOID NTAPI VideoPortAllocateCommonBuffer( IN PVOID HwDeviceExtension, IN PVP_DMA_ADAPTER VpDmaAdapter, @@ -49,7 +49,7 @@ * @implemented */ -VOID STDCALL +VOID NTAPI VideoPortReleaseCommonBuffer( IN PVOID HwDeviceExtension, IN PVP_DMA_ADAPTER VpDmaAdapter, @@ -70,7 +70,7 @@ * @unimplemented */ -VOID STDCALL +VOID NTAPI VideoPortPutDmaAdapter( IN PVOID HwDeviceExtension, IN PVP_DMA_ADAPTER VpDmaAdapter) @@ -82,7 +82,7 @@ * @unimplemented */ -PVP_DMA_ADAPTER STDCALL +PVP_DMA_ADAPTER NTAPI VideoPortGetDmaAdapter( IN PVOID HwDeviceExtension, IN PVP_DEVICE_DESCRIPTION VpDeviceExtension) _____ Modified: trunk/reactos/drivers/video/videoprt/event.c --- trunk/reactos/drivers/video/videoprt/event.c 2005-08-24 20:34:50 UTC (rev 17519) +++ trunk/reactos/drivers/video/videoprt/event.c 2005-08-24 21:29:24 UTC (rev 17520) @@ -29,7 +29,7 @@ * @implemented */ -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortCreateEvent( IN PVOID HwDeviceExtension, IN ULONG EventFlag, @@ -59,7 +59,7 @@ * @implemented */ -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortDeleteEvent( IN PVOID HwDeviceExtension, IN PEVENT Event) @@ -72,7 +72,7 @@ * @implemented */ -LONG STDCALL +LONG NTAPI VideoPortSetEvent( IN PVOID HwDeviceExtension, IN PEVENT Event) @@ -84,7 +84,7 @@ * @implemented */ -VOID STDCALL +VOID NTAPI VideoPortClearEvent( IN PVOID HwDeviceExtension, IN PEVENT Event) @@ -96,7 +96,7 @@ * @implemented */ -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortWaitForSingleObject( IN PVOID HwDeviceExtension, IN PVOID Object, _____ Modified: trunk/reactos/drivers/video/videoprt/int10.c --- trunk/reactos/drivers/video/videoprt/int10.c 2005-08-24 20:34:50 UTC (rev 17519) +++ trunk/reactos/drivers/video/videoprt/int10.c 2005-08-24 21:29:24 UTC (rev 17520) @@ -26,7 +26,7 @@ /* PRIVATE FUNCTIONS **********************************************************/ -VP_STATUS STDCALL +VP_STATUS NTAPI IntInt10AllocateBuffer( IN PVOID Context, OUT PUSHORT Seg, @@ -74,7 +74,7 @@ return NO_ERROR; } -VP_STATUS STDCALL +VP_STATUS NTAPI IntInt10FreeBuffer( IN PVOID Context, IN USHORT Seg, @@ -97,7 +97,7 @@ return Status; } -VP_STATUS STDCALL +VP_STATUS NTAPI IntInt10ReadMemory( IN PVOID Context, IN USHORT Seg, @@ -121,7 +121,7 @@ return NO_ERROR; } -VP_STATUS STDCALL +VP_STATUS NTAPI IntInt10WriteMemory( IN PVOID Context, IN USHORT Seg, @@ -145,7 +145,7 @@ return NO_ERROR; } -VP_STATUS STDCALL +VP_STATUS NTAPI IntInt10CallBios( IN PVOID Context, IN OUT PINT10_BIOS_ARGUMENTS BiosArguments) @@ -200,7 +200,7 @@ * @implemented */ -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortInt10( IN PVOID HwDeviceExtension, IN PVIDEO_X86_BIOS_ARGUMENTS BiosArguments) _____ Modified: trunk/reactos/drivers/video/videoprt/interrupt.c --- trunk/reactos/drivers/video/videoprt/interrupt.c 2005-08-24 20:34:50 UTC (rev 17519) +++ trunk/reactos/drivers/video/videoprt/interrupt.c 2005-08-24 21:29:24 UTC (rev 17520) @@ -25,7 +25,7 @@ /* PRIVATE FUNCTIONS **********************************************************/ -BOOLEAN STDCALL +BOOLEAN NTAPI IntVideoPortInterruptRoutine( IN struct _KINTERRUPT *Interrupt, IN PVOID ServiceContext) @@ -38,7 +38,7 @@ &DeviceExtension->MiniPortDeviceExtension); } -BOOLEAN STDCALL +BOOLEAN NTAPI IntVideoPortSetupInterrupt( IN PDEVICE_OBJECT DeviceObject, IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension, @@ -105,7 +105,7 @@ * @implemented */ -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortEnableInterrupt(IN PVOID HwDeviceExtension) { PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; @@ -127,7 +127,7 @@ * @implemented */ -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortDisableInterrupt(IN PVOID HwDeviceExtension) { PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; _____ Modified: trunk/reactos/drivers/video/videoprt/resource.c --- trunk/reactos/drivers/video/videoprt/resource.c 2005-08-24 20:34:50 UTC (rev 17519) +++ trunk/reactos/drivers/video/videoprt/resource.c 2005-08-24 21:29:24 UTC (rev 17520) @@ -25,7 +25,7 @@ /* PRIVATE FUNCTIONS **********************************************************/ -NTSTATUS STDCALL +NTSTATUS NTAPI IntVideoPortMapPhysicalMemory( IN HANDLE Process, IN PHYSICAL_ADDRESS PhysicalAddress, @@ -76,7 +76,7 @@ } -PVOID STDCALL +PVOID NTAPI IntVideoPortMapMemory( IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension, IN PHYSICAL_ADDRESS IoAddress, @@ -231,7 +231,7 @@ return NULL; } -VOID STDCALL +VOID NTAPI IntVideoPortUnmapMemory( IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension, IN PVOID MappedAddress) @@ -283,7 +283,7 @@ * @implemented */ -PVOID STDCALL +PVOID NTAPI VideoPortGetDeviceBase( IN PVOID HwDeviceExtension, IN PHYSICAL_ADDRESS IoAddress, @@ -304,7 +304,7 @@ * @implemented */ -VOID STDCALL +VOID NTAPI VideoPortFreeDeviceBase( IN PVOID HwDeviceExtension, IN PVOID MappedAddress) @@ -319,7 +319,7 @@ * @unimplemented */ -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortMapBankedMemory( IN PVOID HwDeviceExtension, IN PHYSICAL_ADDRESS PhysicalAddress, @@ -341,7 +341,7 @@ * @implemented */ -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortMapMemory( IN PVOID HwDeviceExtension, IN PHYSICAL_ADDRESS PhysicalAddress, @@ -371,7 +371,7 @@ * @implemented */ -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortUnmapMemory( IN PVOID HwDeviceExtension, IN PVOID VirtualAddress, @@ -390,7 +390,7 @@ * @implemented */ -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortGetAccessRanges( IN PVOID HwDeviceExtension, IN ULONG NumRequestedResources, @@ -579,7 +579,7 @@ * @implemented */ -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortVerifyAccessRanges( IN PVOID HwDeviceExtension, IN ULONG NumAccessRanges, @@ -659,7 +659,7 @@ * @unimplemented */ -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortGetDeviceData( IN PVOID HwDeviceExtension, IN VIDEO_DEVICE_DATA_TYPE DeviceDataType, @@ -675,7 +675,7 @@ * @implemented */ -PVOID STDCALL +PVOID NTAPI VideoPortAllocatePool( IN PVOID HwDeviceExtension, IN VP_POOL_TYPE PoolType, @@ -690,7 +690,7 @@ * @implemented */ -VOID STDCALL +VOID NTAPI VideoPortFreePool( IN PVOID HwDeviceExtension, IN PVOID Ptr) @@ -702,7 +702,7 @@ * @implemented */ -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortAllocateBuffer( IN PVOID HwDeviceExtension, IN ULONG Size, @@ -717,7 +717,7 @@ * @implemented */ -VOID STDCALL +VOID NTAPI VideoPortReleaseBuffer( IN PVOID HwDeviceExtension, IN PVOID Ptr) @@ -730,7 +730,7 @@ * @unimplemented */ -PVOID STDCALL +PVOID NTAPI VideoPortLockBuffer( IN PVOID HwDeviceExtension, IN PVOID BaseAddress, @@ -745,7 +745,7 @@ * @unimplemented */ -VOID STDCALL +VOID NTAPI VideoPortUnlockBuffer( IN PVOID HwDeviceExtension, IN PVOID Mdl) @@ -757,7 +757,7 @@ * @unimplemented */ -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortSetTrappedEmulatorPorts( IN PVOID HwDeviceExtension, IN ULONG NumAccessRanges, @@ -772,7 +772,7 @@ * @implemented */ -ULONG STDCALL +ULONG NTAPI VideoPortGetBusData( IN PVOID HwDeviceExtension, IN BUS_DATA_TYPE BusDataType, @@ -807,7 +807,7 @@ * @implemented */ -ULONG STDCALL +ULONG NTAPI VideoPortSetBusData( IN PVOID HwDeviceExtension, IN BUS_DATA_TYPE BusDataType, _____ Modified: trunk/reactos/drivers/video/videoprt/services.c --- trunk/reactos/drivers/video/videoprt/services.c 2005-08-24 20:34:50 UTC (rev 17519) +++ trunk/reactos/drivers/video/videoprt/services.c 2005-08-24 21:29:24 UTC (rev 17520) @@ -23,19 +23,19 @@ #include "videoprt.h" -VOID STDCALL +VOID NTAPI IntInterfaceReference(PVOID Context) { /* Do nothing */ } -VOID STDCALL +VOID NTAPI IntInterfaceDereference(PVOID Context) { /* Do nothing */ } -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortQueryServices( IN PVOID HwDeviceExtension, IN VIDEO_PORT_SERVICES ServicesType, @@ -89,7 +89,7 @@ return ERROR_INVALID_FUNCTION; } -BOOLEAN STDCALL +BOOLEAN NTAPI VideoPortGetAgpServices( IN PVOID HwDeviceExtension, OUT PVIDEO_PORT_AGP_SERVICES AgpServices) _____ Modified: trunk/reactos/drivers/video/videoprt/spinlock.c --- trunk/reactos/drivers/video/videoprt/spinlock.c 2005-08-24 20:34:50 UTC (rev 17519) +++ trunk/reactos/drivers/video/videoprt/spinlock.c 2005-08-24 21:29:24 UTC (rev 17520) @@ -27,7 +27,7 @@ * @implemented */ -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortCreateSpinLock( IN PVOID HwDeviceExtension, OUT PSPIN_LOCK *SpinLock) @@ -44,7 +44,7 @@ * @implemented */ -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortDeleteSpinLock( IN PVOID HwDeviceExtension, IN PSPIN_LOCK SpinLock) @@ -58,7 +58,7 @@ * @implemented */ -VOID STDCALL +VOID NTAPI VideoPortAcquireSpinLock( IN PVOID HwDeviceExtension, IN PSPIN_LOCK SpinLock, @@ -72,7 +72,7 @@ * @implemented */ -VOID STDCALL +VOID NTAPI VideoPortAcquireSpinLockAtDpcLevel( IN PVOID HwDeviceExtension, IN PSPIN_LOCK SpinLock) @@ -85,7 +85,7 @@ * @implemented */ -VOID STDCALL +VOID NTAPI VideoPortReleaseSpinLock( IN PVOID HwDeviceExtension, IN PSPIN_LOCK SpinLock, @@ -99,7 +99,7 @@ * @implemented */ -VOID STDCALL +VOID NTAPI VideoPortReleaseSpinLockFromDpcLevel( IN PVOID HwDeviceExtension, IN PSPIN_LOCK SpinLock) _____ Modified: trunk/reactos/drivers/video/videoprt/timer.c --- trunk/reactos/drivers/video/videoprt/timer.c 2005-08-24 20:34:50 UTC (rev 17519) +++ trunk/reactos/drivers/video/videoprt/timer.c 2005-08-24 21:29:24 UTC (rev 17520) @@ -25,7 +25,7 @@ /* PRIVATE FUNCTIONS **********************************************************/ -VOID STDCALL +VOID NTAPI IntVideoPortTimerRoutine( IN PDEVICE_OBJECT DeviceObject, IN PVOID ServiceContext) @@ -38,7 +38,7 @@ &DeviceExtension->MiniPortDeviceExtension); } -BOOLEAN STDCALL +BOOLEAN NTAPI IntVideoPortSetupTimer( IN PDEVICE_OBJECT DeviceObject, IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension) @@ -73,7 +73,7 @@ * @implemented */ -VOID STDCALL +VOID NTAPI VideoPortStartTimer(IN PVOID HwDeviceExtension) { DPRINT("VideoPortStartTimer\n"); @@ -84,7 +84,7 @@ * @implemented */ -VOID STDCALL +VOID NTAPI VideoPortStopTimer(IN PVOID HwDeviceExtension) { DPRINT("VideoPortStopTimer\n"); _____ Modified: trunk/reactos/drivers/video/videoprt/videoprt.c --- trunk/reactos/drivers/video/videoprt/videoprt.c 2005-08-24 20:34:50 UTC (rev 17519) +++ trunk/reactos/drivers/video/videoprt/videoprt.c 2005-08-24 21:29:24 UTC (rev 17520) @@ -30,7 +30,7 @@ /* PRIVATE FUNCTIONS **********************************************************/ -NTSTATUS STDCALL +NTSTATUS NTAPI DriverEntry( IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath) @@ -38,7 +38,7 @@ return STATUS_SUCCESS; } -PVOID STDCALL +PVOID NTAPI IntVideoPortImageDirectoryEntryToData( PVOID BaseAddress, ULONG Directory) @@ -60,7 +60,7 @@ return (PVOID)((ULONG_PTR)BaseAddress + Va); } -PVOID STDCALL +PVOID NTAPI IntVideoPortGetProcAddress( IN PVOID HwDeviceExtension, IN PUCHAR FunctionName) @@ -116,7 +116,7 @@ return NULL; } -VOID STDCALL +VOID NTAPI IntVideoPortDeferredRoutine( IN PKDPC Dpc, IN PVOID DeferredContext, @@ -128,7 +128,7 @@ ((PMINIPORT_DPC_ROUTINE)SystemArgument1)(HwDeviceExtension, SystemArgument2); } -ULONG STDCALL +ULONG NTAPI IntVideoPortAllocateDeviceNumber(VOID) { NTSTATUS Status; @@ -163,7 +163,7 @@ return DeviceNumber; } -NTSTATUS STDCALL +NTSTATUS NTAPI IntVideoPortCreateAdapterDeviceObject( IN PDRIVER_OBJECT DriverObject, IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension, @@ -308,7 +308,7 @@ /* FIXME: we have to detach the device object in IntVideoPortFindAdapter if it fails */ -NTSTATUS STDCALL +NTSTATUS NTAPI IntVideoPortFindAdapter( IN PDRIVER_OBJECT DriverObject, IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension, @@ -518,7 +518,7 @@ * @implemented */ -ULONG STDCALL +ULONG NTAPI VideoPortInitialize( IN PVOID Context1, IN PVOID Context2, @@ -534,10 +534,26 @@ DPRINT("VideoPortInitialize\n"); /* + * As a first thing do parameter checks. + */ + + if (HwInitializationData->HwInitDataSize > sizeof(VIDEO_HW_INITIALIZATION_DATA)) + { + return STATUS_REVISON_MISMATCH; + } + + if (HwInitializationData->HwFindAdapter == NULL || + HwInitializationData->HwInitialize == NULL || + HwInitializationData->HwStartIO == NULL) + { + return STATUS_INVALID_PARAMETER; + } + + /* * NOTE: * The driver extension can be already allocated in case that we were * called by legacy driver and failed detecting device. Some miniport - * drivers in that case adjust parameters and calls VideoPortInitialize + * drivers in that case adjust parameters and call VideoPortInitialize * again. */ @@ -554,6 +570,34 @@ { return Status; } + + /* + * Save the registry path. This should be done only once even if + * VideoPortInitialize is called multiple times. + */ + + if (RegistryPath->Length != 0) + { + DriverExtension->RegistryPath.Length = 0; + DriverExtension->RegistryPath.MaximumLength = + RegistryPath->Length + sizeof(UNICODE_NULL); + DriverExtension->RegistryPath.Buffer = + ExAllocatePoolWithTag( + PagedPool, + DriverExtension->RegistryPath.MaximumLength, + TAG('U', 'S', 'T', 'R')); + if (DriverExtension->RegistryPath.Buffer == NULL) + { + RtlInitUnicodeString(&DriverExtension->RegistryPath, NULL); + return STATUS_INSUFFICIENT_RESOURCES; + } + + RtlCopyUnicodeString(&DriverExtension->RegistryPath, RegistryPath); + } + else + { + RtlInitUnicodeString(&DriverExtension->RegistryPath, NULL); + } } /* @@ -563,9 +607,9 @@ RtlCopyMemory( &DriverExtension->InitializationData, HwInitializationData, - min(sizeof(VIDEO_HW_INITIALIZATION_DATA), - HwInitializationData->HwInitDataSize)); - if (sizeof(VIDEO_HW_INITIALIZATION_DATA) > HwInitializationData->HwInitDataSize) + HwInitializationData->HwInitDataSize); + if (HwInitializationData->HwInitDataSize < + sizeof(VIDEO_HW_INITIALIZATION_DATA)) { RtlZeroMemory((PVOID)((ULONG_PTR)&DriverExtension->InitializationData + HwInitializationData->HwInitDataSize), @@ -574,27 +618,6 @@ } DriverExtension->HwContext = HwContext; - /* we can't use RtlDuplicateUnicodeString because only ntdll exposes it... */ - if (RegistryPath->Length != 0) - { - DriverExtension->RegistryPath.Length = 0; - DriverExtension->RegistryPath.MaximumLength = RegistryPath->Length + sizeof(UNICODE_NULL); - DriverExtension->RegistryPath.Buffer = ExAllocatePoolWithTag(PagedPool, - DriverExtension->RegistryPath.MaximumLength, - TAG('U', 'S', 'T', 'R')); - if (DriverExtension->RegistryPath.Buffer == NULL) - { - RtlInitUnicodeString(&DriverExtension->RegistryPath, NULL); - return STATUS_INSUFFICIENT_RESOURCES; - } - - RtlCopyUnicodeString(&DriverExtension->RegistryPath, RegistryPath); - } - else - { - RtlInitUnicodeString(&DriverExtension->RegistryPath, NULL); - } - switch (HwInitializationData->HwInitDataSize) { /* @@ -675,7 +698,7 @@ * @unimplemented */ -VOID STDCALL +VOID NTAPI VideoPortLogError( IN PVOID HwDeviceExtension, IN PVIDEO_REQUEST_PACKET Vrp OPTIONAL, @@ -694,7 +717,7 @@ * @implemented */ -UCHAR STDCALL +UCHAR NTAPI VideoPortGetCurrentIrql(VOID) { return KeGetCurrentIrql(); @@ -707,7 +730,7 @@ PMINIPORT_GET_REGISTRY_ROUTINE HwGetRegistryRoutine; } QUERY_REGISTRY_CALLBACK_CONTEXT, *PQUERY_REGISTRY_CALLBACK_CONTEXT; -static NTSTATUS STDCALL +static NTSTATUS NTAPI QueryRegistryCallback( IN PWSTR ValueName, IN ULONG ValueType, @@ -732,7 +755,7 @@ * @unimplemented */ -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortGetRegistryParameters( IN PVOID HwDeviceExtension, IN PWSTR ParameterName, @@ -780,7 +803,7 @@ * @implemented */ -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortSetRegistryParameters( IN PVOID HwDeviceExtension, IN PWSTR ValueName, @@ -802,7 +825,7 @@ * @implemented */ -VP_STATUS STDCALL +VP_STATUS NTAPI VideoPortGetVgaStatus( IN PVOID HwDeviceExtension, OUT PULONG VgaStatus) @@ -830,7 +853,7 @@ * @implemented */ -PVOID STDCALL +PVOID NTAPI VideoPortGetRomImage( IN PVOID HwDeviceExtension, IN PVOID Unused1, @@ -888,7 +911,7 @@ * @implemented */ -BOOLEAN STDCALL +BOOLEAN NTAPI VideoPortScanRom( IN PVOID HwDeviceExtension, IN PUCHAR RomBase, @@ -922,7 +945,7 @@ * @implemented */ -BOOLEAN STDCALL +BOOLEAN NTAPI VideoPortSynchronizeExecution( IN PVOID HwDeviceExtension, IN VIDEO_SYNCHRONIZE_PRIORITY Priority, @@ -972,7 +995,7 @@ * @implemented */ [truncated at 1000 lines; 261 more skipped]
19 years, 4 months
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
67
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Results per page:
10
25
50
100
200