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
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
May 2006
----- 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
19 participants
377 discussions
Start a n
N
ew thread
[hpoussin] 21826: Fix error handling in SETUP_CreateInterfaceList (memory/handles leak) Implement DIGCF_PRESENT flag in SetupDiGetClassDevsExW Add more error codes mapping from CR_* to ERROR_*
by hpoussin@svn.reactos.org
Author: hpoussin Date: Sun May 7 16:00:55 2006 New Revision: 21826 URL:
http://svn.reactos.ru/svn/reactos?rev=21826&view=rev
Log: Fix error handling in SETUP_CreateInterfaceList (memory/handles leak) Implement DIGCF_PRESENT flag in SetupDiGetClassDevsExW Add more error codes mapping from CR_* to ERROR_* Modified: trunk/reactos/dll/win32/setupapi/devinst.c Modified: trunk/reactos/dll/win32/setupapi/devinst.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/setupapi/devinst.…
============================================================================== --- trunk/reactos/dll/win32/setupapi/devinst.c (original) +++ trunk/reactos/dll/win32/setupapi/devinst.c Sun May 7 16:00:55 2006 @@ -676,12 +676,24 @@ { switch (cr) { - case CR_INVALID_MACHINENAME: return ERROR_INVALID_COMPUTERNAME; - case CR_OUT_OF_MEMORY: return ERROR_NOT_ENOUGH_MEMORY; - case CR_SUCCESS: return ERROR_SUCCESS; - default: - /* FIXME */ - return ERROR_GEN_FAILURE; + case CR_ACCESS_DENIED: return ERROR_ACCESS_DENIED; + case CR_BUFFER_SMALL: return ERROR_INSUFFICIENT_BUFFER; + case CR_CALL_NOT_IMPLEMENTED: return ERROR_CALL_NOT_IMPLEMENTED; + case CR_FAILURE: return ERROR_GEN_FAILURE; + case CR_INVALID_DATA: return ERROR_INVALID_USER_BUFFER; + case CR_INVALID_DEVICE_ID: return ERROR_INVALID_PARAMETER; + case CR_INVALID_MACHINENAME: return ERROR_INVALID_COMPUTERNAME; + case CR_INVALID_DEVNODE: return ERROR_INVALID_PARAMETER; + case CR_INVALID_FLAG: return ERROR_INVALID_FLAGS; + case CR_INVALID_POINTER: return ERROR_INVALID_PARAMETER; + case CR_INVALID_PROPERTY: return ERROR_INVALID_PARAMETER; + case CR_NO_SUCH_DEVNODE: return ERROR_FILE_NOT_FOUND; + case CR_NO_SUCH_REGISTRY_KEY: return ERROR_FILE_NOT_FOUND; + case CR_NO_SUCH_VALUE: return ERROR_FILE_NOT_FOUND; + case CR_OUT_OF_MEMORY: return ERROR_NOT_ENOUGH_MEMORY; + case CR_REGISTRY_ERROR: return ERROR_GEN_FAILURE; + case CR_SUCCESS: return ERROR_SUCCESS; + default: return ERROR_GEN_FAILURE; } /* Does not happen */ @@ -1403,7 +1415,7 @@ } deviceInterface->DeviceInfo = deviceInfo; strcpyW(deviceInterface->SymbolicLink, SymbolicLink); - deviceInterface->Flags = 0; /* FIXME */ + deviceInterface->Flags = 0; /* Flags will be updated later */ memcpy(&deviceInterface->InterfaceClassGuid, pInterfaceGuid, sizeof(GUID)); *pDeviceInterface = deviceInterface; @@ -1616,11 +1628,19 @@ } } +static BOOL DestroyDeviceInterface(struct DeviceInterface* deviceInterface) +{ + HeapFree(GetProcessHeap(), 0, deviceInterface); + return TRUE; +} + static LONG SETUP_CreateInterfaceList( struct DeviceInfoSet *list, PCWSTR MachineName, LPGUID InterfaceGuid, - PCWSTR DeviceInstanceW /* OPTIONAL */) + PCWSTR DeviceInstanceW /* OPTIONAL */, + BOOL OnlyPresentInterfaces + ) { HKEY hInterfaceKey; /* HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\{GUID} */ HKEY hDeviceInstanceKey; /* HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\{GUID}\##?#{InstancePath} */ @@ -1630,7 +1650,8 @@ HKEY hKey; /* HKLM\SYSTEM\CurrentControlSet\Enum\{Instance\Path} */ LONG rc; WCHAR KeyBuffer[max(MAX_PATH, MAX_GUID_STRING_LEN) + 1]; - PWSTR InstancePath; + PWSTR pSymbolicLink = NULL; + PWSTR InstancePath = NULL; DWORD i, j; DWORD dwLength, dwInstancePathLength; DWORD dwRegType; @@ -1638,10 +1659,16 @@ GUID ClassGuid; struct DeviceInfoElement *deviceInfo; + hInterfaceKey = INVALID_HANDLE_VALUE; + hDeviceInstanceKey = INVALID_HANDLE_VALUE; + /* Open registry key related to this interface */ hInterfaceKey = SetupDiOpenClassRegKeyExW(InterfaceGuid, KEY_ENUMERATE_SUB_KEYS, DIOCR_INTERFACE, MachineName, NULL); if (hInterfaceKey == INVALID_HANDLE_VALUE) - return GetLastError(); + { + rc = GetLastError(); + goto cleanup; + } /* Enumerate sub keys of hInterfaceKey */ i = 0; @@ -1652,49 +1679,36 @@ if (rc == ERROR_NO_MORE_ITEMS) break; if (rc != ERROR_SUCCESS) - { - RegCloseKey(hInterfaceKey); - return rc; - } + goto cleanup; i++; /* Open sub key */ + if (hDeviceInstanceKey != INVALID_HANDLE_VALUE) + RegCloseKey(hDeviceInstanceKey); rc = RegOpenKeyExW(hInterfaceKey, KeyBuffer, 0, KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS, &hDeviceInstanceKey); if (rc != ERROR_SUCCESS) - { - RegCloseKey(hInterfaceKey); - return rc; - } + goto cleanup; /* Read DeviceInstance */ rc = RegQueryValueExW(hDeviceInstanceKey, DeviceInstance, NULL, &dwRegType, NULL, &dwInstancePathLength); - if (rc != ERROR_SUCCESS ) - { - RegCloseKey(hDeviceInstanceKey); - RegCloseKey(hInterfaceKey); - return rc; - } + if (rc != ERROR_SUCCESS) + goto cleanup; if (dwRegType != REG_SZ) { - RegCloseKey(hDeviceInstanceKey); - RegCloseKey(hInterfaceKey); - return ERROR_GEN_FAILURE; - } + rc = ERROR_GEN_FAILURE; + goto cleanup; + } + if (InstancePath != NULL) + HeapFree(GetProcessHeap(), 0, InstancePath); InstancePath = HeapAlloc(GetProcessHeap(), 0, dwInstancePathLength + sizeof(WCHAR)); if (!InstancePath) { - RegCloseKey(hDeviceInstanceKey); - RegCloseKey(hInterfaceKey); - return ERROR_NOT_ENOUGH_MEMORY; + rc = ERROR_NOT_ENOUGH_MEMORY; + goto cleanup; } rc = RegQueryValueExW(hDeviceInstanceKey, DeviceInstance, NULL, NULL, (LPBYTE)InstancePath, &dwInstancePathLength); if (rc != ERROR_SUCCESS) - { - HeapFree(GetProcessHeap(), 0, InstancePath); - RegCloseKey(hDeviceInstanceKey); - RegCloseKey(hInterfaceKey); - return rc; - } + goto cleanup; InstancePath[dwInstancePathLength / sizeof(WCHAR)] = '\0'; TRACE("DeviceInstance %s\n", debugstr_w(InstancePath)); @@ -1702,11 +1716,7 @@ { /* Check if device enumerator is not the right one */ if (strcmpW(DeviceInstanceW, InstancePath) != 0) - { - HeapFree(GetProcessHeap(), 0, InstancePath); - RegCloseKey(hDeviceInstanceKey); continue; - } } /* Find class GUID associated to the device instance */ @@ -1717,12 +1727,7 @@ 0, &hEnumKey); if (rc != ERROR_SUCCESS) - { - HeapFree(GetProcessHeap(), 0, InstancePath); - RegCloseKey(hDeviceInstanceKey); - RegCloseKey(hInterfaceKey); - return rc; - } + goto cleanup; rc = RegOpenKeyExW( hEnumKey, InstancePath, @@ -1731,46 +1736,29 @@ &hKey); RegCloseKey(hEnumKey); if (rc != ERROR_SUCCESS) - { - HeapFree(GetProcessHeap(), 0, InstancePath); - RegCloseKey(hDeviceInstanceKey); - RegCloseKey(hInterfaceKey); - return rc; - } + goto cleanup; dwLength = sizeof(KeyBuffer) - sizeof(WCHAR); rc = RegQueryValueExW(hKey, ClassGUID, NULL, NULL, (LPBYTE)KeyBuffer, &dwLength); RegCloseKey(hKey); if (rc != ERROR_SUCCESS) - { - HeapFree(GetProcessHeap(), 0, InstancePath); - RegCloseKey(hDeviceInstanceKey); - RegCloseKey(hInterfaceKey); - return rc; - } + goto cleanup; KeyBuffer[dwLength / sizeof(WCHAR)] = '\0'; KeyBuffer[37] = '\0'; /* Replace the } by a NULL character */ if (UuidFromStringW(&KeyBuffer[1], &ClassGuid) != RPC_S_OK) { - HeapFree(GetProcessHeap(), 0, InstancePath); - RegCloseKey(hDeviceInstanceKey); - RegCloseKey(hInterfaceKey); - return ERROR_GEN_FAILURE; + rc = ERROR_GEN_FAILURE; + goto cleanup; } TRACE("ClassGUID %s\n", debugstr_guid(&ClassGuid)); /* If current device doesn't match the list GUID (if any), skip this entry */ if (!IsEqualIID(&list->ClassGuid, &GUID_NULL) && !IsEqualIID(&list->ClassGuid, &ClassGuid)) - { - HeapFree(GetProcessHeap(), 0, InstancePath); - RegCloseKey(hDeviceInstanceKey); continue; - } /* Enumerate subkeys of hDeviceInstanceKey (ie "#ReferenceString" in IoRegisterDeviceInterface). Skip entries that don't start with '#' */ j = 0; while (TRUE) { - LPWSTR pSymbolicLink; struct DeviceInterface *interfaceInfo; dwLength = sizeof(KeyBuffer) / sizeof(KeyBuffer[0]); @@ -1778,88 +1766,73 @@ if (rc == ERROR_NO_MORE_ITEMS) break; if (rc != ERROR_SUCCESS) - { - HeapFree(GetProcessHeap(), 0, InstancePath); - RegCloseKey(hDeviceInstanceKey); - RegCloseKey(hInterfaceKey); - return rc; - } + goto cleanup; j++; if (KeyBuffer[0] != '#') /* This entry doesn't represent an interesting entry */ continue; /* Open sub key */ + if (hReferenceKey != INVALID_HANDLE_VALUE) + RegCloseKey(hReferenceKey); rc = RegOpenKeyExW(hDeviceInstanceKey, KeyBuffer, 0, KEY_QUERY_VALUE, &hReferenceKey); if (rc != ERROR_SUCCESS) - { - RegCloseKey(hDeviceInstanceKey); - RegCloseKey(hInterfaceKey); - return rc; - } + goto cleanup; /* Read SymbolicLink value */ rc = RegQueryValueExW(hReferenceKey, SymbolicLink, NULL, &dwRegType, NULL, &dwLength); if (rc != ERROR_SUCCESS ) - { - RegCloseKey(hReferenceKey); - RegCloseKey(hDeviceInstanceKey); - RegCloseKey(hInterfaceKey); - return rc; - } + goto cleanup; if (dwRegType != REG_SZ) { - RegCloseKey(hReferenceKey); - RegCloseKey(hDeviceInstanceKey); - RegCloseKey(hInterfaceKey); - return ERROR_GEN_FAILURE; + rc = ERROR_GEN_FAILURE; + goto cleanup; } /* We have found a device */ /* Step 1. Create a device info element */ if (!CreateDeviceInfoElement(list, InstancePath, &ClassGuid, &deviceInfo)) { - RegCloseKey(hReferenceKey); - RegCloseKey(hDeviceInstanceKey); - RegCloseKey(hInterfaceKey); - return GetLastError(); + rc = GetLastError(); + goto cleanup; } TRACE("Adding device %s to list\n", debugstr_w(InstancePath)); InsertTailList(&list->ListHead, &deviceInfo->ListEntry); /* Step 2. Create an interface list for this element */ + if (pSymbolicLink != NULL) + HeapFree(GetProcessHeap(), 0, pSymbolicLink); pSymbolicLink = HeapAlloc(GetProcessHeap(), 0, (dwLength + 1) * sizeof(WCHAR)); if (!pSymbolicLink) { - RegCloseKey(hReferenceKey); - RegCloseKey(hDeviceInstanceKey); - RegCloseKey(hInterfaceKey); - return ERROR_NOT_ENOUGH_MEMORY; + rc = ERROR_NOT_ENOUGH_MEMORY; + goto cleanup; } rc = RegQueryValueExW(hReferenceKey, SymbolicLink, NULL, NULL, (LPBYTE)pSymbolicLink, &dwLength); pSymbolicLink[dwLength / sizeof(WCHAR)] = '\0'; RegCloseKey(hReferenceKey); if (rc != ERROR_SUCCESS) - { - HeapFree(GetProcessHeap(), 0, pSymbolicLink); - RegCloseKey(hDeviceInstanceKey); - RegCloseKey(hInterfaceKey); - return rc; - } + goto cleanup; if (!CreateDeviceInterface(deviceInfo, pSymbolicLink, InterfaceGuid, &interfaceInfo)) { - HeapFree(GetProcessHeap(), 0, pSymbolicLink); - RegCloseKey(hDeviceInstanceKey); - RegCloseKey(hInterfaceKey); - return GetLastError(); + rc = GetLastError(); + goto cleanup; } /* Step 3. Update flags */ if (KeyBuffer[1] == '\0') interfaceInfo->Flags |= SPINT_DEFAULT; rc = RegOpenKeyExW(hReferenceKey, Control, 0, KEY_QUERY_VALUE, &hControlKey); - if (!rc) - interfaceInfo->Flags |= SPINT_REMOVED; + if (rc != ERROR_SUCCESS) + { + if (OnlyPresentInterfaces) + { + DestroyDeviceInterface(interfaceInfo); + continue; + } + else + interfaceInfo->Flags |= SPINT_REMOVED; + } else { dwLength = sizeof(DWORD); @@ -1870,13 +1843,23 @@ } TRACE("Adding interface %s to list\n", debugstr_w(pSymbolicLink)); - HeapFree(GetProcessHeap(), 0, pSymbolicLink); InsertTailList(&deviceInfo->InterfaceListHead, &interfaceInfo->ListEntry); } + } + rc = ERROR_SUCCESS; + +cleanup: + if (hReferenceKey != INVALID_HANDLE_VALUE) + RegCloseKey(hReferenceKey); + if (hDeviceInstanceKey != INVALID_HANDLE_VALUE) RegCloseKey(hDeviceInstanceKey); - } - RegCloseKey(hInterfaceKey); - return ERROR_SUCCESS; + if (hInterfaceKey != INVALID_HANDLE_VALUE) + RegCloseKey(hInterfaceKey); + if (InstancePath != NULL) + HeapFree(GetProcessHeap(), 0, InstancePath); + if (pSymbolicLink != NULL) + HeapFree(GetProcessHeap(), 0, pSymbolicLink); + return rc; } /*********************************************************************** @@ -1925,8 +1908,6 @@ else pClassGuid = &list->ClassGuid; - if (flags & DIGCF_PRESENT) - FIXME(": flag DIGCF_PRESENT ignored\n"); if (flags & DIGCF_PROFILE) FIXME(": flag DIGCF_PROFILE ignored\n"); @@ -1952,7 +1933,7 @@ return INVALID_HANDLE_VALUE; } - rc = SETUP_CreateInterfaceList(list, machine, (LPGUID)class, enumstr); + rc = SETUP_CreateInterfaceList(list, machine, (LPGUID)class, enumstr, flags & DIGCF_PRESENT); if (rc != ERROR_SUCCESS) { SetLastError(rc); @@ -2384,18 +2365,21 @@ { PLIST_ENTRY ListEntry; struct DriverInfoElement *driverInfo; + struct DeviceInterface *deviceInterface; while (!IsListEmpty(&deviceInfo->DriverListHead)) { ListEntry = RemoveHeadList(&deviceInfo->DriverListHead); - driverInfo = (struct DriverInfoElement *)ListEntry; + driverInfo = CONTAINING_RECORD(ListEntry, struct DriverInfoElement, ListEntry); if (!DestroyDriverInfoElement(driverInfo)) return FALSE; } while (!IsListEmpty(&deviceInfo->InterfaceListHead)) { ListEntry = RemoveHeadList(&deviceInfo->InterfaceListHead); - HeapFree(GetProcessHeap(), 0, ListEntry); + deviceInterface = CONTAINING_RECORD(ListEntry, struct DeviceInterface, ListEntry); + if (!DestroyDeviceInterface(deviceInterface)) + return FALSE; } DestroyClassInstallParams(&deviceInfo->ClassInstallParams); HeapFree(GetProcessHeap(), 0, deviceInfo);
18 years, 6 months
1
0
0
0
[ekohl] 21825: Update Indentation (tab->4spaces).
by ekohl@svn.reactos.org
Author: ekohl Date: Sun May 7 15:14:41 2006 New Revision: 21825 URL:
http://svn.reactos.ru/svn/reactos?rev=21825&view=rev
Log: Update Indentation (tab->4spaces). Modified: trunk/reactos/drivers/filesystems/ms/create.c trunk/reactos/drivers/filesystems/ms/finfo.c trunk/reactos/drivers/filesystems/ms/fsctrl.c trunk/reactos/drivers/filesystems/ms/msfs.c trunk/reactos/drivers/filesystems/ms/msfs.h trunk/reactos/drivers/filesystems/ms/msfs.rbuild trunk/reactos/drivers/filesystems/ms/rw.c Modified: trunk/reactos/drivers/filesystems/ms/create.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/filesystems/ms/crea…
============================================================================== --- trunk/reactos/drivers/filesystems/ms/create.c (original) +++ trunk/reactos/drivers/filesystems/ms/create.c Sun May 7 15:14:41 2006 @@ -2,9 +2,9 @@ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel - * FILE: services/fs/ms/create.c + * FILE: drivers/filesystems/ms/create.c * PURPOSE: Mailslot filesystem - * PROGRAMMER: Eric Kohl <ekohl(a)rz-online.de> + * PROGRAMMER: Eric Kohl */ /* INCLUDES ******************************************************************/ @@ -19,300 +19,296 @@ NTSTATUS DEFAULTAPI MsfsCreate(PDEVICE_OBJECT DeviceObject, - PIRP Irp) + PIRP Irp) { - PIO_STACK_LOCATION IoStack; - PFILE_OBJECT FileObject; - PMSFS_DEVICE_EXTENSION DeviceExtension; - PMSFS_FCB Fcb; - PMSFS_CCB Ccb; - PMSFS_FCB current = NULL; - PLIST_ENTRY current_entry; - KIRQL oldIrql; - - DPRINT("MsfsCreate(DeviceObject %p Irp %p)\n", DeviceObject, Irp); - - IoStack = IoGetCurrentIrpStackLocation(Irp); - DeviceExtension = DeviceObject->DeviceExtension; - FileObject = IoStack->FileObject; - - DPRINT("Mailslot name: %wZ\n", &FileObject->FileName); - - Ccb = ExAllocatePool(NonPagedPool, sizeof(MSFS_CCB)); - if (Ccb == NULL) - { - Irp->IoStatus.Status = STATUS_NO_MEMORY; - Irp->IoStatus.Information = 0; - - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - return(STATUS_NO_MEMORY); - } - - KeLockMutex(&DeviceExtension->FcbListLock); - current_entry = DeviceExtension->FcbListHead.Flink; - while (current_entry != &DeviceExtension->FcbListHead) - { - current = CONTAINING_RECORD(current_entry, - MSFS_FCB, - FcbListEntry); - - if (!RtlCompareUnicodeString(&FileObject->FileName, ¤t->Name, TRUE)) - { - break; - } - - current_entry = current_entry->Flink; - } - - if (current_entry == &DeviceExtension->FcbListHead) - { - ExFreePool(Ccb); - KeUnlockMutex(&DeviceExtension->FcbListLock); - - Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; - Irp->IoStatus.Information = 0; - - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - return(STATUS_UNSUCCESSFUL); - } - - Fcb = current; - - KeAcquireSpinLock(&Fcb->CcbListLock, &oldIrql); - InsertTailList(&Fcb->CcbListHead, &Ccb->CcbListEntry); - KeReleaseSpinLock(&Fcb->CcbListLock, oldIrql); - - Fcb->ReferenceCount++; - - Ccb->Fcb = Fcb; - - KeUnlockMutex(&DeviceExtension->FcbListLock); - - FileObject->FsContext = Fcb; - FileObject->FsContext2 = Ccb; - FileObject->Flags |= FO_MAILSLOT; - - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = 0; - - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - return(STATUS_SUCCESS); + PIO_STACK_LOCATION IoStack; + PFILE_OBJECT FileObject; + PMSFS_DEVICE_EXTENSION DeviceExtension; + PMSFS_FCB Fcb; + PMSFS_CCB Ccb; + PMSFS_FCB current = NULL; + PLIST_ENTRY current_entry; + KIRQL oldIrql; + + DPRINT("MsfsCreate(DeviceObject %p Irp %p)\n", DeviceObject, Irp); + + IoStack = IoGetCurrentIrpStackLocation(Irp); + DeviceExtension = DeviceObject->DeviceExtension; + FileObject = IoStack->FileObject; + + DPRINT("Mailslot name: %wZ\n", &FileObject->FileName); + + Ccb = ExAllocatePool(NonPagedPool, sizeof(MSFS_CCB)); + if (Ccb == NULL) + { + Irp->IoStatus.Status = STATUS_NO_MEMORY; + Irp->IoStatus.Information = 0; + + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_NO_MEMORY; + } + + KeLockMutex(&DeviceExtension->FcbListLock); + current_entry = DeviceExtension->FcbListHead.Flink; + while (current_entry != &DeviceExtension->FcbListHead) + { + current = CONTAINING_RECORD(current_entry, + MSFS_FCB, + FcbListEntry); + + if (!RtlCompareUnicodeString(&FileObject->FileName, ¤t->Name, TRUE)) + break; + + current_entry = current_entry->Flink; + } + + if (current_entry == &DeviceExtension->FcbListHead) + { + ExFreePool(Ccb); + KeUnlockMutex(&DeviceExtension->FcbListLock); + + Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; + Irp->IoStatus.Information = 0; + + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return STATUS_UNSUCCESSFUL; + } + + Fcb = current; + + KeAcquireSpinLock(&Fcb->CcbListLock, &oldIrql); + InsertTailList(&Fcb->CcbListHead, &Ccb->CcbListEntry); + KeReleaseSpinLock(&Fcb->CcbListLock, oldIrql); + + Fcb->ReferenceCount++; + + Ccb->Fcb = Fcb; + + KeUnlockMutex(&DeviceExtension->FcbListLock); + + FileObject->FsContext = Fcb; + FileObject->FsContext2 = Ccb; + FileObject->Flags |= FO_MAILSLOT; + + Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Information = 0; + + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return STATUS_SUCCESS; } NTSTATUS DEFAULTAPI MsfsCreateMailslot(PDEVICE_OBJECT DeviceObject, - PIRP Irp) + PIRP Irp) { - PEXTENDED_IO_STACK_LOCATION IoStack; - PFILE_OBJECT FileObject; - PMSFS_DEVICE_EXTENSION DeviceExtension; - PMSFS_FCB Fcb; - PMSFS_CCB Ccb; - KIRQL oldIrql; - PLIST_ENTRY current_entry; - PMSFS_FCB current; - PMAILSLOT_CREATE_PARAMETERS Buffer; - - DPRINT("MsfsCreateMailslot(DeviceObject %p Irp %p)\n", DeviceObject, Irp); - - IoStack = (PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation(Irp); - DeviceExtension = DeviceObject->DeviceExtension; - FileObject = IoStack->FileObject; - Buffer = IoStack->Parameters.CreateMailslot.Parameters; - - DPRINT("Mailslot name: %wZ\n", &FileObject->FileName); - - Fcb = ExAllocatePool(NonPagedPool, sizeof(MSFS_FCB)); - if (Fcb == NULL) - { - Irp->IoStatus.Status = STATUS_NO_MEMORY; - Irp->IoStatus.Information = 0; - - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - return(STATUS_NO_MEMORY); - } - - Fcb->Name.Length = FileObject->FileName.Length; - Fcb->Name.MaximumLength = Fcb->Name.Length + sizeof(UNICODE_NULL); - Fcb->Name.Buffer = ExAllocatePool(NonPagedPool, Fcb->Name.MaximumLength); - if (Fcb->Name.Buffer == NULL) - { - ExFreePool(Fcb); - - Irp->IoStatus.Status = STATUS_NO_MEMORY; - Irp->IoStatus.Information = 0; - - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - return(STATUS_NO_MEMORY); - } - - RtlCopyUnicodeString(&Fcb->Name, &FileObject->FileName); - - Ccb = ExAllocatePool(NonPagedPool, sizeof(MSFS_CCB)); - if (Ccb == NULL) - { - ExFreePool(Fcb->Name.Buffer); - ExFreePool(Fcb); - - Irp->IoStatus.Status = STATUS_NO_MEMORY; - Irp->IoStatus.Information = 0; - - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - return(STATUS_NO_MEMORY); - } - - Fcb->ReferenceCount = 0; - InitializeListHead(&Fcb->CcbListHead); - KeInitializeSpinLock(&Fcb->CcbListLock); - - Fcb->MaxMessageSize = Buffer->MaximumMessageSize; - Fcb->MessageCount = 0; - Fcb->TimeOut = Buffer->ReadTimeout; - KeInitializeEvent(&Fcb->MessageEvent, - NotificationEvent, - FALSE); - - InitializeListHead(&Fcb->MessageListHead); - KeInitializeSpinLock(&Fcb->MessageListLock); - - KeLockMutex(&DeviceExtension->FcbListLock); - current_entry = DeviceExtension->FcbListHead.Flink; - while (current_entry != &DeviceExtension->FcbListHead) - { - current = CONTAINING_RECORD(current_entry, - MSFS_FCB, - FcbListEntry); - - if (!RtlCompareUnicodeString(&Fcb->Name, ¤t->Name, TRUE)) - { - break; - } - - current_entry = current_entry->Flink; - } - - if (current_entry != &DeviceExtension->FcbListHead) - { - ExFreePool(Fcb->Name.Buffer); - ExFreePool(Fcb); - - Fcb = current; - } - else - { - InsertTailList(&DeviceExtension->FcbListHead, - &Fcb->FcbListEntry); - } - - KeAcquireSpinLock(&Fcb->CcbListLock, &oldIrql); - InsertTailList(&Fcb->CcbListHead, &Ccb->CcbListEntry); - KeReleaseSpinLock(&Fcb->CcbListLock, oldIrql); - - Fcb->ReferenceCount++; - Fcb->ServerCcb = Ccb; - Ccb->Fcb = Fcb; - - KeUnlockMutex(&DeviceExtension->FcbListLock); - - FileObject->FsContext = Fcb; - FileObject->FsContext2 = Ccb; - FileObject->Flags |= FO_MAILSLOT; - - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = 0; - - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - return(STATUS_SUCCESS); + PEXTENDED_IO_STACK_LOCATION IoStack; + PFILE_OBJECT FileObject; + PMSFS_DEVICE_EXTENSION DeviceExtension; + PMSFS_FCB Fcb; + PMSFS_CCB Ccb; + KIRQL oldIrql; + PLIST_ENTRY current_entry; + PMSFS_FCB current; + PMAILSLOT_CREATE_PARAMETERS Buffer; + + DPRINT("MsfsCreateMailslot(DeviceObject %p Irp %p)\n", DeviceObject, Irp); + + IoStack = (PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation(Irp); + DeviceExtension = DeviceObject->DeviceExtension; + FileObject = IoStack->FileObject; + Buffer = IoStack->Parameters.CreateMailslot.Parameters; + + DPRINT("Mailslot name: %wZ\n", &FileObject->FileName); + + Fcb = ExAllocatePool(NonPagedPool, sizeof(MSFS_FCB)); + if (Fcb == NULL) + { + Irp->IoStatus.Status = STATUS_NO_MEMORY; + Irp->IoStatus.Information = 0; + + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return STATUS_NO_MEMORY; + } + + Fcb->Name.Length = FileObject->FileName.Length; + Fcb->Name.MaximumLength = Fcb->Name.Length + sizeof(UNICODE_NULL); + Fcb->Name.Buffer = ExAllocatePool(NonPagedPool, Fcb->Name.MaximumLength); + if (Fcb->Name.Buffer == NULL) + { + ExFreePool(Fcb); + + Irp->IoStatus.Status = STATUS_NO_MEMORY; + Irp->IoStatus.Information = 0; + + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return STATUS_NO_MEMORY; + } + + RtlCopyUnicodeString(&Fcb->Name, &FileObject->FileName); + + Ccb = ExAllocatePool(NonPagedPool, sizeof(MSFS_CCB)); + if (Ccb == NULL) + { + ExFreePool(Fcb->Name.Buffer); + ExFreePool(Fcb); + + Irp->IoStatus.Status = STATUS_NO_MEMORY; + Irp->IoStatus.Information = 0; + + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return STATUS_NO_MEMORY; + } + + Fcb->ReferenceCount = 0; + InitializeListHead(&Fcb->CcbListHead); + KeInitializeSpinLock(&Fcb->CcbListLock); + + Fcb->MaxMessageSize = Buffer->MaximumMessageSize; + Fcb->MessageCount = 0; + Fcb->TimeOut = Buffer->ReadTimeout; + KeInitializeEvent(&Fcb->MessageEvent, + NotificationEvent, + FALSE); + + InitializeListHead(&Fcb->MessageListHead); + KeInitializeSpinLock(&Fcb->MessageListLock); + + KeLockMutex(&DeviceExtension->FcbListLock); + current_entry = DeviceExtension->FcbListHead.Flink; + while (current_entry != &DeviceExtension->FcbListHead) + { + current = CONTAINING_RECORD(current_entry, + MSFS_FCB, + FcbListEntry); + + if (!RtlCompareUnicodeString(&Fcb->Name, ¤t->Name, TRUE)) + break; + + current_entry = current_entry->Flink; + } + + if (current_entry != &DeviceExtension->FcbListHead) + { + ExFreePool(Fcb->Name.Buffer); + ExFreePool(Fcb); + + Fcb = current; + } + else + { + InsertTailList(&DeviceExtension->FcbListHead, + &Fcb->FcbListEntry); + } + + KeAcquireSpinLock(&Fcb->CcbListLock, &oldIrql); + InsertTailList(&Fcb->CcbListHead, &Ccb->CcbListEntry); + KeReleaseSpinLock(&Fcb->CcbListLock, oldIrql); + + Fcb->ReferenceCount++; + Fcb->ServerCcb = Ccb; + Ccb->Fcb = Fcb; + + KeUnlockMutex(&DeviceExtension->FcbListLock); + + FileObject->FsContext = Fcb; + FileObject->FsContext2 = Ccb; + FileObject->Flags |= FO_MAILSLOT; + + Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Information = 0; + + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return STATUS_SUCCESS; } NTSTATUS DEFAULTAPI MsfsClose(PDEVICE_OBJECT DeviceObject, - PIRP Irp) + PIRP Irp) { - PIO_STACK_LOCATION IoStack; - PFILE_OBJECT FileObject; - PMSFS_DEVICE_EXTENSION DeviceExtension; - PMSFS_FCB Fcb; - PMSFS_CCB Ccb; - PMSFS_MESSAGE Message; - KIRQL oldIrql; - - DPRINT("MsfsClose(DeviceObject %p Irp %p)\n", DeviceObject, Irp); - - IoStack = IoGetCurrentIrpStackLocation(Irp); - DeviceExtension = DeviceObject->DeviceExtension; - FileObject = IoStack->FileObject; - - KeLockMutex(&DeviceExtension->FcbListLock); - - if (DeviceExtension->FcbListHead.Flink == &DeviceExtension->FcbListHead) - { - KeUnlockMutex(&DeviceExtension->FcbListLock); - - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = 0; - - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - return(STATUS_SUCCESS); - } - - Fcb = FileObject->FsContext; - Ccb = FileObject->FsContext2; - - DPRINT("Mailslot name: %wZ\n", &Fcb->Name); - - Fcb->ReferenceCount--; - if (Fcb->ServerCcb == Ccb) - { - /* delete all messages from message-list */ - KeAcquireSpinLock(&Fcb->MessageListLock, &oldIrql); - - while (Fcb->MessageListHead.Flink != &Fcb->MessageListHead) - { - Message = CONTAINING_RECORD(Fcb->MessageListHead.Flink, - MSFS_MESSAGE, - MessageListEntry); - RemoveEntryList(Fcb->MessageListHead.Flink); - ExFreePool(Message); - } - Fcb->MessageCount = 0; - - KeReleaseSpinLock(&Fcb->MessageListLock, oldIrql); - Fcb->ServerCcb = NULL; - } - - KeAcquireSpinLock(&Fcb->CcbListLock, &oldIrql); - RemoveEntryList(&Ccb->CcbListEntry); - KeReleaseSpinLock(&Fcb->CcbListLock, oldIrql); - ExFreePool(Ccb); - FileObject->FsContext2 = NULL; - - if (Fcb->ReferenceCount == 0) - { - DPRINT1("ReferenceCount == 0: Deleting mailslot data\n"); - RemoveEntryList(&Fcb->FcbListEntry); - ExFreePool(Fcb->Name.Buffer); - ExFreePool(Fcb); - } - - KeUnlockMutex(&DeviceExtension->FcbListLock); - - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = 0; - - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - return(STATUS_SUCCESS); + PIO_STACK_LOCATION IoStack; + PFILE_OBJECT FileObject; + PMSFS_DEVICE_EXTENSION DeviceExtension; + PMSFS_FCB Fcb; + PMSFS_CCB Ccb; + PMSFS_MESSAGE Message; + KIRQL oldIrql; + + DPRINT("MsfsClose(DeviceObject %p Irp %p)\n", DeviceObject, Irp); + + IoStack = IoGetCurrentIrpStackLocation(Irp); + DeviceExtension = DeviceObject->DeviceExtension; + FileObject = IoStack->FileObject; + + KeLockMutex(&DeviceExtension->FcbListLock); + + if (DeviceExtension->FcbListHead.Flink == &DeviceExtension->FcbListHead) + { + KeUnlockMutex(&DeviceExtension->FcbListLock); + + Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Information = 0; + + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return STATUS_SUCCESS; + } + + Fcb = FileObject->FsContext; + Ccb = FileObject->FsContext2; + + DPRINT("Mailslot name: %wZ\n", &Fcb->Name); + + Fcb->ReferenceCount--; + if (Fcb->ServerCcb == Ccb) + { + /* delete all messages from message-list */ + KeAcquireSpinLock(&Fcb->MessageListLock, &oldIrql); + + while (Fcb->MessageListHead.Flink != &Fcb->MessageListHead) + { + Message = CONTAINING_RECORD(Fcb->MessageListHead.Flink, + MSFS_MESSAGE, + MessageListEntry); + RemoveEntryList(Fcb->MessageListHead.Flink); + ExFreePool(Message); + } + + Fcb->MessageCount = 0; + + KeReleaseSpinLock(&Fcb->MessageListLock, oldIrql); + Fcb->ServerCcb = NULL; + } + + KeAcquireSpinLock(&Fcb->CcbListLock, &oldIrql); + RemoveEntryList(&Ccb->CcbListEntry); + KeReleaseSpinLock(&Fcb->CcbListLock, oldIrql); + ExFreePool(Ccb); + FileObject->FsContext2 = NULL; + + if (Fcb->ReferenceCount == 0) + { + DPRINT1("ReferenceCount == 0: Deleting mailslot data\n"); + RemoveEntryList(&Fcb->FcbListEntry); + ExFreePool(Fcb->Name.Buffer); + ExFreePool(Fcb); + } + + KeUnlockMutex(&DeviceExtension->FcbListLock); + + Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Information = 0; + + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return STATUS_SUCCESS; } /* EOF */ Modified: trunk/reactos/drivers/filesystems/ms/finfo.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/filesystems/ms/finf…
============================================================================== --- trunk/reactos/drivers/filesystems/ms/finfo.c (original) +++ trunk/reactos/drivers/filesystems/ms/finfo.c Sun May 7 15:14:41 2006 @@ -2,9 +2,9 @@ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel - * FILE: services/fs/ms/finfo.c + * FILE: drivers/filesystems/ms/finfo.c * PURPOSE: Mailslot filesystem - * PROGRAMMER: Eric Kohl <ekohl(a)rz-online.de> + * PROGRAMMER: Eric Kohl */ /* INCLUDES ******************************************************************/ @@ -19,176 +19,175 @@ static NTSTATUS MsfsQueryMailslotInformation(PMSFS_FCB Fcb, - PFILE_MAILSLOT_QUERY_INFORMATION Buffer, - PULONG BufferLength) + PFILE_MAILSLOT_QUERY_INFORMATION Buffer, + PULONG BufferLength) { - KIRQL oldIrql; + KIRQL oldIrql; - if (*BufferLength < sizeof(FILE_MAILSLOT_QUERY_INFORMATION)) - return(STATUS_BUFFER_OVERFLOW); + if (*BufferLength < sizeof(FILE_MAILSLOT_QUERY_INFORMATION)) + return STATUS_BUFFER_OVERFLOW; - Buffer->MaximumMessageSize = Fcb->MaxMessageSize; - Buffer->ReadTimeout = Fcb->TimeOut; + Buffer->MaximumMessageSize = Fcb->MaxMessageSize; + Buffer->ReadTimeout = Fcb->TimeOut; - KeAcquireSpinLock(&Fcb->MessageListLock, &oldIrql); - Buffer->MessagesAvailable = Fcb->MessageCount; - if (Fcb->MessageCount == 0) - { - Buffer->NextMessageSize = MAILSLOT_NO_MESSAGE; - } - else - { - /* FIXME: read size of first message (head) */ - Buffer->NextMessageSize = 0; - } - KeReleaseSpinLock(&Fcb->MessageListLock, oldIrql); + KeAcquireSpinLock(&Fcb->MessageListLock, &oldIrql); + Buffer->MessagesAvailable = Fcb->MessageCount; + if (Fcb->MessageCount == 0) + { + Buffer->NextMessageSize = MAILSLOT_NO_MESSAGE; + } + else + { + /* FIXME: read size of first message (head) */ + Buffer->NextMessageSize = 0; + } + KeReleaseSpinLock(&Fcb->MessageListLock, oldIrql); - *BufferLength -= sizeof(FILE_MAILSLOT_QUERY_INFORMATION); + *BufferLength -= sizeof(FILE_MAILSLOT_QUERY_INFORMATION); - return(STATUS_SUCCESS); + return STATUS_SUCCESS; } static NTSTATUS MsfsSetMailslotInformation(PMSFS_FCB Fcb, - PFILE_MAILSLOT_SET_INFORMATION Buffer, - PULONG BufferLength) + PFILE_MAILSLOT_SET_INFORMATION Buffer, + PULONG BufferLength) { - if (*BufferLength < sizeof(FILE_MAILSLOT_SET_INFORMATION)) - return(STATUS_BUFFER_OVERFLOW); + if (*BufferLength < sizeof(FILE_MAILSLOT_SET_INFORMATION)) + return STATUS_BUFFER_OVERFLOW; - Fcb->TimeOut = *Buffer->ReadTimeout; + Fcb->TimeOut = *Buffer->ReadTimeout; - return(STATUS_SUCCESS); + return STATUS_SUCCESS; } NTSTATUS DEFAULTAPI MsfsQueryInformation(PDEVICE_OBJECT DeviceObject, - PIRP Irp) + PIRP Irp) { - PIO_STACK_LOCATION IoStack; - FILE_INFORMATION_CLASS FileInformationClass; - PFILE_OBJECT FileObject; - PMSFS_DEVICE_EXTENSION DeviceExtension; - PMSFS_FCB Fcb; - PMSFS_CCB Ccb; - PVOID SystemBuffer; - ULONG BufferLength; - NTSTATUS Status; + PIO_STACK_LOCATION IoStack; + FILE_INFORMATION_CLASS FileInformationClass; + PFILE_OBJECT FileObject; + PMSFS_DEVICE_EXTENSION DeviceExtension; + PMSFS_FCB Fcb; + PMSFS_CCB Ccb; + PVOID SystemBuffer; + ULONG BufferLength; + NTSTATUS Status; - DPRINT("MsfsQueryInformation(DeviceObject %p Irp %p)\n", DeviceObject, Irp); + DPRINT("MsfsQueryInformation(DeviceObject %p Irp %p)\n", + DeviceObject, Irp); - IoStack = IoGetCurrentIrpStackLocation (Irp); - FileInformationClass = IoStack->Parameters.QueryFile.FileInformationClass; - DeviceExtension = DeviceObject->DeviceExtension; - FileObject = IoStack->FileObject; - Fcb = (PMSFS_FCB)FileObject->FsContext; - Ccb = (PMSFS_CCB)FileObject->FsContext2; + IoStack = IoGetCurrentIrpStackLocation (Irp); + FileInformationClass = IoStack->Parameters.QueryFile.FileInformationClass; + DeviceExtension = DeviceObject->DeviceExtension; + FileObject = IoStack->FileObject; + Fcb = (PMSFS_FCB)FileObject->FsContext; + Ccb = (PMSFS_CCB)FileObject->FsContext2; - DPRINT("Mailslot name: %wZ\n", &Fcb->Name); + DPRINT("Mailslot name: %wZ\n", &Fcb->Name); - /* querying information is not permitted on client side */ - if (Fcb->ServerCcb != Ccb) - { - Status = STATUS_ACCESS_DENIED; + /* querying information is not permitted on client side */ + if (Fcb->ServerCcb != Ccb) + { + Status = STATUS_ACCESS_DENIED; - Irp->IoStatus.Status = Status; - Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = Status; + Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, - IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); - return(Status); - } + return Status; + } - SystemBuffer = Irp->AssociatedIrp.SystemBuffer; - BufferLength = IoStack->Parameters.QueryFile.Length; + SystemBuffer = Irp->AssociatedIrp.SystemBuffer; + BufferLength = IoStack->Parameters.QueryFile.Length; - switch (FileInformationClass) - { - case FileMailslotQueryInformation: - Status = MsfsQueryMailslotInformation(Fcb, - SystemBuffer, - &BufferLength); - break; - default: - Status = STATUS_NOT_IMPLEMENTED; - } + switch (FileInformationClass) + { + case FileMailslotQueryInformation: + Status = MsfsQueryMailslotInformation(Fcb, + SystemBuffer, + &BufferLength); + break; - Irp->IoStatus.Status = Status; - if (NT_SUCCESS(Status)) - Irp->IoStatus.Information = - IoStack->Parameters.QueryFile.Length - BufferLength; - else - Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, - IO_NO_INCREMENT); + default: + Status = STATUS_NOT_IMPLEMENTED; + } - return(Status); + Irp->IoStatus.Status = Status; + if (NT_SUCCESS(Status)) + Irp->IoStatus.Information = + IoStack->Parameters.QueryFile.Length - BufferLength; + else + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return Status; } NTSTATUS DEFAULTAPI MsfsSetInformation(PDEVICE_OBJECT DeviceObject, - PIRP Irp) + PIRP Irp) { - PIO_STACK_LOCATION IoStack; - FILE_INFORMATION_CLASS FileInformationClass; - PFILE_OBJECT FileObject; - PMSFS_FCB Fcb; - PMSFS_CCB Ccb; - PVOID SystemBuffer; - ULONG BufferLength; - NTSTATUS Status; + PIO_STACK_LOCATION IoStack; + FILE_INFORMATION_CLASS FileInformationClass; + PFILE_OBJECT FileObject; + PMSFS_FCB Fcb; + PMSFS_CCB Ccb; + PVOID SystemBuffer; + ULONG BufferLength; + NTSTATUS Status; - DPRINT("MsfsSetInformation(DeviceObject %p Irp %p)\n", DeviceObject, Irp); + DPRINT("MsfsSetInformation(DeviceObject %p Irp %p)\n", DeviceObject, Irp); - IoStack = IoGetCurrentIrpStackLocation (Irp); - FileInformationClass = IoStack->Parameters.QueryFile.FileInformationClass; - FileObject = IoStack->FileObject; - Fcb = (PMSFS_FCB)FileObject->FsContext; - Ccb = (PMSFS_CCB)FileObject->FsContext2; + IoStack = IoGetCurrentIrpStackLocation (Irp); + FileInformationClass = IoStack->Parameters.QueryFile.FileInformationClass; + FileObject = IoStack->FileObject; + Fcb = (PMSFS_FCB)FileObject->FsContext; + Ccb = (PMSFS_CCB)FileObject->FsContext2; - DPRINT("Mailslot name: %wZ\n", &Fcb->Name); + DPRINT("Mailslot name: %wZ\n", &Fcb->Name); - /* setting information is not permitted on client side */ - if (Fcb->ServerCcb != Ccb) - { - Status = STATUS_ACCESS_DENIED; + /* setting information is not permitted on client side */ + if (Fcb->ServerCcb != Ccb) + { + Status = STATUS_ACCESS_DENIED; - Irp->IoStatus.Status = Status; - Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = Status; + Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, - IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); - return(Status); - } + return Status; + } - SystemBuffer = Irp->AssociatedIrp.SystemBuffer; - BufferLength = IoStack->Parameters.QueryFile.Length; + SystemBuffer = Irp->AssociatedIrp.SystemBuffer; + BufferLength = IoStack->Parameters.QueryFile.Length; - DPRINT("FileInformationClass %d\n", FileInformationClass); - DPRINT("SystemBuffer %x\n", SystemBuffer); + DPRINT("FileInformationClass %d\n", FileInformationClass); + DPRINT("SystemBuffer %x\n", SystemBuffer); - switch (FileInformationClass) - { - case FileMailslotSetInformation: - Status = MsfsSetMailslotInformation(Fcb, - SystemBuffer, - &BufferLength); - break; + switch (FileInformationClass) + { + case FileMailslotSetInformation: + Status = MsfsSetMailslotInformation(Fcb, + SystemBuffer, + &BufferLength); + break; + default: - Status = STATUS_NOT_IMPLEMENTED; - } + Status = STATUS_NOT_IMPLEMENTED; + } - Irp->IoStatus.Status = Status; - Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, - IO_NO_INCREMENT); + Irp->IoStatus.Status = Status; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); - return(Status); + return Status; } /* EOF */ Modified: trunk/reactos/drivers/filesystems/ms/fsctrl.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/filesystems/ms/fsct…
============================================================================== --- trunk/reactos/drivers/filesystems/ms/fsctrl.c (original) +++ trunk/reactos/drivers/filesystems/ms/fsctrl.c Sun May 7 15:14:41 2006 @@ -2,9 +2,9 @@ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel - * FILE: services/fs/ms/fsctrl.c + * FILE: drivers/filesystems/ms/fsctrl.c * PURPOSE: Mailslot filesystem - * PROGRAMMER: Eric Kohl <ekohl(a)rz-online.de> + * PROGRAMMER: Eric Kohl */ /* INCLUDES ******************************************************************/ @@ -19,52 +19,37 @@ NTSTATUS DEFAULTAPI MsfsFileSystemControl(PDEVICE_OBJECT DeviceObject, - PIRP Irp) + PIRP Irp) { - PIO_STACK_LOCATION IoStack; - PFILE_OBJECT FileObject; - PMSFS_FCB Fcb; - PMSFS_CCB Ccb; - NTSTATUS Status; + PIO_STACK_LOCATION IoStack; + PFILE_OBJECT FileObject; + PMSFS_FCB Fcb; + PMSFS_CCB Ccb; + NTSTATUS Status; - DPRINT1("MsfsFileSystemControl(DeviceObject %p Irp %p)\n", DeviceObject, Irp); + DPRINT1("MsfsFileSystemControl(DeviceObject %p Irp %p)\n", DeviceObject, Irp); - IoStack = IoGetCurrentIrpStackLocation(Irp); - FileObject = IoStack->FileObject; - Fcb = FileObject->FsContext; - Ccb = FileObject->FsContext2; + IoStack = IoGetCurrentIrpStackLocation(Irp); + FileObject = IoStack->FileObject; + Fcb = FileObject->FsContext; + Ccb = FileObject->FsContext2; - DPRINT1("Mailslot name: %wZ\n", &Fcb->Name); + DPRINT1("Mailslot name: %wZ\n", &Fcb->Name); - switch (IoStack->Parameters.FileSystemControl.FsControlCode) - { + switch (IoStack->Parameters.FileSystemControl.FsControlCode) + { #if 0 - case FSCTL_WAIT_PIPE: - break; - - case FSCTL_LISTEN: - break; - - case FSCTL_SET_STATE: - break; - - case FSCTL_GET_STATE: - { - - - break; - } #endif - default: - Status = STATUS_NOT_IMPLEMENTED; - } + default: + Status = STATUS_NOT_IMPLEMENTED; + } - Irp->IoStatus.Status = Status; - Irp->IoStatus.Information = 0; - IoCompleteRequest (Irp, IO_NO_INCREMENT); + Irp->IoStatus.Status = Status; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); - return(Status); + return Status; } /* EOF */ Modified: trunk/reactos/drivers/filesystems/ms/msfs.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/filesystems/ms/msfs…
============================================================================== --- trunk/reactos/drivers/filesystems/ms/msfs.c (original) +++ trunk/reactos/drivers/filesystems/ms/msfs.c Sun May 7 15:14:41 2006 @@ -4,7 +4,7 @@ * PROJECT: ReactOS kernel * FILE: services/fs/ms/msfs.c * PURPOSE: Mailslot filesystem - * PROGRAMMER: Eric Kohl <ekohl(a)rz-online.de> + * PROGRAMMER: Eric Kohl */ /* INCLUDES ******************************************************************/ @@ -19,63 +19,63 @@ NTSTATUS NTAPI DriverEntry(PDRIVER_OBJECT DriverObject, - PUNICODE_STRING RegistryPath) + PUNICODE_STRING RegistryPath) { - PMSFS_DEVICE_EXTENSION DeviceExtension; - PDEVICE_OBJECT DeviceObject; - UNICODE_STRING DeviceName; - NTSTATUS Status; + PMSFS_DEVICE_EXTENSION DeviceExtension; + PDEVICE_OBJECT DeviceObject; + UNICODE_STRING DeviceName; + NTSTATUS Status; - DPRINT("Mailslot FSD 0.0.1\n"); + DPRINT("Mailslot FSD 0.0.1\n"); - DriverObject->Flags = 0; - DriverObject->MajorFunction[IRP_MJ_CREATE] = MsfsCreate; - DriverObject->MajorFunction[IRP_MJ_CREATE_MAILSLOT] = - MsfsCreateMailslot; - DriverObject->MajorFunction[IRP_MJ_CLOSE] = MsfsClose; - DriverObject->MajorFunction[IRP_MJ_READ] = MsfsRead; - DriverObject->MajorFunction[IRP_MJ_WRITE] = MsfsWrite; - DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = - MsfsQueryInformation; - DriverObject->MajorFunction[IRP_MJ_SET_INFORMATION] = - MsfsSetInformation; -// DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] = -// MsfsDirectoryControl; -// DriverObject->MajorFunction[IRP_MJ_FLUSH_BUFFERS] = MsfsFlushBuffers; -// DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = MsfsShutdown; -// DriverObject->MajorFunction[IRP_MJ_QUERY_SECURITY] = -// MsfsQuerySecurity; -// DriverObject->MajorFunction[IRP_MJ_SET_SECURITY] = -// MsfsSetSecurity; - DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = - MsfsFileSystemControl; + DriverObject->Flags = 0; + DriverObject->MajorFunction[IRP_MJ_CREATE] = MsfsCreate; + DriverObject->MajorFunction[IRP_MJ_CREATE_MAILSLOT] = + MsfsCreateMailslot; + DriverObject->MajorFunction[IRP_MJ_CLOSE] = MsfsClose; + DriverObject->MajorFunction[IRP_MJ_READ] = MsfsRead; + DriverObject->MajorFunction[IRP_MJ_WRITE] = MsfsWrite; + DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = + MsfsQueryInformation; + DriverObject->MajorFunction[IRP_MJ_SET_INFORMATION] = + MsfsSetInformation; +// DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] = +// MsfsDirectoryControl; +// DriverObject->MajorFunction[IRP_MJ_FLUSH_BUFFERS] = MsfsFlushBuffers; +// DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = MsfsShutdown; +// DriverObject->MajorFunction[IRP_MJ_QUERY_SECURITY] = +// MsfsQuerySecurity; +// DriverObject->MajorFunction[IRP_MJ_SET_SECURITY] = +// MsfsSetSecurity; + DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = + MsfsFileSystemControl; - DriverObject->DriverUnload = NULL; + DriverObject->DriverUnload = NULL; - RtlInitUnicodeString(&DeviceName, - L"\\Device\\MailSlot"); - Status = IoCreateDevice(DriverObject, - sizeof(MSFS_DEVICE_EXTENSION), - &DeviceName, - FILE_DEVICE_MAILSLOT, - 0, - FALSE, - &DeviceObject); - if (!NT_SUCCESS(Status)) - { - return(Status); - } + RtlInitUnicodeString(&DeviceName, + L"\\Device\\MailSlot"); + Status = IoCreateDevice(DriverObject, + sizeof(MSFS_DEVICE_EXTENSION), + &DeviceName, + FILE_DEVICE_MAILSLOT, + 0, + FALSE, + &DeviceObject); + if (!NT_SUCCESS(Status)) + { + return Status; + } - /* initialize the device object */ - DeviceObject->Flags = DO_DIRECT_IO; + /* initialize the device object */ + DeviceObject->Flags = DO_DIRECT_IO; - /* initialize device extension */ - DeviceExtension = DeviceObject->DeviceExtension; - InitializeListHead(&DeviceExtension->FcbListHead); - KeInitializeMutex(&DeviceExtension->FcbListLock, - 0); + /* initialize device extension */ + DeviceExtension = DeviceObject->DeviceExtension; + InitializeListHead(&DeviceExtension->FcbListHead); + KeInitializeMutex(&DeviceExtension->FcbListLock, + 0); - return(STATUS_SUCCESS); + return STATUS_SUCCESS; } /* EOF */ Modified: trunk/reactos/drivers/filesystems/ms/msfs.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/filesystems/ms/msfs…
============================================================================== --- trunk/reactos/drivers/filesystems/ms/msfs.h (original) +++ trunk/reactos/drivers/filesystems/ms/msfs.h Sun May 7 15:14:41 2006 @@ -1,5 +1,13 @@ -#ifndef __SERVICES_FS_MS_MSFS_H -#define __SERVICES_FS_MS_MSFS_H +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: services/fs/ms/msfs.h + * PURPOSE: Mailslot filesystem + * PROGRAMMER: Eric Kohl + */ + +#ifndef __DRIVERS_FS_MS_MSFS_H +#define __DRIVERS_FS_MS_MSFS_H #include <ntifs.h> #include <ndk/ntndk.h> @@ -22,37 +30,40 @@ typedef struct _MSFS_DEVICE_EXTENSION { - LIST_ENTRY FcbListHead; - KMUTEX FcbListLock; + LIST_ENTRY FcbListHead; + KMUTEX FcbListLock; } MSFS_DEVICE_EXTENSION, *PMSFS_DEVICE_EXTENSION; + typedef struct _MSFS_FCB { - UNICODE_STRING Name; - LIST_ENTRY FcbListEntry; - KSPIN_LOCK CcbListLock; - LIST_ENTRY CcbListHead; - struct _MSFS_CCB *ServerCcb; - ULONG ReferenceCount; - LARGE_INTEGER TimeOut; - KEVENT MessageEvent; - ULONG MaxMessageSize; - ULONG MessageCount; - KSPIN_LOCK MessageListLock; - LIST_ENTRY MessageListHead; + UNICODE_STRING Name; + LIST_ENTRY FcbListEntry; + KSPIN_LOCK CcbListLock; + LIST_ENTRY CcbListHead; + struct _MSFS_CCB *ServerCcb; + ULONG ReferenceCount; + LARGE_INTEGER TimeOut; + KEVENT MessageEvent; + ULONG MaxMessageSize; + ULONG MessageCount; + KSPIN_LOCK MessageListLock; + LIST_ENTRY MessageListHead; } MSFS_FCB, *PMSFS_FCB; + typedef struct _MSFS_CCB { - LIST_ENTRY CcbListEntry; - PMSFS_FCB Fcb; + LIST_ENTRY CcbListEntry; + PMSFS_FCB Fcb; } MSFS_CCB, *PMSFS_CCB; + typedef struct _MSFS_MESSAGE { - LIST_ENTRY MessageListEntry; - ULONG Size; - UCHAR Buffer[1]; + LIST_ENTRY MessageListEntry; + ULONG Size; + UCHAR Buffer[1]; } MSFS_MESSAGE, *PMSFS_MESSAGE; @@ -78,6 +89,6 @@ NTSTATUS NTAPI DriverEntry(PDRIVER_OBJECT DriverObject, - PUNICODE_STRING RegistryPath); + PUNICODE_STRING RegistryPath); -#endif /* __SERVICES_FS_NP_NPFS_H */ +#endif /* __DRIVERS_FS_MS_MSFS_H */ Modified: trunk/reactos/drivers/filesystems/ms/msfs.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/filesystems/ms/msfs…
============================================================================== --- trunk/reactos/drivers/filesystems/ms/msfs.rbuild (original) +++ trunk/reactos/drivers/filesystems/ms/msfs.rbuild Sun May 7 15:14:41 2006 @@ -1,6 +1,6 @@ <module name="msfs" type="kernelmodedriver" installbase="system32/drivers" installname="msfs.sys"> <include base="msfs">.</include> - <define name="__USE_W32API" /> + <define name="__USE_W32API" /> <library>ntoskrnl</library> <library>hal</library> <file>create.c</file> Modified: trunk/reactos/drivers/filesystems/ms/rw.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/filesystems/ms/rw.c…
============================================================================== --- trunk/reactos/drivers/filesystems/ms/rw.c (original) +++ trunk/reactos/drivers/filesystems/ms/rw.c Sun May 7 15:14:41 2006 @@ -2,9 +2,9 @@ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel - * FILE: services/fs/ms/rw.c + * FILE: drivers/filesystems/ms/rw.c * PURPOSE: Mailslot filesystem - * PROGRAMMER: Eric Kohl <ekohl(a)rz-online.de> + * PROGRAMMER: Eric Kohl */ /* INCLUDES ******************************************************************/ @@ -19,155 +19,156 @@ NTSTATUS DEFAULTAPI MsfsRead(PDEVICE_OBJECT DeviceObject, - PIRP Irp) + PIRP Irp) { - PIO_STACK_LOCATION IoStack; - PFILE_OBJECT FileObject; - PMSFS_FCB Fcb; - PMSFS_CCB Ccb; - PMSFS_MESSAGE Message; - KIRQL oldIrql; - ULONG Length; - ULONG LengthRead = 0; - PVOID Buffer; - NTSTATUS Status; + PIO_STACK_LOCATION IoStack; + PFILE_OBJECT FileObject; + PMSFS_FCB Fcb; + PMSFS_CCB Ccb; + PMSFS_MESSAGE Message; + KIRQL oldIrql; + ULONG Length; + ULONG LengthRead = 0; + PVOID Buffer; + NTSTATUS Status; - DPRINT("MsfsRead(DeviceObject %p Irp %p)\n", DeviceObject, Irp); + DPRINT("MsfsRead(DeviceObject %p Irp %p)\n", DeviceObject, Irp); - IoStack = IoGetCurrentIrpStackLocation (Irp); - FileObject = IoStack->FileObject; - Fcb = (PMSFS_FCB)FileObject->FsContext; - Ccb = (PMSFS_CCB)FileObject->FsContext2; + IoStack = IoGetCurrentIrpStackLocation (Irp); + FileObject = IoStack->FileObject; + Fcb = (PMSFS_FCB)FileObject->FsContext; + Ccb = (PMSFS_CCB)FileObject->FsContext2; - DPRINT("MailslotName: %wZ\n", &Fcb->Name); + DPRINT("MailslotName: %wZ\n", &Fcb->Name); - /* reading is not permitted on client side */ - if (Fcb->ServerCcb != Ccb) - { - Irp->IoStatus.Status = STATUS_ACCESS_DENIED; - Irp->IoStatus.Information = 0; + /* reading is not permitted on client side */ + if (Fcb->ServerCcb != Ccb) + { + Irp->IoStatus.Status = STATUS_ACCESS_DENIED; + Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); - return(STATUS_ACCESS_DENIED); + return STATUS_ACCESS_DENIED; + } + + Length = IoStack->Parameters.Read.Length; + if (Irp->MdlAddress) + Buffer = MmGetSystemAddressForMdl (Irp->MdlAddress); + else + Buffer = Irp->UserBuffer; + + Status = KeWaitForSingleObject(&Fcb->MessageEvent, + UserRequest, + KernelMode, + FALSE, + NULL); /* FIXME: handle timeout */ + if ((NT_SUCCESS(Status)) && (Fcb->MessageCount > 0)) + { + /* copy current message into buffer */ + Message = CONTAINING_RECORD(Fcb->MessageListHead.Flink, + MSFS_MESSAGE, + MessageListEntry); + + memcpy(Buffer, &Message->Buffer, min(Message->Size,Length)); + LengthRead = Message->Size; + + KeAcquireSpinLock(&Fcb->MessageListLock, &oldIrql); + RemoveHeadList(&Fcb->MessageListHead); + KeReleaseSpinLock(&Fcb->MessageListLock, oldIrql); + + ExFreePool(Message); + Fcb->MessageCount--; + if (Fcb->MessageCount == 0) + { + KeClearEvent(&Fcb->MessageEvent); + } } - Length = IoStack->Parameters.Read.Length; - if (Irp->MdlAddress) - Buffer = MmGetSystemAddressForMdl (Irp->MdlAddress); - else - Buffer = Irp->UserBuffer; + Irp->IoStatus.Status = Status; + Irp->IoStatus.Information = LengthRead; - Status = KeWaitForSingleObject(&Fcb->MessageEvent, - UserRequest, - KernelMode, - FALSE, - NULL); /* FIXME: handle timeout */ - if ((NT_SUCCESS(Status)) && (Fcb->MessageCount > 0)) - { - /* copy current message into buffer */ - Message = CONTAINING_RECORD(Fcb->MessageListHead.Flink, - MSFS_MESSAGE, - MessageListEntry); - memcpy(Buffer, &Message->Buffer, min(Message->Size,Length)); - LengthRead = Message->Size; + IoCompleteRequest(Irp, IO_NO_INCREMENT); - KeAcquireSpinLock(&Fcb->MessageListLock, &oldIrql); - RemoveHeadList(&Fcb->MessageListHead); - KeReleaseSpinLock(&Fcb->MessageListLock, oldIrql); - - ExFreePool(Message); - Fcb->MessageCount--; - if (Fcb->MessageCount == 0) - { - KeClearEvent(&Fcb->MessageEvent); - } - } - - Irp->IoStatus.Status = Status; - Irp->IoStatus.Information = LengthRead; - - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - return(Status); + return Status; } NTSTATUS DEFAULTAPI MsfsWrite(PDEVICE_OBJECT DeviceObject, - PIRP Irp) + PIRP Irp) { - PIO_STACK_LOCATION IoStack; - PFILE_OBJECT FileObject; - PMSFS_FCB Fcb; - PMSFS_CCB Ccb; - PMSFS_MESSAGE Message; - KIRQL oldIrql; - ULONG Length; - PVOID Buffer; + PIO_STACK_LOCATION IoStack; + PFILE_OBJECT FileObject; + PMSFS_FCB Fcb; + PMSFS_CCB Ccb; + PMSFS_MESSAGE Message; + KIRQL oldIrql; + ULONG Length; + PVOID Buffer; - DPRINT("MsfsWrite(DeviceObject %p Irp %p)\n", DeviceObject, Irp); + DPRINT("MsfsWrite(DeviceObject %p Irp %p)\n", DeviceObject, Irp); - IoStack = IoGetCurrentIrpStackLocation (Irp); - FileObject = IoStack->FileObject; - Fcb = (PMSFS_FCB)FileObject->FsContext; - Ccb = (PMSFS_CCB)FileObject->FsContext2; + IoStack = IoGetCurrentIrpStackLocation (Irp); + FileObject = IoStack->FileObject; + Fcb = (PMSFS_FCB)FileObject->FsContext; + Ccb = (PMSFS_CCB)FileObject->FsContext2; - DPRINT("MailslotName: %wZ\n", &Fcb->Name); + DPRINT("MailslotName: %wZ\n", &Fcb->Name); - /* writing is not permitted on server side */ - if (Fcb->ServerCcb == Ccb) - { - Irp->IoStatus.Status = STATUS_ACCESS_DENIED; - Irp->IoStatus.Information = 0; + /* writing is not permitted on server side */ + if (Fcb->ServerCcb == Ccb) + { + Irp->IoStatus.Status = STATUS_ACCESS_DENIED; + Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); - return(STATUS_ACCESS_DENIED); - } + return STATUS_ACCESS_DENIED; + } - Length = IoStack->Parameters.Write.Length; - if (Irp->MdlAddress) - Buffer = MmGetSystemAddressForMdl (Irp->MdlAddress); - else - Buffer = Irp->UserBuffer; + Length = IoStack->Parameters.Write.Length; + if (Irp->MdlAddress) + Buffer = MmGetSystemAddressForMdl (Irp->MdlAddress); + else + Buffer = Irp->UserBuffer; - DPRINT("Length: %lu Message: %s\n", Length, (PUCHAR)Buffer); + DPRINT("Length: %lu Message: %s\n", Length, (PUCHAR)Buffer); - /* Allocate new message */ - Message = ExAllocatePool(NonPagedPool, - sizeof(MSFS_MESSAGE) + Length); - if (Message == NULL) - { - Irp->IoStatus.Status = STATUS_NO_MEMORY; - Irp->IoStatus.Information = 0; + /* Allocate new message */ + Message = ExAllocatePool(NonPagedPool, + sizeof(MSFS_MESSAGE) + Length); + if (Message == NULL) + { + Irp->IoStatus.Status = STATUS_NO_MEMORY; + Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); - return(STATUS_NO_MEMORY); - } + return STATUS_NO_MEMORY; + } - Message->Size = Length; - memcpy(&Message->Buffer, Buffer, Length); + Message->Size = Length; + memcpy(&Message->Buffer, Buffer, Length); - KeAcquireSpinLock(&Fcb->MessageListLock, &oldIrql); - InsertTailList(&Fcb->MessageListHead, &Message->MessageListEntry); - KeReleaseSpinLock(&Fcb->MessageListLock, oldIrql); + KeAcquireSpinLock(&Fcb->MessageListLock, &oldIrql); + InsertTailList(&Fcb->MessageListHead, &Message->MessageListEntry); + KeReleaseSpinLock(&Fcb->MessageListLock, oldIrql); - Fcb->MessageCount++; - if (Fcb->MessageCount == 1) - { - KeSetEvent(&Fcb->MessageEvent, - 0, - FALSE); - } + Fcb->MessageCount++; + if (Fcb->MessageCount == 1) + { + KeSetEvent(&Fcb->MessageEvent, + 0, + FALSE); + } - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = Length; + Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Information = Length; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_NO_INCREMENT); - return(STATUS_SUCCESS); + return STATUS_SUCCESS; } /* EOF */
18 years, 6 months
1
0
0
0
[ion] 21824: - Fix build.
by ion@svn.reactos.org
Author: ion Date: Sun May 7 14:52:14 2006 New Revision: 21824 URL:
http://svn.reactos.ru/svn/reactos?rev=21824&view=rev
Log: - Fix build. Modified: trunk/reactos/dll/directx/ddraw/rosdraw.h Modified: trunk/reactos/dll/directx/ddraw/rosdraw.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/rosdraw.h…
============================================================================== --- trunk/reactos/dll/directx/ddraw/rosdraw.h (original) +++ trunk/reactos/dll/directx/ddraw/rosdraw.h Sun May 7 14:52:14 2006 @@ -303,7 +303,7 @@ return DD_OK; -#define DX_STUB_str(x) \ +#define DX_STUB_str(x) \ { \ char buffer[1024]; \ sprintf ( buffer, "Function %s %s (%s:%d)\n", __FUNCTION__,x,__FILE__,__LINE__ ); \
18 years, 6 months
1
0
0
0
[hpoussin] 21823: Fix buffer overflow (spotted by Detlef Riekenberg in wine-devel ML)
by hpoussin@svn.reactos.org
Author: hpoussin Date: Sun May 7 13:32:56 2006 New Revision: 21823 URL:
http://svn.reactos.ru/svn/reactos?rev=21823&view=rev
Log: Fix buffer overflow (spotted by Detlef Riekenberg in wine-devel ML) Modified: trunk/reactos/dll/win32/setupapi/parser.c Modified: trunk/reactos/dll/win32/setupapi/parser.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/setupapi/parser.c…
============================================================================== --- trunk/reactos/dll/win32/setupapi/parser.c (original) +++ trunk/reactos/dll/win32/setupapi/parser.c Sun May 7 13:32:56 2006 @@ -953,10 +953,10 @@ else { WCHAR *new_buff = (WCHAR *)buffer; - /* Some UNICODE files may start with the UNICODE marker */ + /* UCS-16 files should start with the Unicode BOM; we should skip it */ if (*new_buff == 0xfeff) new_buff++; - err = parse_buffer( file, new_buff, (WCHAR *)((char *)new_buff + size), error_line ); + err = parse_buffer( file, new_buff, (WCHAR *)((char *)buffer + size), error_line ); } if (!err) /* now check signature */
18 years, 6 months
1
0
0
0
[fireball] 21822: [AUDIT] kernel32.dll - Eric Kohl states that mailslot.c and npipe.c are clean: "They implement simple interfaces to the mailslot and named pipe file system drivers and don't contain any tainted code."
by fireball@svn.reactos.org
Author: fireball Date: Sun May 7 13:23:22 2006 New Revision: 21822 URL:
http://svn.reactos.ru/svn/reactos?rev=21822&view=rev
Log: [AUDIT] kernel32.dll - Eric Kohl states that mailslot.c and npipe.c are clean: "They implement simple interfaces to the mailslot and named pipe file system drivers and don't contain any tainted code." Modified: trunk/reactos/dll/win32/kernel32/file/mailslot.c (props changed) trunk/reactos/dll/win32/kernel32/file/npipe.c (props changed) Propchange: trunk/reactos/dll/win32/kernel32/file/mailslot.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/win32/kernel32/file/npipe.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
18 years, 6 months
1
0
0
0
[greatlrd] 21821: merges HEL_SetCooperativeLevel and HAL_SetCooperativeLevel to MAIN_SetCooperativeLevel the new desgin allown us to use HEL as callbacks, we need change all HEL calls to the new desgin now
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun May 7 13:12:37 2006 New Revision: 21821 URL:
http://svn.reactos.ru/svn/reactos?rev=21821&view=rev
Log: merges HEL_SetCooperativeLevel and HAL_SetCooperativeLevel to MAIN_SetCooperativeLevel the new desgin allown us to use HEL as callbacks, we need change all HEL calls to the new desgin now Modified: trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c trunk/reactos/dll/directx/ddraw/main/ddraw_main.c trunk/reactos/dll/directx/ddraw/rosdraw.h trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c Modified: trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/hal/ddraw…
============================================================================== --- trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c (original) +++ trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c Sun May 7 13:12:37 2006 @@ -198,33 +198,6 @@ } - -HRESULT -Hal_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface) -{ - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - - DDHAL_SETEXCLUSIVEMODEDATA SetExclusiveMode; - - if (!(This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE)) - { - return DDERR_NODRIVERSUPPORT; - } - - SetExclusiveMode.lpDD = &This->mDDrawGlobal; - SetExclusiveMode.ddRVal = DDERR_NOTPALETTIZED; - SetExclusiveMode.dwEnterExcl = This->cooperative_level; - - if (This->mDDrawGlobal.lpDDCBtmp->HALDD.SetExclusiveMode(&SetExclusiveMode) != DDHAL_DRIVER_HANDLED) - { - return DDERR_NODRIVERSUPPORT; - } - - return SetExclusiveMode.ddRVal; -} - - - HRESULT Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps, LPDWORD total, LPDWORD free) Modified: trunk/reactos/dll/directx/ddraw/main/ddraw_main.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/ddra…
============================================================================== --- trunk/reactos/dll/directx/ddraw/main/ddraw_main.c (original) +++ trunk/reactos/dll/directx/ddraw/main/ddraw_main.c Sun May 7 13:12:37 2006 @@ -290,7 +290,8 @@ DX_WINDBG_trace(); IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - + DDHAL_SETEXCLUSIVEMODEDATA SetExclusiveMode; + // check the parameters if ((This->cooperative_level == cooplevel) && ((HWND)This->mDDrawGlobal.lpExclusiveOwner->hWnd == hwnd)) return DD_OK; @@ -314,13 +315,27 @@ This->cooperative_level = cooplevel; - if (This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE) - { - return Hal_DirectDraw_SetCooperativeLevel (iface); - } - - return Hel_DirectDraw_SetCooperativeLevel(iface); - + if ((This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE)) + { + DX_STUB_str("HAL \n"); + SetExclusiveMode.SetExclusiveMode = This->mDDrawGlobal.lpDDCBtmp->HALDD.SetExclusiveMode; + } + else + { + DX_STUB_str("HEL \n"); + SetExclusiveMode.SetExclusiveMode = This->mDDrawGlobal.lpDDCBtmp->HELDD.SetExclusiveMode; + } + + SetExclusiveMode.lpDD = &This->mDDrawGlobal; + SetExclusiveMode.ddRVal = DDERR_NOTPALETTIZED; + SetExclusiveMode.dwEnterExcl = This->cooperative_level; + + if (SetExclusiveMode.SetExclusiveMode(&SetExclusiveMode) != DDHAL_DRIVER_HANDLED) + { + return DDERR_NODRIVERSUPPORT; + } + + return SetExclusiveMode.ddRVal; } HRESULT WINAPI Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeight, Modified: trunk/reactos/dll/directx/ddraw/rosdraw.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/rosdraw.h…
============================================================================== --- trunk/reactos/dll/directx/ddraw/rosdraw.h (original) +++ trunk/reactos/dll/directx/ddraw/rosdraw.h Sun May 7 13:12:37 2006 @@ -303,15 +303,13 @@ return DD_OK; -#define DX_STUB_str(x) \ - static BOOL firstcall = TRUE; \ - if (firstcall) \ - { \ - char buffer[1024]; \ +#define DX_STUB_str(x) \ + { \ + char buffer[1024]; \ sprintf ( buffer, "Function %s %s (%s:%d)\n", __FUNCTION__,x,__FILE__,__LINE__ ); \ OutputDebugStringA(buffer); \ - firstcall = FALSE; \ - } + } + //#define DX_WINDBG_trace() Modified: trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/soft/ddra…
============================================================================== --- trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c (original) +++ trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c Sun May 7 13:12:37 2006 @@ -11,26 +11,7 @@ #include "rosdraw.h" -/* -HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 iface) -{ - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - This->HELMemoryAvilable = HEL_GRAPHIC_MEMORY_MAX; - - This->mCallbacks.HELDD.dwFlags = DDHAL_CB32_CANCREATESURFACE; - This->mCallbacks.HELDD.CanCreateSurface = HelDdCanCreateSurface; - - This->mCallbacks.HELDD.dwFlags = DDHAL_CB32_CREATESURFACE; - This->mCallbacks.HELDD.CreateSurface = HelDdCreateSurface; - - return DD_OK; -} */ - -HRESULT Hel_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface) -{ - return DD_OK; -} VOID Hel_DirectDraw_Release (LPDIRECTDRAW7 iface) { Modified: trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/soft/surf…
============================================================================== --- trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c (original) +++ trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c Sun May 7 13:12:37 2006 @@ -64,7 +64,9 @@ { DX_WINDBG_trace(); DX_STUB_str("Not implement yet, return DD_OK for not bsod\n"); - return DD_OK; + lpSetExclusiveMode->ddRVal = DD_OK; + + return DDHAL_DRIVER_HANDLED; } DWORD CALLBACK HelDdFlipToGDISurface(LPDDHAL_FLIPTOGDISURFACEDATA lpFlipToGDISurface)
18 years, 6 months
1
0
0
0
[greatlrd] 21820: Try again move to new redesign but now we take one step at time
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun May 7 12:41:26 2006 New Revision: 21820 URL:
http://svn.reactos.ru/svn/reactos?rev=21820&view=rev
Log: Try again move to new redesign but now we take one step at time Added: trunk/reactos/dll/directx/ddraw/helinterface.c (with props) Modified: trunk/reactos/dll/directx/ddraw/ddraw.rbuild trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c Modified: trunk/reactos/dll/directx/ddraw/ddraw.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/ddraw.rbu…
============================================================================== --- trunk/reactos/dll/directx/ddraw/ddraw.rbuild (original) +++ trunk/reactos/dll/directx/ddraw/ddraw.rbuild Sun May 7 12:41:26 2006 @@ -17,6 +17,7 @@ <file>ddraw.rc</file> <file>main.c</file> <file>regsvr.c</file> + <file>helinterface.c</file> <file>clipper.c</file> <file>color.c</file> Added: trunk/reactos/dll/directx/ddraw/helinterface.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/helinterf…
============================================================================== --- trunk/reactos/dll/directx/ddraw/helinterface.c (added) +++ trunk/reactos/dll/directx/ddraw/helinterface.c Sun May 7 12:41:26 2006 @@ -1,0 +1,40 @@ +#include "rosdraw.h" + +HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 iface) +{ + IDirectDrawImpl* This = (IDirectDrawImpl*)iface; + + This->HELMemoryAvilable = HEL_GRAPHIC_MEMORY_MAX; + + This->mCallbacks.HELDD.dwFlags = DDHAL_CB32_DESTROYDRIVER; + This->mCallbacks.HELDD.DestroyDriver = HelDdDestroyDriver; + + This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_CREATESURFACE; + This->mCallbacks.HELDD.CreateSurface = HelDdCreateSurface; + + // DDHAL_CB32_ + //This->mCallbacks.HELDD.SetColorKey = HelDdSetColorKey; + + This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_SETMODE; + This->mCallbacks.HELDD.SetMode = HelDdSetMode; + + This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_WAITFORVERTICALBLANK; + This->mCallbacks.HELDD.WaitForVerticalBlank = HelDdWaitForVerticalBlank; + + This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_CANCREATESURFACE; + This->mCallbacks.HELDD.CanCreateSurface = HelDdCanCreateSurface; + + This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_CREATEPALETTE; + This->mCallbacks.HELDD.CreatePalette = HelDdCreatePalette; + + This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_GETSCANLINE; + This->mCallbacks.HELDD.GetScanLine = HelDdGetScanLine; + + This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_SETEXCLUSIVEMODE; + This->mCallbacks.HELDD.SetExclusiveMode = HelDdSetExclusiveMode; + + This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_FLIPTOGDISURFACE; + This->mCallbacks.HELDD.FlipToGDISurface = HelDdFlipToGDISurface; + + return DD_OK; +} Propchange: trunk/reactos/dll/directx/ddraw/helinterface.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/dll/directx/ddraw/helinterface.c ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Modified: trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/soft/ddra…
============================================================================== --- trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c (original) +++ trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c Sun May 7 12:41:26 2006 @@ -11,7 +11,7 @@ #include "rosdraw.h" - +/* HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 iface) { IDirectDrawImpl* This = (IDirectDrawImpl*)iface; @@ -25,7 +25,7 @@ This->mCallbacks.HELDD.CreateSurface = HelDdCreateSurface; return DD_OK; -} +} */ HRESULT Hel_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface) { Modified: trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/soft/surf…
============================================================================== --- trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c (original) +++ trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c Sun May 7 12:41:26 2006 @@ -14,132 +14,61 @@ extern DDPIXELFORMAT pixelformats[]; extern DWORD pixelformatsCount; -DWORD CALLBACK HelDdCanCreateSurface(LPDDHAL_CANCREATESURFACEDATA pccsd) +/* + * Direct Draw Callbacks + */ + +DWORD CALLBACK HelDdDestroyDriver(LPDDHAL_DESTROYDRIVERDATA lpDestroyDriver) { - DWORD count; - - // FIXME check the HAL pixelformat table if it exists - - // FIXME check how big the surface in byte and report it can be create or not - // if we got egunt with HEL memmory - - - // HEL only support 16bits & 15bits Z-Buffer - if ((pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER) && - (pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) - { - pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT; - - if (DDSD_ZBUFFERBITDEPTH & pccsd->lpDDSurfaceDesc->dwFlags) - { - if (pccsd->lpDDSurfaceDesc->dwZBufferBitDepth == 16) - { - pccsd->ddRVal = DD_OK; - } - } - else - { - if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwZBufferBitDepth == 16) - { - pccsd->ddRVal = DD_OK; - } - } - return DDHAL_DRIVER_HANDLED; - } - - // Check diffent pixel format - if (pccsd->bIsDifferentPixelFormat) - { - //if(pccsd->ddpfPixelFormat.dwFlags & DDPF_FOURCC) - if(pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags & 0) - { - switch (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFourCC) - { - //case FOURCC_YUV422: - case 0: - // FIXME check if display is 8bmp or not if it return DDERR_INVALIDPIXELFORMAT - pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwYUVBitCount = 16; - pccsd->ddRVal = DD_OK; - return DDHAL_DRIVER_HANDLED; - - default: - pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT; - return DDHAL_DRIVER_HANDLED; - } - - } - else if((pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_TEXTURE)) - { - for(count=0;count< pixelformatsCount ;count++) - { - if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags != pixelformats->dwFlags) - { - continue; - } - - if (!(pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags & (DDPF_YUV | DDPF_FOURCC))) - { - if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount != pixelformats->dwRGBBitCount ) - { - continue; - } - } - - if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags & DDPF_RGB) - { - if ((pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwRBitMask != pixelformats->dwRBitMask) || - (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwGBitMask != pixelformats->dwGBitMask) || - (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwBBitMask != pixelformats->dwBBitMask) || - (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwRGBAlphaBitMask != pixelformats->dwRGBAlphaBitMask)) - { - continue; - } - } - - if (pccsd->lpDDSurfaceDesc->dwFlags & DDPF_YUV) - { - if ((pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFourCC != pixelformats->dwFourCC) || - (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwYUVBitCount != pixelformats->dwYUVBitCount) || - (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwYBitMask != pixelformats->dwYBitMask) || - (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwUBitMask != pixelformats->dwUBitMask) || - (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwVBitMask != pixelformats->dwVBitMask) || - (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwYUVAlphaBitMask != pixelformats->dwYUVAlphaBitMask)) - { - continue; - } - } - else if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags & DDPF_FOURCC) - { - - if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFourCC != pixelformats->dwFourCC) - { - continue; - } - } - if (pccsd->lpDDSurfaceDesc->dwFlags & DDPF_ZPIXELS) - { - if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwRGBZBitMask != pixelformats->dwRGBZBitMask) - { - continue; - } - } - - pccsd->ddRVal = DD_OK; - return DDHAL_DRIVER_HANDLED; - } - - // for did not found a pixel format - pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT; - return DDHAL_DRIVER_HANDLED; - } - } - - // no diffent pixel format was found so we return OK - pccsd->ddRVal = DD_OK; - return DDHAL_DRIVER_HANDLED; + DX_STUB; } -DWORD CALLBACK HelDdCreateSurface(LPDDHAL_CREATESURFACEDATA lpCreateSurface) +DWORD CALLBACK HelDdCreateSurface(LPDDHAL_CREATESURFACEDATA lpCreateSurface) { - DX_STUB; + DX_STUB; } + +/* +DWORD CALLBACK HelDdSetColorKey(LPDDHAL_SETCOLORKEYDATA lpSetColorKey) +{ + DX_STUB; +} +*/ + +DWORD CALLBACK HelDdSetMode(LPDDHAL_SETMODEDATA SetMode) +{ + DX_STUB; +} + +DWORD CALLBACK HelDdWaitForVerticalBlank(LPDDHAL_WAITFORVERTICALBLANKDATA lpWaitForVerticalBlank) +{ + DX_STUB; +} + +DWORD CALLBACK HelDdCanCreateSurface(LPDDHAL_CANCREATESURFACEDATA lpCanCreateSurface) +{ + DX_STUB; +} + +DWORD CALLBACK HelDdCreatePalette(LPDDHAL_CREATEPALETTEDATA lpCreatePalette) +{ + DX_STUB; +} + +DWORD CALLBACK HelDdGetScanLine(LPDDHAL_GETSCANLINEDATA lpGetScanLine) +{ + DX_STUB; +} + +DWORD CALLBACK HelDdSetExclusiveMode(LPDDHAL_SETEXCLUSIVEMODEDATA lpSetExclusiveMode) +{ + DX_WINDBG_trace(); + DX_STUB_str("Not implement yet, return DD_OK for not bsod\n"); + return DD_OK; +} + +DWORD CALLBACK HelDdFlipToGDISurface(LPDDHAL_FLIPTOGDISURFACEDATA lpFlipToGDISurface) +{ + DX_STUB; +} +
18 years, 6 months
1
0
0
0
[greatlrd] 21819: revert last commit it bsd the ddraw in some case
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun May 7 12:26:40 2006 New Revision: 21819 URL:
http://svn.reactos.ru/svn/reactos?rev=21819&view=rev
Log: revert last commit it bsd the ddraw in some case Removed: trunk/reactos/dll/directx/ddraw/helinterface.c Modified: trunk/reactos/dll/directx/ddraw/ddraw.rbuild trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c trunk/reactos/dll/directx/ddraw/main/ddraw_main.c trunk/reactos/dll/directx/ddraw/main/surface_main.c trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c Modified: trunk/reactos/dll/directx/ddraw/ddraw.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/ddraw.rbu…
============================================================================== --- trunk/reactos/dll/directx/ddraw/ddraw.rbuild (original) +++ trunk/reactos/dll/directx/ddraw/ddraw.rbuild Sun May 7 12:26:40 2006 @@ -17,7 +17,6 @@ <file>ddraw.rc</file> <file>main.c</file> <file>regsvr.c</file> - <file>helinterface.c</file> <file>clipper.c</file> <file>color.c</file> Modified: trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/hal/ddraw…
============================================================================== --- trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c (original) +++ trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c Sun May 7 12:26:40 2006 @@ -199,7 +199,29 @@ - +HRESULT +Hal_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface) +{ + IDirectDrawImpl* This = (IDirectDrawImpl*)iface; + + DDHAL_SETEXCLUSIVEMODEDATA SetExclusiveMode; + + if (!(This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE)) + { + return DDERR_NODRIVERSUPPORT; + } + + SetExclusiveMode.lpDD = &This->mDDrawGlobal; + SetExclusiveMode.ddRVal = DDERR_NOTPALETTIZED; + SetExclusiveMode.dwEnterExcl = This->cooperative_level; + + if (This->mDDrawGlobal.lpDDCBtmp->HALDD.SetExclusiveMode(&SetExclusiveMode) != DDHAL_DRIVER_HANDLED) + { + return DDERR_NODRIVERSUPPORT; + } + + return SetExclusiveMode.ddRVal; +} Removed: trunk/reactos/dll/directx/ddraw/helinterface.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/helinterf…
============================================================================== --- trunk/reactos/dll/directx/ddraw/helinterface.c (original) +++ trunk/reactos/dll/directx/ddraw/helinterface.c (removed) @@ -1,40 +1,0 @@ -#include "rosdraw.h" - -HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 iface) -{ - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - - This->HELMemoryAvilable = HEL_GRAPHIC_MEMORY_MAX; - - This->mCallbacks.HELDD.dwFlags = DDHAL_CB32_DESTROYDRIVER; - This->mCallbacks.HELDD.DestroyDriver = HelDdDestroyDriver; - - This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_CREATESURFACE; - This->mCallbacks.HELDD.CreateSurface = HelDdCreateSurface; - - // DDHAL_CB32_ - //This->mCallbacks.HELDD.SetColorKey = HelDdSetColorKey; - - This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_SETMODE; - This->mCallbacks.HELDD.SetMode = HelDdSetMode; - - This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_WAITFORVERTICALBLANK; - This->mCallbacks.HELDD.WaitForVerticalBlank = HelDdWaitForVerticalBlank; - - This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_CANCREATESURFACE; - This->mCallbacks.HELDD.CanCreateSurface = HelDdCanCreateSurface; - - This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_CREATEPALETTE; - This->mCallbacks.HELDD.CreatePalette = HelDdCreatePalette; - - This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_GETSCANLINE; - This->mCallbacks.HELDD.GetScanLine = HelDdGetScanLine; - - This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_SETEXCLUSIVEMODE; - This->mCallbacks.HELDD.SetExclusiveMode = HelDdSetExclusiveMode; - - This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_FLIPTOGDISURFACE; - This->mCallbacks.HELDD.FlipToGDISurface = HelDdFlipToGDISurface; - - return DD_OK; -} Modified: trunk/reactos/dll/directx/ddraw/main/ddraw_main.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/ddra…
============================================================================== --- trunk/reactos/dll/directx/ddraw/main/ddraw_main.c (original) +++ trunk/reactos/dll/directx/ddraw/main/ddraw_main.c Sun May 7 12:26:40 2006 @@ -290,7 +290,6 @@ DX_WINDBG_trace(); IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - DDHAL_SETEXCLUSIVEMODEDATA SetExclusiveMode; // check the parameters if ((This->cooperative_level == cooplevel) && ((HWND)This->mDDrawGlobal.lpExclusiveOwner->hWnd == hwnd)) @@ -314,27 +313,13 @@ //mDDrawGlobal.lpExclusiveOwner->dwLocalFlags This->cooperative_level = cooplevel; - - SetExclusiveMode.lpDD = &This->mDDrawGlobal; - SetExclusiveMode.ddRVal = DDERR_NODRIVERSUPPORT; - SetExclusiveMode.dwEnterExcl = This->cooperative_level; - - if (!(This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE)) - { - SetExclusiveMode.SetExclusiveMode = This->mDDrawGlobal.lpDDCBtmp->HELDD.SetExclusiveMode; - } - else - { - SetExclusiveMode.SetExclusiveMode = This->mDDrawGlobal.lpDDCBtmp->HALDD.SetExclusiveMode; - } - - if (SetExclusiveMode.SetExclusiveMode(&SetExclusiveMode) != DDHAL_DRIVER_HANDLED) - { - return DDERR_NODRIVERSUPPORT; - } - - return SetExclusiveMode.ddRVal; - + + if (This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE) + { + return Hal_DirectDraw_SetCooperativeLevel (iface); + } + + return Hel_DirectDraw_SetCooperativeLevel(iface); } Modified: trunk/reactos/dll/directx/ddraw/main/surface_main.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/surf…
============================================================================== --- trunk/reactos/dll/directx/ddraw/main/surface_main.c (original) +++ trunk/reactos/dll/directx/ddraw/main/surface_main.c Sun May 7 12:26:40 2006 @@ -496,9 +496,9 @@ Main_DDrawSurface_SetClipper (LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAWCLIPPER pDDClipper) { - /* FIXME not implment */ - DX_WINDBG_trace(); - DX_STUB_DD_OK; + DX_WINDBG_trace(); + + DX_STUB; } HRESULT WINAPI Modified: trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/soft/ddra…
============================================================================== --- trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c (original) +++ trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c Sun May 7 12:26:40 2006 @@ -12,7 +12,25 @@ +HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 iface) +{ + IDirectDrawImpl* This = (IDirectDrawImpl*)iface; + This->HELMemoryAvilable = HEL_GRAPHIC_MEMORY_MAX; + + This->mCallbacks.HELDD.dwFlags = DDHAL_CB32_CANCREATESURFACE; + This->mCallbacks.HELDD.CanCreateSurface = HelDdCanCreateSurface; + + This->mCallbacks.HELDD.dwFlags = DDHAL_CB32_CREATESURFACE; + This->mCallbacks.HELDD.CreateSurface = HelDdCreateSurface; + + return DD_OK; +} + +HRESULT Hel_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface) +{ + return DD_OK; +} VOID Hel_DirectDraw_Release (LPDIRECTDRAW7 iface) { Modified: trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/soft/surf…
============================================================================== --- trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c (original) +++ trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c Sun May 7 12:26:40 2006 @@ -14,70 +14,132 @@ extern DDPIXELFORMAT pixelformats[]; extern DWORD pixelformatsCount; -/* - * Direct Draw Callbacks - */ - -DWORD CALLBACK -HelDdDestroyDriver(LPDDHAL_DESTROYDRIVERDATA lpDestroyDriver) +DWORD CALLBACK HelDdCanCreateSurface(LPDDHAL_CANCREATESURFACEDATA pccsd) { - DX_STUB; + DWORD count; + + // FIXME check the HAL pixelformat table if it exists + + // FIXME check how big the surface in byte and report it can be create or not + // if we got egunt with HEL memmory + + + // HEL only support 16bits & 15bits Z-Buffer + if ((pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER) && + (pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) + { + pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT; + + if (DDSD_ZBUFFERBITDEPTH & pccsd->lpDDSurfaceDesc->dwFlags) + { + if (pccsd->lpDDSurfaceDesc->dwZBufferBitDepth == 16) + { + pccsd->ddRVal = DD_OK; + } + } + else + { + if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwZBufferBitDepth == 16) + { + pccsd->ddRVal = DD_OK; + } + } + return DDHAL_DRIVER_HANDLED; + } + + // Check diffent pixel format + if (pccsd->bIsDifferentPixelFormat) + { + //if(pccsd->ddpfPixelFormat.dwFlags & DDPF_FOURCC) + if(pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags & 0) + { + switch (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFourCC) + { + //case FOURCC_YUV422: + case 0: + // FIXME check if display is 8bmp or not if it return DDERR_INVALIDPIXELFORMAT + pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwYUVBitCount = 16; + pccsd->ddRVal = DD_OK; + return DDHAL_DRIVER_HANDLED; + + default: + pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT; + return DDHAL_DRIVER_HANDLED; + } + + } + else if((pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_TEXTURE)) + { + for(count=0;count< pixelformatsCount ;count++) + { + if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags != pixelformats->dwFlags) + { + continue; + } + + if (!(pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags & (DDPF_YUV | DDPF_FOURCC))) + { + if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount != pixelformats->dwRGBBitCount ) + { + continue; + } + } + + if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags & DDPF_RGB) + { + if ((pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwRBitMask != pixelformats->dwRBitMask) || + (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwGBitMask != pixelformats->dwGBitMask) || + (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwBBitMask != pixelformats->dwBBitMask) || + (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwRGBAlphaBitMask != pixelformats->dwRGBAlphaBitMask)) + { + continue; + } + } + + if (pccsd->lpDDSurfaceDesc->dwFlags & DDPF_YUV) + { + if ((pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFourCC != pixelformats->dwFourCC) || + (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwYUVBitCount != pixelformats->dwYUVBitCount) || + (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwYBitMask != pixelformats->dwYBitMask) || + (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwUBitMask != pixelformats->dwUBitMask) || + (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwVBitMask != pixelformats->dwVBitMask) || + (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwYUVAlphaBitMask != pixelformats->dwYUVAlphaBitMask)) + { + continue; + } + } + else if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags & DDPF_FOURCC) + { + + if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFourCC != pixelformats->dwFourCC) + { + continue; + } + } + if (pccsd->lpDDSurfaceDesc->dwFlags & DDPF_ZPIXELS) + { + if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwRGBZBitMask != pixelformats->dwRGBZBitMask) + { + continue; + } + } + + pccsd->ddRVal = DD_OK; + return DDHAL_DRIVER_HANDLED; + } + + // for did not found a pixel format + pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT; + return DDHAL_DRIVER_HANDLED; + } + } + + // no diffent pixel format was found so we return OK + pccsd->ddRVal = DD_OK; + return DDHAL_DRIVER_HANDLED; } -DWORD CALLBACK -HelDdCreateSurface(LPDDHAL_CREATESURFACEDATA lpCreateSurface) +DWORD CALLBACK HelDdCreateSurface(LPDDHAL_CREATESURFACEDATA lpCreateSurface) { - DX_STUB; + DX_STUB; } - -/* -DWORD CALLBACK HelDdSetColorKey(LPDDHAL_SETCOLORKEYDATA lpSetColorKey) -{ - DX_STUB; -} -*/ - -DWORD CALLBACK -HelDdSetMode(LPDDHAL_SETMODEDATA SetMode) -{ - DX_STUB; -} - -DWORD CALLBACK -HelDdWaitForVerticalBlank(LPDDHAL_WAITFORVERTICALBLANKDATA lpWaitForVerticalBlank) -{ - DX_STUB; -} - -DWORD CALLBACK -HelDdCanCreateSurface(LPDDHAL_CANCREATESURFACEDATA lpCanCreateSurface) -{ - DX_STUB; -} - -DWORD CALLBACK -HelDdCreatePalette(LPDDHAL_CREATEPALETTEDATA lpCreatePalette) -{ - DX_STUB; -} - -DWORD CALLBACK -HelDdGetScanLine(LPDDHAL_GETSCANLINEDATA lpGetScanLine) -{ - DX_STUB; -} - -DWORD CALLBACK -HelDdSetExclusiveMode(LPDDHAL_SETEXCLUSIVEMODEDATA lpSetExclusiveMode) -{ - DX_WINDBG_trace(); - DX_STUB_str("Not implement yet, return DD_OK for not bsod\n"); - return DD_OK; -} - -DWORD CALLBACK -HelDdFlipToGDISurface(LPDDHAL_FLIPTOGDISURFACEDATA lpFlipToGDISurface) -{ - DX_STUB; -} -
18 years, 6 months
1
0
0
0
[arty] 21818: Fix printing of adapter address. Just a silly thing for debugging.
by arty@svn.reactos.org
Author: arty Date: Sun May 7 11:45:17 2006 New Revision: 21818 URL:
http://svn.reactos.ru/svn/reactos?rev=21818&view=rev
Log: Fix printing of adapter address. Just a silly thing for debugging. Modified: trunk/reactos/drivers/network/dd/ne2000/ne2000/main.c Modified: trunk/reactos/drivers/network/dd/ne2000/ne2000/main.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/network/dd/ne2000/n…
============================================================================== --- trunk/reactos/drivers/network/dd/ne2000/ne2000/main.c (original) +++ trunk/reactos/drivers/network/dd/ne2000/ne2000/main.c Sun May 7 11:45:17 2006 @@ -23,7 +23,7 @@ #ifdef DBG /* See debug.h for debug/trace constants */ -ULONG DebugTraceLevel = MIN_TRACE; +ULONG DebugTraceLevel = 0; #endif /* DBG */ @@ -258,10 +258,10 @@ /* find the nic */ if (!NICCheck(Adapter)) { - NDIS_DbgPrint(MID_TRACE, ("No adapter found at (0x%X).\n", Adapter->IOBase)); + NDIS_DbgPrint(MID_TRACE, ("No adapter found at (0x%X).\n", Adapter->IoBaseAddress)); return NDIS_STATUS_ADAPTER_NOT_FOUND; } else - NDIS_DbgPrint(MID_TRACE, ("Adapter found at (0x%X).\n", Adapter->IOBase)); + NDIS_DbgPrint(MID_TRACE, ("Adapter found at (0x%X).\n", Adapter->IoBaseAddress)); NdisMSetAttributes(
18 years, 6 months
1
0
0
0
[greatlrd] 21817: Start remove old desgin of HEL to the new desgin, it will redues the code size, for we will use same code to call HAL in HEL, basic we need write the Dd* functions, it can be done two way, 1. Create a Hel driver in kmode or try write it in user mode. I will try write it in user mode.
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun May 7 11:43:50 2006 New Revision: 21817 URL:
http://svn.reactos.ru/svn/reactos?rev=21817&view=rev
Log: Start remove old desgin of HEL to the new desgin, it will redues the code size, for we will use same code to call HAL in HEL, basic we need write the Dd* functions, it can be done two way, 1. Create a Hel driver in kmode or try write it in user mode. I will try write it in user mode. Added: trunk/reactos/dll/directx/ddraw/helinterface.c (with props) Modified: trunk/reactos/dll/directx/ddraw/ddraw.rbuild trunk/reactos/dll/directx/ddraw/gamma.c (contents, props changed) trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c trunk/reactos/dll/directx/ddraw/kernel.c (contents, props changed) trunk/reactos/dll/directx/ddraw/main/ddraw_main.c trunk/reactos/dll/directx/ddraw/main/surface_main.c trunk/reactos/dll/directx/ddraw/palette.c (contents, props changed) trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c trunk/reactos/dll/directx/ddraw/videoport.c (contents, props changed) Modified: trunk/reactos/dll/directx/ddraw/ddraw.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/ddraw.rbu…
============================================================================== --- trunk/reactos/dll/directx/ddraw/ddraw.rbuild (original) +++ trunk/reactos/dll/directx/ddraw/ddraw.rbuild Sun May 7 11:43:50 2006 @@ -17,6 +17,7 @@ <file>ddraw.rc</file> <file>main.c</file> <file>regsvr.c</file> + <file>helinterface.c</file> <file>clipper.c</file> <file>color.c</file> Modified: trunk/reactos/dll/directx/ddraw/gamma.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/gamma.c?r…
============================================================================== --- trunk/reactos/dll/directx/ddraw/gamma.c (original) +++ trunk/reactos/dll/directx/ddraw/gamma.c Sun May 7 11:43:50 2006 @@ -1,90 +1,90 @@ -/* $Id: gamma_main.c 21434 2006-04-01 19:12:56Z greatlrd $ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS - * FILE: lib/ddraw/main/gamma.c - * PURPOSE: IDirectDrawGamma Implementation - * PROGRAMMER: Maarten Bosma - * - */ - -#include "rosdraw.h" - -ULONG WINAPI -DirectDrawGammaControl_AddRef( LPDIRECTDRAWGAMMACONTROL iface) -{ - DX_WINDBG_trace(); - - IDirectDrawGammaImpl * This = (IDirectDrawGammaImpl*)iface; - - ULONG ref=0; - - if (iface!=NULL) - { - ref = InterlockedIncrement( (PLONG) &This->ref); - } - return ref; -} - -ULONG WINAPI -DirectDrawGammaControl_Release( LPDIRECTDRAWGAMMACONTROL iface) -{ - DX_WINDBG_trace(); - - IDirectDrawGammaImpl* This = (IDirectDrawGammaImpl*)iface; - ULONG ref=0; - - if (iface!=NULL) - { - ref = InterlockedDecrement( (PLONG) &This->ref); - - if (ref == 0) - { - /* Add here if we need releae some memory pointer before - * exists - */ - - if (This!=NULL) - { - HeapFree(GetProcessHeap(), 0, This); - } - } - } - return ref; -} - -HRESULT WINAPI -DirectDrawGammaControl_QueryInterface( LPDIRECTDRAWGAMMACONTROL iface, - REFIID riid, - LPVOID *ppObj) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI -DirectDrawGammaControl_GetGammaRamp( LPDIRECTDRAWGAMMACONTROL iface, - DWORD dwFlags, - LPDDGAMMARAMP lpGammaRamp) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI -DirectDrawGammaControl_SetGammaRamp( LPDIRECTDRAWGAMMACONTROL iface, - DWORD dwFlags, - LPDDGAMMARAMP lpGammaRamp) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -IDirectDrawGammaControlVtbl DirectDrawGammaControl_Vtable = -{ - DirectDrawGammaControl_QueryInterface, - DirectDrawGammaControl_AddRef, - DirectDrawGammaControl_Release, - DirectDrawGammaControl_GetGammaRamp, - DirectDrawGammaControl_SetGammaRamp -}; +/* $Id$ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS + * FILE: lib/ddraw/main/gamma.c + * PURPOSE: IDirectDrawGamma Implementation + * PROGRAMMER: Maarten Bosma + * + */ + +#include "rosdraw.h" + +ULONG WINAPI +DirectDrawGammaControl_AddRef( LPDIRECTDRAWGAMMACONTROL iface) +{ + DX_WINDBG_trace(); + + IDirectDrawGammaImpl * This = (IDirectDrawGammaImpl*)iface; + + ULONG ref=0; + + if (iface!=NULL) + { + ref = InterlockedIncrement( (PLONG) &This->ref); + } + return ref; +} + +ULONG WINAPI +DirectDrawGammaControl_Release( LPDIRECTDRAWGAMMACONTROL iface) +{ + DX_WINDBG_trace(); + + IDirectDrawGammaImpl* This = (IDirectDrawGammaImpl*)iface; + ULONG ref=0; + + if (iface!=NULL) + { + ref = InterlockedDecrement( (PLONG) &This->ref); + + if (ref == 0) + { + /* Add here if we need releae some memory pointer before + * exists + */ + + if (This!=NULL) + { + HeapFree(GetProcessHeap(), 0, This); + } + } + } + return ref; +} + +HRESULT WINAPI +DirectDrawGammaControl_QueryInterface( LPDIRECTDRAWGAMMACONTROL iface, + REFIID riid, + LPVOID *ppObj) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI +DirectDrawGammaControl_GetGammaRamp( LPDIRECTDRAWGAMMACONTROL iface, + DWORD dwFlags, + LPDDGAMMARAMP lpGammaRamp) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI +DirectDrawGammaControl_SetGammaRamp( LPDIRECTDRAWGAMMACONTROL iface, + DWORD dwFlags, + LPDDGAMMARAMP lpGammaRamp) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +IDirectDrawGammaControlVtbl DirectDrawGammaControl_Vtable = +{ + DirectDrawGammaControl_QueryInterface, + DirectDrawGammaControl_AddRef, + DirectDrawGammaControl_Release, + DirectDrawGammaControl_GetGammaRamp, + DirectDrawGammaControl_SetGammaRamp +}; Propchange: trunk/reactos/dll/directx/ddraw/gamma.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/dll/directx/ddraw/gamma.c ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Modified: trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/hal/ddraw…
============================================================================== --- trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c (original) +++ trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c Sun May 7 11:43:50 2006 @@ -199,29 +199,7 @@ -HRESULT -Hal_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface) -{ - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - - DDHAL_SETEXCLUSIVEMODEDATA SetExclusiveMode; - - if (!(This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE)) - { - return DDERR_NODRIVERSUPPORT; - } - - SetExclusiveMode.lpDD = &This->mDDrawGlobal; - SetExclusiveMode.ddRVal = DDERR_NOTPALETTIZED; - SetExclusiveMode.dwEnterExcl = This->cooperative_level; - - if (This->mDDrawGlobal.lpDDCBtmp->HALDD.SetExclusiveMode(&SetExclusiveMode) != DDHAL_DRIVER_HANDLED) - { - return DDERR_NODRIVERSUPPORT; - } - - return SetExclusiveMode.ddRVal; -} + Added: trunk/reactos/dll/directx/ddraw/helinterface.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/helinterf…
============================================================================== --- trunk/reactos/dll/directx/ddraw/helinterface.c (added) +++ trunk/reactos/dll/directx/ddraw/helinterface.c Sun May 7 11:43:50 2006 @@ -1,0 +1,40 @@ +#include "rosdraw.h" + +HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 iface) +{ + IDirectDrawImpl* This = (IDirectDrawImpl*)iface; + + This->HELMemoryAvilable = HEL_GRAPHIC_MEMORY_MAX; + + This->mCallbacks.HELDD.dwFlags = DDHAL_CB32_DESTROYDRIVER; + This->mCallbacks.HELDD.DestroyDriver = HelDdDestroyDriver; + + This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_CREATESURFACE; + This->mCallbacks.HELDD.CreateSurface = HelDdCreateSurface; + + // DDHAL_CB32_ + //This->mCallbacks.HELDD.SetColorKey = HelDdSetColorKey; + + This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_SETMODE; + This->mCallbacks.HELDD.SetMode = HelDdSetMode; + + This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_WAITFORVERTICALBLANK; + This->mCallbacks.HELDD.WaitForVerticalBlank = HelDdWaitForVerticalBlank; + + This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_CANCREATESURFACE; + This->mCallbacks.HELDD.CanCreateSurface = HelDdCanCreateSurface; + + This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_CREATEPALETTE; + This->mCallbacks.HELDD.CreatePalette = HelDdCreatePalette; + + This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_GETSCANLINE; + This->mCallbacks.HELDD.GetScanLine = HelDdGetScanLine; + + This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_SETEXCLUSIVEMODE; + This->mCallbacks.HELDD.SetExclusiveMode = HelDdSetExclusiveMode; + + This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_FLIPTOGDISURFACE; + This->mCallbacks.HELDD.FlipToGDISurface = HelDdFlipToGDISurface; + + return DD_OK; +} Propchange: trunk/reactos/dll/directx/ddraw/helinterface.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/dll/directx/ddraw/helinterface.c ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Modified: trunk/reactos/dll/directx/ddraw/kernel.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/kernel.c?…
============================================================================== --- trunk/reactos/dll/directx/ddraw/kernel.c (original) +++ trunk/reactos/dll/directx/ddraw/kernel.c Sun May 7 11:43:50 2006 @@ -1,168 +1,168 @@ -/* $Id: kernel_main.c 21434 2006-04-01 19:12:56Z greatlrd $ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS - * FILE: lib/ddraw/main/kernel.c - * PURPOSE: IDirectDrawKernel and IDirectDrawSurfaceKernel Implementation - * PROGRAMMER: Maarten Bosma - * - */ - -#include "rosdraw.h" - - -/***** IDirectDrawKernel ****/ - -ULONG WINAPI -DirectDrawKernel_AddRef ( LPDIRECTDRAWKERNEL iface) -{ - DX_WINDBG_trace(); - - IDirectDrawKernelImpl * This = (IDirectDrawKernelImpl*)iface; - - ULONG ref=0; - - if (iface!=NULL) - { - ref = InterlockedIncrement( (PLONG) &This->ref); - } - return ref; -} - -ULONG WINAPI -DirectDrawKernel_Release ( LPDIRECTDRAWKERNEL iface) -{ - DX_WINDBG_trace(); - - IDirectDrawKernelImpl* This = (IDirectDrawKernelImpl*)iface; - ULONG ref=0; - - if (iface!=NULL) - { - ref = InterlockedDecrement( (PLONG) &This->ref); - - if (ref == 0) - { - /* Add here if we need releae some memory pointer before - * exists - */ - - if (This!=NULL) - { - HeapFree(GetProcessHeap(), 0, This); - } - } - } - return ref; -} - -HRESULT WINAPI -DirectDrawKernel_QueryInterface ( LPDIRECTDRAWKERNEL iface, - REFIID riid, - LPVOID* ppvObj) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI -DirectDrawKernel_GetKernelHandle ( LPDIRECTDRAWKERNEL iface, - ULONG* handle) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI -DirectDrawKernel_ReleaseKernelHandle ( LPDIRECTDRAWKERNEL iface) -{ - DX_WINDBG_trace(); - DX_STUB; -} - - -ULONG WINAPI -DDSurfaceKernel_AddRef ( LPDIRECTDRAWSURFACEKERNEL iface) -{ - DX_WINDBG_trace(); - - IDirectDrawSurfaceKernelImpl * This = (IDirectDrawSurfaceKernelImpl*)iface; - - ULONG ref=0; - - if (iface!=NULL) - { - ref = InterlockedIncrement( (PLONG) &This->ref); - } - return ref; -} - -ULONG WINAPI -DDSurfaceKernel_Release ( LPDIRECTDRAWSURFACEKERNEL iface) -{ - DX_WINDBG_trace(); - - IDirectDrawSurfaceKernelImpl* This = (IDirectDrawSurfaceKernelImpl*)iface; - ULONG ref=0; - - if (iface!=NULL) - { - ref = InterlockedDecrement( (PLONG) &This->ref); - - if (ref == 0) - { - /* Add here if we need releae some memory pointer before - * exists - */ - - if (This!=NULL) - { - HeapFree(GetProcessHeap(), 0, This); - } - } - } - return ref; -} - -HRESULT WINAPI -DDSurfaceKernel_QueryInterface ( LPDIRECTDRAWSURFACEKERNEL iface, - REFIID riid, - LPVOID* ppvObj) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI -DDSurfaceKernel_GetKernelHandle ( LPDIRECTDRAWSURFACEKERNEL iface, - ULONG* handle) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI -DDSurfaceKernel_ReleaseKernelHandle ( LPDIRECTDRAWSURFACEKERNEL iface) -{ - DX_WINDBG_trace(); - DX_STUB; -} - - -IDirectDrawKernelVtbl DirectDrawKernel_Vtable = -{ - DirectDrawKernel_QueryInterface, - DirectDrawKernel_AddRef, - DirectDrawKernel_Release, - DirectDrawKernel_GetKernelHandle, - DirectDrawKernel_ReleaseKernelHandle -}; - -IDirectDrawSurfaceKernelVtbl DirectDrawSurfaceKernel_Vtable = -{ - DDSurfaceKernel_QueryInterface, - DDSurfaceKernel_AddRef, - DDSurfaceKernel_Release, - DDSurfaceKernel_GetKernelHandle, - DDSurfaceKernel_ReleaseKernelHandle -}; +/* $Id$ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS + * FILE: lib/ddraw/main/kernel.c + * PURPOSE: IDirectDrawKernel and IDirectDrawSurfaceKernel Implementation + * PROGRAMMER: Maarten Bosma + * + */ + +#include "rosdraw.h" + + +/***** IDirectDrawKernel ****/ + +ULONG WINAPI +DirectDrawKernel_AddRef ( LPDIRECTDRAWKERNEL iface) +{ + DX_WINDBG_trace(); + + IDirectDrawKernelImpl * This = (IDirectDrawKernelImpl*)iface; + + ULONG ref=0; + + if (iface!=NULL) + { + ref = InterlockedIncrement( (PLONG) &This->ref); + } + return ref; +} + +ULONG WINAPI +DirectDrawKernel_Release ( LPDIRECTDRAWKERNEL iface) +{ + DX_WINDBG_trace(); + + IDirectDrawKernelImpl* This = (IDirectDrawKernelImpl*)iface; + ULONG ref=0; + + if (iface!=NULL) + { + ref = InterlockedDecrement( (PLONG) &This->ref); + + if (ref == 0) + { + /* Add here if we need releae some memory pointer before + * exists + */ + + if (This!=NULL) + { + HeapFree(GetProcessHeap(), 0, This); + } + } + } + return ref; +} + +HRESULT WINAPI +DirectDrawKernel_QueryInterface ( LPDIRECTDRAWKERNEL iface, + REFIID riid, + LPVOID* ppvObj) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI +DirectDrawKernel_GetKernelHandle ( LPDIRECTDRAWKERNEL iface, + ULONG* handle) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI +DirectDrawKernel_ReleaseKernelHandle ( LPDIRECTDRAWKERNEL iface) +{ + DX_WINDBG_trace(); + DX_STUB; +} + + +ULONG WINAPI +DDSurfaceKernel_AddRef ( LPDIRECTDRAWSURFACEKERNEL iface) +{ + DX_WINDBG_trace(); + + IDirectDrawSurfaceKernelImpl * This = (IDirectDrawSurfaceKernelImpl*)iface; + + ULONG ref=0; + + if (iface!=NULL) + { + ref = InterlockedIncrement( (PLONG) &This->ref); + } + return ref; +} + +ULONG WINAPI +DDSurfaceKernel_Release ( LPDIRECTDRAWSURFACEKERNEL iface) +{ + DX_WINDBG_trace(); + + IDirectDrawSurfaceKernelImpl* This = (IDirectDrawSurfaceKernelImpl*)iface; + ULONG ref=0; + + if (iface!=NULL) + { + ref = InterlockedDecrement( (PLONG) &This->ref); + + if (ref == 0) + { + /* Add here if we need releae some memory pointer before + * exists + */ + + if (This!=NULL) + { + HeapFree(GetProcessHeap(), 0, This); + } + } + } + return ref; +} + +HRESULT WINAPI +DDSurfaceKernel_QueryInterface ( LPDIRECTDRAWSURFACEKERNEL iface, + REFIID riid, + LPVOID* ppvObj) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI +DDSurfaceKernel_GetKernelHandle ( LPDIRECTDRAWSURFACEKERNEL iface, + ULONG* handle) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI +DDSurfaceKernel_ReleaseKernelHandle ( LPDIRECTDRAWSURFACEKERNEL iface) +{ + DX_WINDBG_trace(); + DX_STUB; +} + + +IDirectDrawKernelVtbl DirectDrawKernel_Vtable = +{ + DirectDrawKernel_QueryInterface, + DirectDrawKernel_AddRef, + DirectDrawKernel_Release, + DirectDrawKernel_GetKernelHandle, + DirectDrawKernel_ReleaseKernelHandle +}; + +IDirectDrawSurfaceKernelVtbl DirectDrawSurfaceKernel_Vtable = +{ + DDSurfaceKernel_QueryInterface, + DDSurfaceKernel_AddRef, + DDSurfaceKernel_Release, + DDSurfaceKernel_GetKernelHandle, + DDSurfaceKernel_ReleaseKernelHandle +}; Propchange: trunk/reactos/dll/directx/ddraw/kernel.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/dll/directx/ddraw/kernel.c ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Modified: trunk/reactos/dll/directx/ddraw/main/ddraw_main.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/ddra…
============================================================================== --- trunk/reactos/dll/directx/ddraw/main/ddraw_main.c (original) +++ trunk/reactos/dll/directx/ddraw/main/ddraw_main.c Sun May 7 11:43:50 2006 @@ -290,6 +290,7 @@ DX_WINDBG_trace(); IDirectDrawImpl* This = (IDirectDrawImpl*)iface; + DDHAL_SETEXCLUSIVEMODEDATA SetExclusiveMode; // check the parameters if ((This->cooperative_level == cooplevel) && ((HWND)This->mDDrawGlobal.lpExclusiveOwner->hWnd == hwnd)) @@ -313,13 +314,27 @@ //mDDrawGlobal.lpExclusiveOwner->dwLocalFlags This->cooperative_level = cooplevel; - - if (This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE) - { - return Hal_DirectDraw_SetCooperativeLevel (iface); - } - - return Hel_DirectDraw_SetCooperativeLevel(iface); + + SetExclusiveMode.lpDD = &This->mDDrawGlobal; + SetExclusiveMode.ddRVal = DDERR_NODRIVERSUPPORT; + SetExclusiveMode.dwEnterExcl = This->cooperative_level; + + if (!(This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE)) + { + SetExclusiveMode.SetExclusiveMode = This->mDDrawGlobal.lpDDCBtmp->HELDD.SetExclusiveMode; + } + else + { + SetExclusiveMode.SetExclusiveMode = This->mDDrawGlobal.lpDDCBtmp->HALDD.SetExclusiveMode; + } + + if (SetExclusiveMode.SetExclusiveMode(&SetExclusiveMode) != DDHAL_DRIVER_HANDLED) + { + return DDERR_NODRIVERSUPPORT; + } + + return SetExclusiveMode.ddRVal; + } Modified: trunk/reactos/dll/directx/ddraw/main/surface_main.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/surf…
============================================================================== --- trunk/reactos/dll/directx/ddraw/main/surface_main.c (original) +++ trunk/reactos/dll/directx/ddraw/main/surface_main.c Sun May 7 11:43:50 2006 @@ -496,9 +496,9 @@ Main_DDrawSurface_SetClipper (LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAWCLIPPER pDDClipper) { - DX_WINDBG_trace(); - - DX_STUB; + /* FIXME not implment */ + DX_WINDBG_trace(); + DX_STUB_DD_OK; } HRESULT WINAPI Modified: trunk/reactos/dll/directx/ddraw/palette.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/palette.c…
============================================================================== --- trunk/reactos/dll/directx/ddraw/palette.c (original) +++ trunk/reactos/dll/directx/ddraw/palette.c Sun May 7 11:43:50 2006 @@ -1,112 +1,112 @@ -/* $Id: palette_main.c 21434 2006-04-01 19:12:56Z greatlrd $ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS - * FILE: lib/ddraw/main/palette.c - * PURPOSE: IDirectDrawPalette Implementation - * PROGRAMMER: Maarten Bosma - * - */ - -#include "rosdraw.h" - -ULONG WINAPI -DirectDrawPalette_Release( LPDIRECTDRAWPALETTE iface) -{ - DX_WINDBG_trace(); - - IDirectDrawPaletteImpl* This = (IDirectDrawPaletteImpl*)iface; - ULONG ref=0; - - if (iface!=NULL) - { - ref = InterlockedDecrement( (PLONG) &This->ref); - - if (ref == 0) - { - /* Add here if we need releae some memory pointer before - * exists - */ - - if (This!=NULL) - { - HeapFree(GetProcessHeap(), 0, This); - } - } - } - return ref; -} - -ULONG WINAPI -DirectDrawPalette_AddRef( LPDIRECTDRAWPALETTE iface) -{ - DX_WINDBG_trace(); - - IDirectDrawPaletteImpl * This = (IDirectDrawPaletteImpl*)iface; - - ULONG ref=0; - - if (iface!=NULL) - { - ref = InterlockedIncrement( (PLONG) &This->ref); - } - return ref; -} - -HRESULT WINAPI -DirectDrawPalette_Initialize( LPDIRECTDRAWPALETTE iface, - LPDIRECTDRAW ddraw, - DWORD dwFlags, - LPPALETTEENTRY palent) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI -DirectDrawPalette_GetEntries( LPDIRECTDRAWPALETTE iface, - DWORD dwFlags, - DWORD dwStart, DWORD dwCount, - LPPALETTEENTRY palent) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI -DirectDrawPalette_SetEntries( LPDIRECTDRAWPALETTE iface, - DWORD dwFlags, - DWORD dwStart, - DWORD dwCount, - LPPALETTEENTRY palent) -{ - DX_WINDBG_trace(); - DX_STUB; -} -HRESULT WINAPI -DirectDrawPalette_GetCaps( LPDIRECTDRAWPALETTE iface, - LPDWORD lpdwCaps) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI -DirectDrawPalette_QueryInterface( LPDIRECTDRAWPALETTE iface, - REFIID refiid, - LPVOID *obj) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -IDirectDrawPaletteVtbl DirectDrawPalette_Vtable = -{ - DirectDrawPalette_QueryInterface, - DirectDrawPalette_AddRef, - DirectDrawPalette_Release, - DirectDrawPalette_GetCaps, - DirectDrawPalette_GetEntries, - DirectDrawPalette_Initialize, - DirectDrawPalette_SetEntries -}; +/* $Id$ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS + * FILE: lib/ddraw/main/palette.c + * PURPOSE: IDirectDrawPalette Implementation + * PROGRAMMER: Maarten Bosma + * + */ + +#include "rosdraw.h" + +ULONG WINAPI +DirectDrawPalette_Release( LPDIRECTDRAWPALETTE iface) +{ + DX_WINDBG_trace(); + + IDirectDrawPaletteImpl* This = (IDirectDrawPaletteImpl*)iface; + ULONG ref=0; + + if (iface!=NULL) + { + ref = InterlockedDecrement( (PLONG) &This->ref); + + if (ref == 0) + { + /* Add here if we need releae some memory pointer before + * exists + */ + + if (This!=NULL) + { + HeapFree(GetProcessHeap(), 0, This); + } + } + } + return ref; +} + +ULONG WINAPI +DirectDrawPalette_AddRef( LPDIRECTDRAWPALETTE iface) +{ + DX_WINDBG_trace(); + + IDirectDrawPaletteImpl * This = (IDirectDrawPaletteImpl*)iface; + + ULONG ref=0; + + if (iface!=NULL) + { + ref = InterlockedIncrement( (PLONG) &This->ref); + } + return ref; +} + +HRESULT WINAPI +DirectDrawPalette_Initialize( LPDIRECTDRAWPALETTE iface, + LPDIRECTDRAW ddraw, + DWORD dwFlags, + LPPALETTEENTRY palent) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI +DirectDrawPalette_GetEntries( LPDIRECTDRAWPALETTE iface, + DWORD dwFlags, + DWORD dwStart, DWORD dwCount, + LPPALETTEENTRY palent) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI +DirectDrawPalette_SetEntries( LPDIRECTDRAWPALETTE iface, + DWORD dwFlags, + DWORD dwStart, + DWORD dwCount, + LPPALETTEENTRY palent) +{ + DX_WINDBG_trace(); + DX_STUB; +} +HRESULT WINAPI +DirectDrawPalette_GetCaps( LPDIRECTDRAWPALETTE iface, + LPDWORD lpdwCaps) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI +DirectDrawPalette_QueryInterface( LPDIRECTDRAWPALETTE iface, + REFIID refiid, + LPVOID *obj) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +IDirectDrawPaletteVtbl DirectDrawPalette_Vtable = +{ + DirectDrawPalette_QueryInterface, + DirectDrawPalette_AddRef, + DirectDrawPalette_Release, + DirectDrawPalette_GetCaps, + DirectDrawPalette_GetEntries, + DirectDrawPalette_Initialize, + DirectDrawPalette_SetEntries +}; Propchange: trunk/reactos/dll/directx/ddraw/palette.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/dll/directx/ddraw/palette.c ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Modified: trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/soft/ddra…
============================================================================== --- trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c (original) +++ trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c Sun May 7 11:43:50 2006 @@ -12,25 +12,7 @@ -HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 iface) -{ - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - This->HELMemoryAvilable = HEL_GRAPHIC_MEMORY_MAX; - - This->mCallbacks.HELDD.dwFlags = DDHAL_CB32_CANCREATESURFACE; - This->mCallbacks.HELDD.CanCreateSurface = HelDdCanCreateSurface; - - This->mCallbacks.HELDD.dwFlags = DDHAL_CB32_CREATESURFACE; - This->mCallbacks.HELDD.CreateSurface = HelDdCreateSurface; - - return DD_OK; -} - -HRESULT Hel_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface) -{ - return DD_OK; -} VOID Hel_DirectDraw_Release (LPDIRECTDRAW7 iface) { Modified: trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/soft/surf…
============================================================================== --- trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c (original) +++ trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c Sun May 7 11:43:50 2006 @@ -14,132 +14,70 @@ extern DDPIXELFORMAT pixelformats[]; extern DWORD pixelformatsCount; -DWORD CALLBACK HelDdCanCreateSurface(LPDDHAL_CANCREATESURFACEDATA pccsd) +/* + * Direct Draw Callbacks + */ + +DWORD CALLBACK +HelDdDestroyDriver(LPDDHAL_DESTROYDRIVERDATA lpDestroyDriver) { - DWORD count; - - // FIXME check the HAL pixelformat table if it exists - - // FIXME check how big the surface in byte and report it can be create or not - // if we got egunt with HEL memmory - - - // HEL only support 16bits & 15bits Z-Buffer - if ((pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER) && - (pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) - { - pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT; - - if (DDSD_ZBUFFERBITDEPTH & pccsd->lpDDSurfaceDesc->dwFlags) - { - if (pccsd->lpDDSurfaceDesc->dwZBufferBitDepth == 16) - { - pccsd->ddRVal = DD_OK; - } - } - else - { - if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwZBufferBitDepth == 16) - { - pccsd->ddRVal = DD_OK; - } - } - return DDHAL_DRIVER_HANDLED; - } - - // Check diffent pixel format - if (pccsd->bIsDifferentPixelFormat) - { - //if(pccsd->ddpfPixelFormat.dwFlags & DDPF_FOURCC) - if(pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags & 0) - { - switch (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFourCC) - { - //case FOURCC_YUV422: - case 0: - // FIXME check if display is 8bmp or not if it return DDERR_INVALIDPIXELFORMAT - pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwYUVBitCount = 16; - pccsd->ddRVal = DD_OK; - return DDHAL_DRIVER_HANDLED; - - default: - pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT; - return DDHAL_DRIVER_HANDLED; - } - - } - else if((pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_TEXTURE)) - { - for(count=0;count< pixelformatsCount ;count++) - { - if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags != pixelformats->dwFlags) - { - continue; - } - - if (!(pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags & (DDPF_YUV | DDPF_FOURCC))) - { - if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount != pixelformats->dwRGBBitCount ) - { - continue; - } - } - - if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags & DDPF_RGB) - { - if ((pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwRBitMask != pixelformats->dwRBitMask) || - (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwGBitMask != pixelformats->dwGBitMask) || - (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwBBitMask != pixelformats->dwBBitMask) || - (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwRGBAlphaBitMask != pixelformats->dwRGBAlphaBitMask)) - { - continue; - } - } - - if (pccsd->lpDDSurfaceDesc->dwFlags & DDPF_YUV) - { - if ((pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFourCC != pixelformats->dwFourCC) || - (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwYUVBitCount != pixelformats->dwYUVBitCount) || - (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwYBitMask != pixelformats->dwYBitMask) || - (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwUBitMask != pixelformats->dwUBitMask) || - (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwVBitMask != pixelformats->dwVBitMask) || - (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwYUVAlphaBitMask != pixelformats->dwYUVAlphaBitMask)) - { - continue; - } - } - else if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags & DDPF_FOURCC) - { - - if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFourCC != pixelformats->dwFourCC) - { - continue; - } - } - if (pccsd->lpDDSurfaceDesc->dwFlags & DDPF_ZPIXELS) - { - if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwRGBZBitMask != pixelformats->dwRGBZBitMask) - { - continue; - } - } - - pccsd->ddRVal = DD_OK; - return DDHAL_DRIVER_HANDLED; - } - - // for did not found a pixel format - pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT; - return DDHAL_DRIVER_HANDLED; - } - } - - // no diffent pixel format was found so we return OK - pccsd->ddRVal = DD_OK; - return DDHAL_DRIVER_HANDLED; + DX_STUB; } -DWORD CALLBACK HelDdCreateSurface(LPDDHAL_CREATESURFACEDATA lpCreateSurface) +DWORD CALLBACK +HelDdCreateSurface(LPDDHAL_CREATESURFACEDATA lpCreateSurface) { - DX_STUB; + DX_STUB; } + +/* +DWORD CALLBACK HelDdSetColorKey(LPDDHAL_SETCOLORKEYDATA lpSetColorKey) +{ + DX_STUB; +} +*/ + +DWORD CALLBACK +HelDdSetMode(LPDDHAL_SETMODEDATA SetMode) +{ + DX_STUB; +} + +DWORD CALLBACK +HelDdWaitForVerticalBlank(LPDDHAL_WAITFORVERTICALBLANKDATA lpWaitForVerticalBlank) +{ + DX_STUB; +} + +DWORD CALLBACK +HelDdCanCreateSurface(LPDDHAL_CANCREATESURFACEDATA lpCanCreateSurface) +{ + DX_STUB; +} + +DWORD CALLBACK +HelDdCreatePalette(LPDDHAL_CREATEPALETTEDATA lpCreatePalette) +{ + DX_STUB; +} + +DWORD CALLBACK +HelDdGetScanLine(LPDDHAL_GETSCANLINEDATA lpGetScanLine) +{ + DX_STUB; +} + +DWORD CALLBACK +HelDdSetExclusiveMode(LPDDHAL_SETEXCLUSIVEMODEDATA lpSetExclusiveMode) +{ + DX_WINDBG_trace(); + DX_STUB_str("Not implement yet, return DD_OK for not bsod\n"); + return DD_OK; +} + +DWORD CALLBACK +HelDdFlipToGDISurface(LPDDHAL_FLIPTOGDISURFACEDATA lpFlipToGDISurface) +{ + DX_STUB; +} + Modified: trunk/reactos/dll/directx/ddraw/videoport.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/videoport…
============================================================================== --- trunk/reactos/dll/directx/ddraw/videoport.c (original) +++ trunk/reactos/dll/directx/ddraw/videoport.c Sun May 7 11:43:50 2006 @@ -1,260 +1,260 @@ -/* $Id: videoport_main.c 21434 2006-04-01 19:12:56Z greatlrd $ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS - * FILE: lib/ddraw/main/videoport.c - * PURPOSE: IDirectDrawVideoPort, DDVideoPortContainer and IDirectDrawVideoPortNotify Implementation - * PROGRAMMER: Maarten Bosma - * - */ - -#include "rosdraw.h" - - -/************* IDirectDrawVideoPort *************/ - -HRESULT WINAPI -Main_DirectDrawVideoPort_QueryInterface (LPDIRECTDRAWVIDEOPORT iface, REFIID riid, LPVOID* ppvObj) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -ULONG WINAPI -Main_DirectDrawVideoPort_AddRef (LPDIRECTDRAWVIDEOPORT iface) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -ULONG WINAPI -Main_DirectDrawVideoPort_Release (LPDIRECTDRAWVIDEOPORT iface) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI -Main_DirectDrawVideoPort_Flip (LPDIRECTDRAWVIDEOPORT iface, LPDIRECTDRAWSURFACE lpDDSurface, DWORD dwFlags) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI -Main_DirectDrawVideoPort_GetBandwidthInfo (LPDIRECTDRAWVIDEOPORT iface, LPDDPIXELFORMAT lpddpfFormat, DWORD dwWidth, - DWORD dwHeight, DWORD dwFlags, LPDDVIDEOPORTBANDWIDTH lpBandwidth) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI -Main_DirectDrawVideoPort_GetColorControls (LPDIRECTDRAWVIDEOPORT iface, LPDDCOLORCONTROL lpColorControl) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI Main_DirectDrawVideoPort_GetInputFormats (LPDIRECTDRAWVIDEOPORT iface, LPDWORD lpNumFormats, - LPDDPIXELFORMAT lpFormats, DWORD dwFlags) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI Main_DirectDrawVideoPort_GetOutputFormats (LPDIRECTDRAWVIDEOPORT iface, LPDDPIXELFORMAT lpInputFormat, - LPDWORD lpNumFormats, LPDDPIXELFORMAT lpFormats, DWORD dwFlags) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI Main_DirectDrawVideoPort_GetFieldPolarity (LPDIRECTDRAWVIDEOPORT iface, LPBOOL lpbFieldPolarity) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI Main_DirectDrawVideoPort_GetVideoLine (LPDIRECTDRAWVIDEOPORT This, LPDWORD lpdwLine) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI Main_DirectDrawVideoPort_GetVideoSignalStatus (LPDIRECTDRAWVIDEOPORT iface, LPDWORD lpdwStatus) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI Main_DirectDrawVideoPort_SetColorControls (LPDIRECTDRAWVIDEOPORT iface, LPDDCOLORCONTROL lpColorControl) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI Main_DirectDrawVideoPort_SetTargetSurface (LPDIRECTDRAWVIDEOPORT iface, LPDIRECTDRAWSURFACE lpDDSurface, - DWORD dwFlags) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI Main_DirectDrawVideoPort_StartVideo (LPDIRECTDRAWVIDEOPORT iface, LPDDVIDEOPORTINFO dwFlags) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI Main_DirectDrawVideoPort_StopVideo (LPDIRECTDRAWVIDEOPORT iface) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI Main_DirectDrawVideoPort_UpdateVideo (LPDIRECTDRAWVIDEOPORT iface, LPDDVIDEOPORTINFO dwFlags) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI Main_DirectDrawVideoPort_WaitForSync (LPDIRECTDRAWVIDEOPORT iface, DWORD dwFlags, DWORD dwLine, - DWORD dwTimeout) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -/************* IDDVideoPortContainer *************/ - -HRESULT WINAPI Main_DDVideoPortContainer_QueryInterface (LPDDVIDEOPORTCONTAINER iface, REFIID riid, LPVOID* ppvObj) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -ULONG WINAPI Main_DDVideoPortContainer_AddRef (LPDDVIDEOPORTCONTAINER iface) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -ULONG WINAPI Main_DDVideoPortContainer_Release (LPDDVIDEOPORTCONTAINER iface) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI Main_DDVideoPortContainer_CreateVideoPort (LPDDVIDEOPORTCONTAINER iface, DWORD dwFlags, LPDDVIDEOPORTDESC pPortDesc, - LPDIRECTDRAWVIDEOPORT* DDVideoPort, IUnknown* pUnkOuter) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI -Main_DDVideoPortContainer_EnumVideoPorts (LPDDVIDEOPORTCONTAINER iface, - DWORD dwFlags, - LPDDVIDEOPORTCAPS pCaps, - LPVOID pContext, - LPDDENUMVIDEOCALLBACK pEnumVideoCallback) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI -Main_DDVideoPortContainer_GetVideoPortConnectInfo (LPDDVIDEOPORTCONTAINER iface, - DWORD PortId, DWORD* pNumEntries, - LPDDVIDEOPORTCONNECT pConnectInfo) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI -Main_DDVideoPortContainer_QueryVideoPortStatus (LPDDVIDEOPORTCONTAINER iface, - DWORD PortId, - LPDDVIDEOPORTSTATUS pStatus) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -/************* IDirectDrawVideoPortNotify *************/ - -HRESULT WINAPI -Main_DDVideoPortNotify_QueryInterface (LPDIRECTDRAWVIDEOPORTNOTIFY iface, REFIID - riid, LPVOID* ppvObj) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -ULONG WINAPI -Main_DDVideoPortNotify_AddRef (LPDIRECTDRAWVIDEOPORTNOTIFY iface) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -ULONG WINAPI -Main_DDVideoPortNotify_Release (LPDIRECTDRAWVIDEOPORTNOTIFY iface) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI Main_DDVideoPortNotify_AcquireNotification (LPDIRECTDRAWVIDEOPORTNOTIFY iface, HANDLE* h, LPDDVIDEOPORTNOTIFY pVideoPortNotify) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -HRESULT WINAPI Main_DDVideoPortNotify_ReleaseNotification (LPDIRECTDRAWVIDEOPORTNOTIFY iface, HANDLE h) -{ - DX_WINDBG_trace(); - DX_STUB; -} - -IDirectDrawVideoPortVtbl DirectDrawVideoPort_Vtable = -{ - Main_DirectDrawVideoPort_QueryInterface, - Main_DirectDrawVideoPort_AddRef, - Main_DirectDrawVideoPort_Release, - Main_DirectDrawVideoPort_Flip, - Main_DirectDrawVideoPort_GetBandwidthInfo, - Main_DirectDrawVideoPort_GetColorControls, - Main_DirectDrawVideoPort_GetInputFormats, - Main_DirectDrawVideoPort_GetOutputFormats, - Main_DirectDrawVideoPort_GetFieldPolarity, - Main_DirectDrawVideoPort_GetVideoLine, - Main_DirectDrawVideoPort_GetVideoSignalStatus, - Main_DirectDrawVideoPort_SetColorControls, - Main_DirectDrawVideoPort_SetTargetSurface, - Main_DirectDrawVideoPort_StartVideo, - Main_DirectDrawVideoPort_StopVideo, - Main_DirectDrawVideoPort_UpdateVideo, - Main_DirectDrawVideoPort_WaitForSync -}; - -IDDVideoPortContainerVtbl DDVideoPortContainer_Vtable = -{ - Main_DDVideoPortContainer_QueryInterface, - Main_DDVideoPortContainer_AddRef, - Main_DDVideoPortContainer_Release, - Main_DDVideoPortContainer_CreateVideoPort, - Main_DDVideoPortContainer_EnumVideoPorts, - Main_DDVideoPortContainer_GetVideoPortConnectInfo, - Main_DDVideoPortContainer_QueryVideoPortStatus -}; - -IDirectDrawVideoPortNotifyVtbl DDVideoPortNotify_Vtable = -{ - Main_DDVideoPortNotify_QueryInterface, - Main_DDVideoPortNotify_AddRef, - Main_DDVideoPortNotify_Release, - Main_DDVideoPortNotify_AcquireNotification, - Main_DDVideoPortNotify_ReleaseNotification -}; +/* $Id$ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS + * FILE: lib/ddraw/main/videoport.c + * PURPOSE: IDirectDrawVideoPort, DDVideoPortContainer and IDirectDrawVideoPortNotify Implementation + * PROGRAMMER: Maarten Bosma + * + */ + +#include "rosdraw.h" + + +/************* IDirectDrawVideoPort *************/ + +HRESULT WINAPI +Main_DirectDrawVideoPort_QueryInterface (LPDIRECTDRAWVIDEOPORT iface, REFIID riid, LPVOID* ppvObj) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +ULONG WINAPI +Main_DirectDrawVideoPort_AddRef (LPDIRECTDRAWVIDEOPORT iface) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +ULONG WINAPI +Main_DirectDrawVideoPort_Release (LPDIRECTDRAWVIDEOPORT iface) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI +Main_DirectDrawVideoPort_Flip (LPDIRECTDRAWVIDEOPORT iface, LPDIRECTDRAWSURFACE lpDDSurface, DWORD dwFlags) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI +Main_DirectDrawVideoPort_GetBandwidthInfo (LPDIRECTDRAWVIDEOPORT iface, LPDDPIXELFORMAT lpddpfFormat, DWORD dwWidth, + DWORD dwHeight, DWORD dwFlags, LPDDVIDEOPORTBANDWIDTH lpBandwidth) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI +Main_DirectDrawVideoPort_GetColorControls (LPDIRECTDRAWVIDEOPORT iface, LPDDCOLORCONTROL lpColorControl) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI Main_DirectDrawVideoPort_GetInputFormats (LPDIRECTDRAWVIDEOPORT iface, LPDWORD lpNumFormats, + LPDDPIXELFORMAT lpFormats, DWORD dwFlags) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI Main_DirectDrawVideoPort_GetOutputFormats (LPDIRECTDRAWVIDEOPORT iface, LPDDPIXELFORMAT lpInputFormat, + LPDWORD lpNumFormats, LPDDPIXELFORMAT lpFormats, DWORD dwFlags) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI Main_DirectDrawVideoPort_GetFieldPolarity (LPDIRECTDRAWVIDEOPORT iface, LPBOOL lpbFieldPolarity) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI Main_DirectDrawVideoPort_GetVideoLine (LPDIRECTDRAWVIDEOPORT This, LPDWORD lpdwLine) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI Main_DirectDrawVideoPort_GetVideoSignalStatus (LPDIRECTDRAWVIDEOPORT iface, LPDWORD lpdwStatus) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI Main_DirectDrawVideoPort_SetColorControls (LPDIRECTDRAWVIDEOPORT iface, LPDDCOLORCONTROL lpColorControl) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI Main_DirectDrawVideoPort_SetTargetSurface (LPDIRECTDRAWVIDEOPORT iface, LPDIRECTDRAWSURFACE lpDDSurface, + DWORD dwFlags) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI Main_DirectDrawVideoPort_StartVideo (LPDIRECTDRAWVIDEOPORT iface, LPDDVIDEOPORTINFO dwFlags) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI Main_DirectDrawVideoPort_StopVideo (LPDIRECTDRAWVIDEOPORT iface) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI Main_DirectDrawVideoPort_UpdateVideo (LPDIRECTDRAWVIDEOPORT iface, LPDDVIDEOPORTINFO dwFlags) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI Main_DirectDrawVideoPort_WaitForSync (LPDIRECTDRAWVIDEOPORT iface, DWORD dwFlags, DWORD dwLine, + DWORD dwTimeout) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +/************* IDDVideoPortContainer *************/ + +HRESULT WINAPI Main_DDVideoPortContainer_QueryInterface (LPDDVIDEOPORTCONTAINER iface, REFIID riid, LPVOID* ppvObj) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +ULONG WINAPI Main_DDVideoPortContainer_AddRef (LPDDVIDEOPORTCONTAINER iface) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +ULONG WINAPI Main_DDVideoPortContainer_Release (LPDDVIDEOPORTCONTAINER iface) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI Main_DDVideoPortContainer_CreateVideoPort (LPDDVIDEOPORTCONTAINER iface, DWORD dwFlags, LPDDVIDEOPORTDESC pPortDesc, + LPDIRECTDRAWVIDEOPORT* DDVideoPort, IUnknown* pUnkOuter) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI +Main_DDVideoPortContainer_EnumVideoPorts (LPDDVIDEOPORTCONTAINER iface, + DWORD dwFlags, + LPDDVIDEOPORTCAPS pCaps, + LPVOID pContext, + LPDDENUMVIDEOCALLBACK pEnumVideoCallback) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI +Main_DDVideoPortContainer_GetVideoPortConnectInfo (LPDDVIDEOPORTCONTAINER iface, + DWORD PortId, DWORD* pNumEntries, + LPDDVIDEOPORTCONNECT pConnectInfo) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI +Main_DDVideoPortContainer_QueryVideoPortStatus (LPDDVIDEOPORTCONTAINER iface, + DWORD PortId, + LPDDVIDEOPORTSTATUS pStatus) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +/************* IDirectDrawVideoPortNotify *************/ + +HRESULT WINAPI +Main_DDVideoPortNotify_QueryInterface (LPDIRECTDRAWVIDEOPORTNOTIFY iface, REFIID + riid, LPVOID* ppvObj) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +ULONG WINAPI +Main_DDVideoPortNotify_AddRef (LPDIRECTDRAWVIDEOPORTNOTIFY iface) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +ULONG WINAPI +Main_DDVideoPortNotify_Release (LPDIRECTDRAWVIDEOPORTNOTIFY iface) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI Main_DDVideoPortNotify_AcquireNotification (LPDIRECTDRAWVIDEOPORTNOTIFY iface, HANDLE* h, LPDDVIDEOPORTNOTIFY pVideoPortNotify) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +HRESULT WINAPI Main_DDVideoPortNotify_ReleaseNotification (LPDIRECTDRAWVIDEOPORTNOTIFY iface, HANDLE h) +{ + DX_WINDBG_trace(); + DX_STUB; +} + +IDirectDrawVideoPortVtbl DirectDrawVideoPort_Vtable = +{ + Main_DirectDrawVideoPort_QueryInterface, + Main_DirectDrawVideoPort_AddRef, + Main_DirectDrawVideoPort_Release, + Main_DirectDrawVideoPort_Flip, + Main_DirectDrawVideoPort_GetBandwidthInfo, + Main_DirectDrawVideoPort_GetColorControls, + Main_DirectDrawVideoPort_GetInputFormats, + Main_DirectDrawVideoPort_GetOutputFormats, + Main_DirectDrawVideoPort_GetFieldPolarity, + Main_DirectDrawVideoPort_GetVideoLine, + Main_DirectDrawVideoPort_GetVideoSignalStatus, + Main_DirectDrawVideoPort_SetColorControls, + Main_DirectDrawVideoPort_SetTargetSurface, + Main_DirectDrawVideoPort_StartVideo, + Main_DirectDrawVideoPort_StopVideo, + Main_DirectDrawVideoPort_UpdateVideo, + Main_DirectDrawVideoPort_WaitForSync +}; + +IDDVideoPortContainerVtbl DDVideoPortContainer_Vtable = +{ + Main_DDVideoPortContainer_QueryInterface, + Main_DDVideoPortContainer_AddRef, + Main_DDVideoPortContainer_Release, + Main_DDVideoPortContainer_CreateVideoPort, + Main_DDVideoPortContainer_EnumVideoPorts, + Main_DDVideoPortContainer_GetVideoPortConnectInfo, + Main_DDVideoPortContainer_QueryVideoPortStatus +}; + +IDirectDrawVideoPortNotifyVtbl DDVideoPortNotify_Vtable = +{ + Main_DDVideoPortNotify_QueryInterface, + Main_DDVideoPortNotify_AddRef, + Main_DDVideoPortNotify_Release, + Main_DDVideoPortNotify_AcquireNotification, + Main_DDVideoPortNotify_ReleaseNotification +}; Propchange: trunk/reactos/dll/directx/ddraw/videoport.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/dll/directx/ddraw/videoport.c ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision
18 years, 6 months
1
0
0
0
← Newer
1
...
29
30
31
32
33
34
35
...
38
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
Results per page:
10
25
50
100
200