ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
September 2009
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
16 participants
270 discussions
Start a n
N
ew thread
[janderwald] 43116: - Fix memory leak - Fix displaying of random characters if there is no device name
by janderwald@svn.reactos.org
Author: janderwald Date: Tue Sep 22 22:09:11 2009 New Revision: 43116 URL:
http://svn.reactos.org/svn/reactos?rev=43116&view=rev
Log: - Fix memory leak - Fix displaying of random characters if there is no device name Modified: trunk/reactos/dll/win32/netshell/shfldr_netconnect.c Modified: trunk/reactos/dll/win32/netshell/shfldr_netconnect.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netshell/shfldr_…
============================================================================== --- trunk/reactos/dll/win32/netshell/shfldr_netconnect.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netshell/shfldr_netconnect.c [iso-8859-1] Tue Sep 22 22:09:11 2009 @@ -644,6 +644,11 @@ psd->str.uType = STRRET_WSTR; hr = SHStrDupW(buffer, &psd->str.u.pOleStr); } + else + { + psd->str.u.cStr[0] = '\0'; + psd->str.uType = STRRET_CSTR; + } break; case COLUMN_PHONE: case COLUMN_OWNER: @@ -651,9 +656,8 @@ psd->str.uType = STRRET_CSTR; break; } -#if 0 + NcFreeNetconProperties(pProperties); -#endif return hr; }
15 years, 3 months
1
0
0
0
[hpoussin] 43115: [freeldr] Rework NTFS filesystem to not be tied to boot filesystem
by hpoussin@svn.reactos.org
Author: hpoussin Date: Tue Sep 22 21:37:11 2009 New Revision: 43115 URL:
http://svn.reactos.org/svn/reactos?rev=43115&view=rev
Log: [freeldr] Rework NTFS filesystem to not be tied to boot filesystem Modified: trunk/reactos/boot/freeldr/freeldr/fs/ntfs.c trunk/reactos/boot/freeldr/freeldr/include/fs/ntfs.h Modified: trunk/reactos/boot/freeldr/freeldr/fs/ntfs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/fs/nt…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/fs/ntfs.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/fs/ntfs.c [iso-8859-1] Tue Sep 22 21:37:11 2009 @@ -26,15 +26,19 @@ #include <freeldr.h> #include <debug.h> -PNTFS_BOOTSECTOR NtfsBootSector; -ULONG NtfsClusterSize; -ULONG NtfsMftRecordSize; -ULONG NtfsIndexRecordSize; -ULONG NtfsDriveNumber; -ULONG NtfsSectorOfClusterZero; -PNTFS_MFT_RECORD NtfsMasterFileTable; -/* FIXME: NtfsMFTContext is never freed. */ -PNTFS_ATTR_CONTEXT NtfsMFTContext; +typedef struct _NTFS_VOLUME_INFO +{ + NTFS_BOOTSECTOR BootSector; + ULONG ClusterSize; + ULONG MftRecordSize; + ULONG IndexRecordSize; + PNTFS_MFT_RECORD MasterFileTable; + /* FIXME: MFTContext is never freed. */ + PNTFS_ATTR_CONTEXT MFTContext; + ULONG DeviceId; +} NTFS_VOLUME_INFO; + +PNTFS_VOLUME_INFO NtfsVolumes[MAX_FDS]; static ULONGLONG NtfsGetAttributeSize(PNTFS_ATTR_RECORD AttrRecord) { @@ -123,50 +127,80 @@ MmHeapFree(Context); } -/* FIXME: Optimize for multisector reads. */ -static BOOLEAN NtfsDiskRead(ULONGLONG Offset, ULONGLONG Length, PCHAR Buffer) -{ +static BOOLEAN NtfsDiskRead(PNTFS_VOLUME_INFO Volume, ULONGLONG Offset, ULONGLONG Length, PCHAR Buffer) +{ + LARGE_INTEGER Position; + ULONG Count; USHORT ReadLength; + LONG ret; DPRINTM(DPRINT_FILESYSTEM, "NtfsDiskRead - Offset: %I64d Length: %I64d\n", Offset, Length); - RtlZeroMemory((PCHAR)DISKREADBUFFER, 0x1000); - - /* I. Read partial first sector if needed */ - if (Offset % NtfsBootSector->BytesPerSector) - { - if (!MachDiskReadLogicalSectors(NtfsDriveNumber, NtfsSectorOfClusterZero + (Offset / NtfsBootSector->BytesPerSector), 1, (PCHAR)DISKREADBUFFER)) + + // + // I. Read partial first sector if needed + // + if (Offset % Volume->BootSector.BytesPerSector) + { + Position.HighPart = 0; + Position.LowPart = Offset & ~(Volume->BootSector.BytesPerSector - 1); + ret = ArcSeek(Volume->DeviceId, &Position, SeekAbsolute); + if (ret != ESUCCESS) return FALSE; - ReadLength = min(Length, NtfsBootSector->BytesPerSector - (Offset % NtfsBootSector->BytesPerSector)); - RtlCopyMemory(Buffer, (PCHAR)DISKREADBUFFER + (Offset % NtfsBootSector->BytesPerSector), ReadLength); + ReadLength = min(Length, Volume->BootSector.BytesPerSector - (Offset % Volume->BootSector.BytesPerSector)); + ret = ArcRead(Volume->DeviceId, Buffer, ReadLength, &Count); + if (ret != ESUCCESS || Count != ReadLength) + return FALSE; + + // + // Move to unfilled buffer part + // Buffer += ReadLength; Length -= ReadLength; Offset += ReadLength; } - /* II. Read all complete 64-sector blocks. */ - while (Length >= (ULONGLONG)64 * (ULONGLONG)NtfsBootSector->BytesPerSector) - { - if (!MachDiskReadLogicalSectors(NtfsDriveNumber, NtfsSectorOfClusterZero + (Offset / NtfsBootSector->BytesPerSector), 64, (PCHAR)DISKREADBUFFER)) + // + // II. Read all complete blocks + // + if (Length >= Volume->BootSector.BytesPerSector) + { + Position.HighPart = 0; + Position.LowPart = Offset; + ret = ArcSeek(Volume->DeviceId, &Position, SeekAbsolute); + if (ret != ESUCCESS) return FALSE; - RtlCopyMemory(Buffer, (PCHAR)DISKREADBUFFER, 64 * NtfsBootSector->BytesPerSector); - Buffer += 64 * NtfsBootSector->BytesPerSector; - Length -= 64 * NtfsBootSector->BytesPerSector; - Offset += 64 * NtfsBootSector->BytesPerSector; - } - - /* III. Read the rest of data */ + ReadLength = Length & ~(Volume->BootSector.BytesPerSector - 1); + ret = ArcRead(Volume->DeviceId, Buffer, ReadLength, &Count); + if (ret != ESUCCESS || Count != ReadLength) + return FALSE; + + // + // Move to unfilled buffer part + // + Buffer += ReadLength; + Length -= ReadLength; + Offset += ReadLength; + } + + // + // III. Read the rest of data + // if (Length) { - ReadLength = ((Length + NtfsBootSector->BytesPerSector - 1) / NtfsBootSector->BytesPerSector); - if (!MachDiskReadLogicalSectors(NtfsDriveNumber, NtfsSectorOfClusterZero + (Offset / NtfsBootSector->BytesPerSector), ReadLength, (PCHAR)DISKREADBUFFER)) + Position.HighPart = 0; + Position.LowPart = Offset; + ret = ArcSeek(Volume->DeviceId, &Position, SeekAbsolute); + if (ret != ESUCCESS) return FALSE; - RtlCopyMemory(Buffer, (PCHAR)DISKREADBUFFER, Length); + ret = ArcRead(Volume->DeviceId, Buffer, Length, &Count); + if (ret != ESUCCESS || Count != Length) + return FALSE; } return TRUE; } -static ULONGLONG NtfsReadAttribute(PNTFS_ATTR_CONTEXT Context, ULONGLONG Offset, PCHAR Buffer, ULONGLONG Length) +static ULONGLONG NtfsReadAttribute(PNTFS_VOLUME_INFO Volume, PNTFS_ATTR_CONTEXT Context, ULONGLONG Offset, PCHAR Buffer, ULONGLONG Length) { ULONGLONG LastLCN; PUCHAR DataRun; @@ -197,7 +231,7 @@ AlreadyRead = 0; - if(Context->CacheRunOffset <= Offset && Offset < Context->CacheRunOffset + Context->CacheRunLength * NtfsClusterSize) + if(Context->CacheRunOffset <= Offset && Offset < Context->CacheRunOffset + Context->CacheRunLength * Volume->ClusterSize) { DataRun = Context->CacheRun; LastLCN = Context->CacheRunLastLCN; @@ -227,7 +261,7 @@ } if (Offset >= CurrentOffset && - Offset < CurrentOffset + (DataRunLength * NtfsClusterSize)) + Offset < CurrentOffset + (DataRunLength * Volume->ClusterSize)) { break; } @@ -237,7 +271,7 @@ return AlreadyRead; } - CurrentOffset += DataRunLength * NtfsClusterSize; + CurrentOffset += DataRunLength * Volume->ClusterSize; } } @@ -245,18 +279,18 @@ * II. Go through the run list and read the data */ - ReadLength = min(DataRunLength * NtfsClusterSize - (Offset - CurrentOffset), Length); + ReadLength = min(DataRunLength * Volume->ClusterSize - (Offset - CurrentOffset), Length); if (DataRunStartLCN == -1) RtlZeroMemory(Buffer, ReadLength); - if (NtfsDiskRead(DataRunStartLCN * NtfsClusterSize + Offset - CurrentOffset, ReadLength, Buffer)) + if (NtfsDiskRead(Volume, DataRunStartLCN * Volume->ClusterSize + Offset - CurrentOffset, ReadLength, Buffer)) { Length -= ReadLength; Buffer += ReadLength; AlreadyRead += ReadLength; - if (ReadLength == DataRunLength * NtfsClusterSize - (Offset - CurrentOffset)) - { - CurrentOffset += DataRunLength * NtfsClusterSize; + if (ReadLength == DataRunLength * Volume->ClusterSize - (Offset - CurrentOffset)) + { + CurrentOffset += DataRunLength * Volume->ClusterSize; DataRun = NtfsDecodeRun(DataRun, &DataRunOffset, &DataRunLength); if (DataRunLength != (ULONGLONG)-1) { @@ -272,10 +306,10 @@ while (Length > 0) { - ReadLength = min(DataRunLength * NtfsClusterSize, Length); + ReadLength = min(DataRunLength * Volume->ClusterSize, Length); if (DataRunStartLCN == -1) RtlZeroMemory(Buffer, ReadLength); - else if (!NtfsDiskRead(DataRunStartLCN * NtfsClusterSize, ReadLength, Buffer)) + else if (!NtfsDiskRead(Volume, DataRunStartLCN * Volume->ClusterSize, ReadLength, Buffer)) break; Length -= ReadLength; @@ -283,7 +317,7 @@ AlreadyRead += ReadLength; /* We finished this request, but there still data in this data run. */ - if (Length == 0 && ReadLength != DataRunLength * NtfsClusterSize) + if (Length == 0 && ReadLength != DataRunLength * Volume->ClusterSize) break; /* @@ -292,7 +326,7 @@ if (*DataRun == 0) break; - CurrentOffset += DataRunLength * NtfsClusterSize; + CurrentOffset += DataRunLength * Volume->ClusterSize; DataRun = NtfsDecodeRun(DataRun, &DataRunOffset, &DataRunLength); if (DataRunOffset != -1) { @@ -319,7 +353,7 @@ return AlreadyRead; } -static PNTFS_ATTR_CONTEXT NtfsFindAttributeHelper(PNTFS_ATTR_RECORD AttrRecord, PNTFS_ATTR_RECORD AttrRecordEnd, ULONG Type, const WCHAR *Name, ULONG NameLength) +static PNTFS_ATTR_CONTEXT NtfsFindAttributeHelper(PNTFS_VOLUME_INFO Volume, PNTFS_ATTR_RECORD AttrRecord, PNTFS_ATTR_RECORD AttrRecordEnd, ULONG Type, const WCHAR *Name, ULONG NameLength) { while (AttrRecord < AttrRecordEnd) { @@ -343,9 +377,9 @@ ListAttrRecord = (PNTFS_ATTR_RECORD)ListBuffer; ListAttrRecordEnd = (PNTFS_ATTR_RECORD)((PCHAR)ListBuffer + ListSize); - if (NtfsReadAttribute(ListContext, 0, ListBuffer, ListSize) == ListSize) - { - Context = NtfsFindAttributeHelper(ListAttrRecord, ListAttrRecordEnd, + if (NtfsReadAttribute(Volume, ListContext, 0, ListBuffer, ListSize) == ListSize) + { + Context = NtfsFindAttributeHelper(Volume, ListAttrRecord, ListAttrRecordEnd, Type, Name, NameLength); NtfsReleaseAttributeContext(ListContext); @@ -371,27 +405,29 @@ } } + if (AttrRecord->Length == 0) + return NULL; AttrRecord = (PNTFS_ATTR_RECORD)((PCHAR)AttrRecord + AttrRecord->Length); } return NULL; } -static PNTFS_ATTR_CONTEXT NtfsFindAttribute(PNTFS_MFT_RECORD MftRecord, ULONG Type, const WCHAR *Name) +static PNTFS_ATTR_CONTEXT NtfsFindAttribute(PNTFS_VOLUME_INFO Volume, PNTFS_MFT_RECORD MftRecord, ULONG Type, const WCHAR *Name) { PNTFS_ATTR_RECORD AttrRecord; PNTFS_ATTR_RECORD AttrRecordEnd; ULONG NameLength; AttrRecord = (PNTFS_ATTR_RECORD)((PCHAR)MftRecord + MftRecord->AttributesOffset); - AttrRecordEnd = (PNTFS_ATTR_RECORD)((PCHAR)MftRecord + NtfsMftRecordSize); + AttrRecordEnd = (PNTFS_ATTR_RECORD)((PCHAR)MftRecord + Volume->MftRecordSize); for (NameLength = 0; Name[NameLength] != 0; NameLength++) ; - return NtfsFindAttributeHelper(AttrRecord, AttrRecordEnd, Type, Name, NameLength); -} - -static BOOLEAN NtfsFixupRecord(PNTFS_RECORD Record) + return NtfsFindAttributeHelper(Volume, AttrRecord, AttrRecordEnd, Type, Name, NameLength); +} + +static BOOLEAN NtfsFixupRecord(PNTFS_VOLUME_INFO Volume, PNTFS_RECORD Record) { USHORT *USA; USHORT USANumber; @@ -401,30 +437,30 @@ USA = (USHORT*)((PCHAR)Record + Record->USAOffset); USANumber = *(USA++); USACount = Record->USACount - 1; /* Exclude the USA Number. */ - Block = (USHORT*)((PCHAR)Record + NtfsBootSector->BytesPerSector - 2); + Block = (USHORT*)((PCHAR)Record + Volume->BootSector.BytesPerSector - 2); while (USACount) { if (*Block != USANumber) return FALSE; *Block = *(USA++); - Block = (USHORT*)((PCHAR)Block + NtfsBootSector->BytesPerSector); + Block = (USHORT*)((PCHAR)Block + Volume->BootSector.BytesPerSector); USACount--; } return TRUE; } -static BOOLEAN NtfsReadMftRecord(ULONG MFTIndex, PNTFS_MFT_RECORD Buffer) +static BOOLEAN NtfsReadMftRecord(PNTFS_VOLUME_INFO Volume, ULONG MFTIndex, PNTFS_MFT_RECORD Buffer) { ULONGLONG BytesRead; - BytesRead = NtfsReadAttribute(NtfsMFTContext, MFTIndex * NtfsMftRecordSize, (PCHAR)Buffer, NtfsMftRecordSize); - if (BytesRead != NtfsMftRecordSize) + BytesRead = NtfsReadAttribute(Volume, Volume->MFTContext, MFTIndex * Volume->MftRecordSize, (PCHAR)Buffer, Volume->MftRecordSize); + if (BytesRead != Volume->MftRecordSize) return FALSE; /* Apply update sequence array fixups. */ - return NtfsFixupRecord((PNTFS_RECORD)Buffer); + return NtfsFixupRecord(Volume, (PNTFS_RECORD)Buffer); } #if DBG @@ -479,7 +515,7 @@ return TRUE; } -static BOOLEAN NtfsFindMftRecord(ULONG MFTIndex, PCHAR FileName, ULONG *OutMFTIndex) +static BOOLEAN NtfsFindMftRecord(PNTFS_VOLUME_INFO Volume, ULONG MFTIndex, PCHAR FileName, ULONG *OutMFTIndex) { PNTFS_MFT_RECORD MftRecord; ULONG Magic; @@ -495,38 +531,38 @@ ULONG RecordOffset; ULONG IndexBlockSize; - MftRecord = MmHeapAlloc(NtfsMftRecordSize); + MftRecord = MmHeapAlloc(Volume->MftRecordSize); if (MftRecord == NULL) { return FALSE; } - if (NtfsReadMftRecord(MFTIndex, MftRecord)) + if (NtfsReadMftRecord(Volume, MFTIndex, MftRecord)) { Magic = MftRecord->Magic; - IndexRootCtx = NtfsFindAttribute(MftRecord, NTFS_ATTR_TYPE_INDEX_ROOT, L"$I30"); + IndexRootCtx = NtfsFindAttribute(Volume, MftRecord, NTFS_ATTR_TYPE_INDEX_ROOT, L"$I30"); if (IndexRootCtx == NULL) { MmHeapFree(MftRecord); return FALSE; } - IndexRecord = MmHeapAlloc(NtfsIndexRecordSize); + IndexRecord = MmHeapAlloc(Volume->IndexRecordSize); if (IndexRecord == NULL) { MmHeapFree(MftRecord); return FALSE; } - NtfsReadAttribute(IndexRootCtx, 0, IndexRecord, NtfsIndexRecordSize); + NtfsReadAttribute(Volume, IndexRootCtx, 0, IndexRecord, Volume->IndexRecordSize); IndexRoot = (PNTFS_INDEX_ROOT)IndexRecord; IndexEntry = (PNTFS_INDEX_ENTRY)((PCHAR)&IndexRoot->IndexHeader + IndexRoot->IndexHeader.EntriesOffset); /* Index root is always resident. */ IndexEntryEnd = (PNTFS_INDEX_ENTRY)(IndexRecord + IndexRootCtx->Record.Resident.ValueLength); NtfsReleaseAttributeContext(IndexRootCtx); - DPRINTM(DPRINT_FILESYSTEM, "NtfsIndexRecordSize: %x IndexBlockSize: %x\n", NtfsIndexRecordSize, IndexRoot->IndexBlockSize); + DPRINTM(DPRINT_FILESYSTEM, "IndexRecordSize: %x IndexBlockSize: %x\n", Volume->IndexRecordSize, IndexRoot->IndexBlockSize); while (IndexEntry < IndexEntryEnd && !(IndexEntry->Flags & NTFS_INDEX_ENTRY_END)) @@ -547,7 +583,7 @@ IndexBlockSize = IndexRoot->IndexBlockSize; - IndexBitmapCtx = NtfsFindAttribute(MftRecord, NTFS_ATTR_TYPE_BITMAP, L"$I30"); + IndexBitmapCtx = NtfsFindAttribute(Volume, MftRecord, NTFS_ATTR_TYPE_BITMAP, L"$I30"); if (IndexBitmapCtx == NULL) { DPRINTM(DPRINT_FILESYSTEM, "Corrupted filesystem!\n"); @@ -563,10 +599,10 @@ MmHeapFree(MftRecord); return FALSE; } - NtfsReadAttribute(IndexBitmapCtx, 0, BitmapData, BitmapDataSize); + NtfsReadAttribute(Volume, IndexBitmapCtx, 0, BitmapData, BitmapDataSize); NtfsReleaseAttributeContext(IndexBitmapCtx); - IndexAllocationCtx = NtfsFindAttribute(MftRecord, NTFS_ATTR_TYPE_INDEX_ALLOCATION, L"$I30"); + IndexAllocationCtx = NtfsFindAttribute(Volume, MftRecord, NTFS_ATTR_TYPE_INDEX_ALLOCATION, L"$I30"); if (IndexAllocationCtx == NULL) { DPRINTM(DPRINT_FILESYSTEM, "Corrupted filesystem!\n"); @@ -596,9 +632,9 @@ break; } - NtfsReadAttribute(IndexAllocationCtx, RecordOffset, IndexRecord, IndexBlockSize); - - if (!NtfsFixupRecord((PNTFS_RECORD)IndexRecord)) + NtfsReadAttribute(Volume, IndexAllocationCtx, RecordOffset, IndexRecord, IndexBlockSize); + + if (!NtfsFixupRecord(Volume, (PNTFS_RECORD)IndexRecord)) { break; } @@ -641,7 +677,7 @@ return FALSE; } -static BOOLEAN NtfsLookupFile(PCSTR FileName, PNTFS_MFT_RECORD MftRecord, PNTFS_ATTR_CONTEXT *DataContext) +static BOOLEAN NtfsLookupFile(PNTFS_VOLUME_INFO Volume, PCSTR FileName, PNTFS_MFT_RECORD MftRecord, PNTFS_ATTR_CONTEXT *DataContext) { ULONG NumberOfPathParts; CHAR PathPart[261]; @@ -661,7 +697,7 @@ FileName++; DPRINTM(DPRINT_FILESYSTEM, "- Lookup: %s\n", PathPart); - if (!NtfsFindMftRecord(CurrentMFTIndex, PathPart, &CurrentMFTIndex)) + if (!NtfsFindMftRecord(Volume, CurrentMFTIndex, PathPart, &CurrentMFTIndex)) { DPRINTM(DPRINT_FILESYSTEM, "- Failed\n"); return FALSE; @@ -669,91 +705,16 @@ DPRINTM(DPRINT_FILESYSTEM, "- Lookup: %x\n", CurrentMFTIndex); } - if (!NtfsReadMftRecord(CurrentMFTIndex, MftRecord)) + if (!NtfsReadMftRecord(Volume, CurrentMFTIndex, MftRecord)) { DPRINTM(DPRINT_FILESYSTEM, "NtfsLookupFile: Can't read MFT record\n"); return FALSE; } - *DataContext = NtfsFindAttribute(MftRecord, NTFS_ATTR_TYPE_DATA, L""); + *DataContext = NtfsFindAttribute(Volume, MftRecord, NTFS_ATTR_TYPE_DATA, L""); if (*DataContext == NULL) { DPRINTM(DPRINT_FILESYSTEM, "NtfsLookupFile: Can't find data attribute\n"); - return FALSE; - } - - return TRUE; -} - -BOOLEAN NtfsOpenVolume(UCHAR DriveNumber, ULONGLONG VolumeStartSector, ULONGLONG PartitionSectorCount) -{ - NtfsBootSector = (PNTFS_BOOTSECTOR)DISKREADBUFFER; - - DPRINTM(DPRINT_FILESYSTEM, "NtfsOpenVolume() DriveNumber = 0x%x VolumeStartSector = 0x%x\n", DriveNumber, VolumeStartSector); - - if (!MachDiskReadLogicalSectors(DriveNumber, VolumeStartSector, 1, (PCHAR)DISKREADBUFFER)) - { - FileSystemError("Failed to read the boot sector."); - return FALSE; - } - - if (!RtlEqualMemory(NtfsBootSector->SystemId, "NTFS", 4)) - { - FileSystemError("Invalid NTFS signature."); - return FALSE; - } - - NtfsBootSector = MmHeapAlloc(NtfsBootSector->BytesPerSector); - if (NtfsBootSector == NULL) - { - return FALSE; - } - - RtlCopyMemory(NtfsBootSector, (PCHAR)DISKREADBUFFER, ((PNTFS_BOOTSECTOR)DISKREADBUFFER)->BytesPerSector); - - NtfsClusterSize = NtfsBootSector->SectorsPerCluster * NtfsBootSector->BytesPerSector; - if (NtfsBootSector->ClustersPerMftRecord > 0) - NtfsMftRecordSize = NtfsBootSector->ClustersPerMftRecord * NtfsClusterSize; - else - NtfsMftRecordSize = 1 << (-NtfsBootSector->ClustersPerMftRecord); - if (NtfsBootSector->ClustersPerIndexRecord > 0) - NtfsIndexRecordSize = NtfsBootSector->ClustersPerIndexRecord * NtfsClusterSize; - else - NtfsIndexRecordSize = 1 << (-NtfsBootSector->ClustersPerIndexRecord); - - DPRINTM(DPRINT_FILESYSTEM, "NtfsClusterSize: 0x%x\n", NtfsClusterSize); - DPRINTM(DPRINT_FILESYSTEM, "ClustersPerMftRecord: %d\n", NtfsBootSector->ClustersPerMftRecord); - DPRINTM(DPRINT_FILESYSTEM, "ClustersPerIndexRecord: %d\n", NtfsBootSector->ClustersPerIndexRecord); - DPRINTM(DPRINT_FILESYSTEM, "NtfsMftRecordSize: 0x%x\n", NtfsMftRecordSize); - DPRINTM(DPRINT_FILESYSTEM, "NtfsIndexRecordSize: 0x%x\n", NtfsIndexRecordSize); - - NtfsDriveNumber = DriveNumber; - NtfsSectorOfClusterZero = VolumeStartSector; - - DPRINTM(DPRINT_FILESYSTEM, "Reading MFT index...\n"); - if (!MachDiskReadLogicalSectors(DriveNumber, - NtfsSectorOfClusterZero + - (NtfsBootSector->MftLocation * NtfsBootSector->SectorsPerCluster), - NtfsMftRecordSize / NtfsBootSector->BytesPerSector, (PCHAR)DISKREADBUFFER)) - { - FileSystemError("Failed to read the Master File Table record."); - return FALSE; - } - - NtfsMasterFileTable = MmHeapAlloc(NtfsMftRecordSize); - if (NtfsMasterFileTable == NULL) - { - MmHeapFree(NtfsBootSector); - return FALSE; - } - - RtlCopyMemory(NtfsMasterFileTable, (PCHAR)DISKREADBUFFER, NtfsMftRecordSize); - - DPRINTM(DPRINT_FILESYSTEM, "Searching for DATA attribute...\n"); - NtfsMFTContext = NtfsFindAttribute(NtfsMasterFileTable, NTFS_ATTR_TYPE_DATA, L""); - if (NtfsMFTContext == NULL) - { - FileSystemError("Can't find data attribute for Master File Table."); return FALSE; } @@ -788,6 +749,7 @@ LONG NtfsOpen(CHAR* Path, OPENMODE OpenMode, ULONG* FileId) { + PNTFS_VOLUME_INFO Volume; PNTFS_FILE_HANDLE FileHandle; PNTFS_MFT_RECORD MftRecord; ULONG DeviceId; @@ -802,24 +764,26 @@ // Get underlying device // DeviceId = FsGetDeviceId(*FileId); + Volume = NtfsVolumes[DeviceId]; DPRINTM(DPRINT_FILESYSTEM, "NtfsOpen() FileName = %s\n", Path); // // Allocate file structure // - FileHandle = MmHeapAlloc(sizeof(NTFS_FILE_HANDLE) + NtfsMftRecordSize); + FileHandle = MmHeapAlloc(sizeof(NTFS_FILE_HANDLE) + Volume->MftRecordSize); if (!FileHandle) { return ENOMEM; } - RtlZeroMemory(FileHandle, sizeof(NTFS_FILE_HANDLE) + NtfsMftRecordSize); + RtlZeroMemory(FileHandle, sizeof(NTFS_FILE_HANDLE) + Volume->MftRecordSize); + FileHandle->Volume = Volume; // // Search file entry // MftRecord = (PNTFS_MFT_RECORD)(FileHandle + 1); - if (!NtfsLookupFile(Path, MftRecord, &FileHandle->DataContext)) + if (!NtfsLookupFile(Volume, Path, MftRecord, &FileHandle->DataContext)) { MmHeapFree(FileHandle); return ENOENT; @@ -836,7 +800,7 @@ // // Read file // - BytesRead64 = NtfsReadAttribute(FileHandle->DataContext, FileHandle->Offset, Buffer, N); + BytesRead64 = NtfsReadAttribute(FileHandle->Volume, FileHandle->DataContext, FileHandle->Offset, Buffer, N); *Count = (ULONG)BytesRead64; // @@ -876,10 +840,18 @@ const DEVVTBL* NtfsMount(ULONG DeviceId) { - NTFS_BOOTSECTOR BootSector; + PNTFS_VOLUME_INFO Volume; LARGE_INTEGER Position; ULONG Count; LONG ret; + + // + // Allocate data for volume information + // + Volume = MmHeapAlloc(sizeof(NTFS_VOLUME_INFO)); + if (!Volume) + return NULL; + RtlZeroMemory(Volume, sizeof(NTFS_VOLUME_INFO)); // // Read the BootSector @@ -888,28 +860,99 @@ Position.LowPart = 0; ret = ArcSeek(DeviceId, &Position, SeekAbsolute); if (ret != ESUCCESS) + { + MmHeapFree(Volume); return NULL; - ret = ArcRead(DeviceId, &BootSector, sizeof(BootSector), &Count); - if (ret != ESUCCESS || Count != sizeof(BootSector)) + } + ret = ArcRead(DeviceId, &Volume->BootSector, sizeof(Volume->BootSector), &Count); + if (ret != ESUCCESS || Count != sizeof(Volume->BootSector)) + { + MmHeapFree(Volume); return NULL; - - // - // Check if BootSector is valid. If yes, return NTFS function table - // - if (RtlEqualMemory(BootSector.SystemId, "NTFS", 4)) - { - // - // Compatibility hack as long as FS is not using underlying device DeviceId - // - ULONG DriveNumber; - ULONGLONG StartSector; - ULONGLONG SectorCount; - int Type; - if (!DiskGetBootVolume(&DriveNumber, &StartSector, &SectorCount, &Type)) - return NULL; - NtfsOpenVolume(DriveNumber, StartSector, SectorCount); - return &NtfsFuncTable; - } + } + + // + // Check if BootSector is valid. If no, return early + // + if (!RtlEqualMemory(Volume->BootSector.SystemId, "NTFS", 4)) + { + MmHeapFree(Volume); + return NULL; + } + + // + // Calculate cluster size and MFT record size + // + Volume->ClusterSize = Volume->BootSector.SectorsPerCluster * Volume->BootSector.BytesPerSector; + if (Volume->BootSector.ClustersPerMftRecord > 0) + Volume->MftRecordSize = Volume->BootSector.ClustersPerMftRecord * Volume->ClusterSize; else + Volume->MftRecordSize = 1 << (-Volume->BootSector.ClustersPerMftRecord); + if (Volume->BootSector.ClustersPerIndexRecord > 0) + Volume->IndexRecordSize = Volume->BootSector.ClustersPerIndexRecord * Volume->ClusterSize; + else + Volume->IndexRecordSize = 1 << (-Volume->BootSector.ClustersPerIndexRecord); + + DPRINTM(DPRINT_FILESYSTEM, "ClusterSize: 0x%x\n", Volume->ClusterSize); + DPRINTM(DPRINT_FILESYSTEM, "ClustersPerMftRecord: %d\n", Volume->BootSector.ClustersPerMftRecord); + DPRINTM(DPRINT_FILESYSTEM, "ClustersPerIndexRecord: %d\n", Volume->BootSector.ClustersPerIndexRecord); + DPRINTM(DPRINT_FILESYSTEM, "MftRecordSize: 0x%x\n", Volume->MftRecordSize); + DPRINTM(DPRINT_FILESYSTEM, "IndexRecordSize: 0x%x\n", Volume->IndexRecordSize); + + // + // Read MFT index + // + DPRINTM(DPRINT_FILESYSTEM, "Reading MFT index...\n"); + Volume->MasterFileTable = MmHeapAlloc(Volume->MftRecordSize); + if (!Volume->MasterFileTable) + { + MmHeapFree(Volume); return NULL; -} + } + Position.HighPart = 0; + Position.LowPart = Volume->BootSector.MftLocation * Volume->ClusterSize; + ret = ArcSeek(DeviceId, &Position, SeekAbsolute); + if (ret != ESUCCESS) + { + FileSystemError("Failed to seek to Master File Table record."); + MmHeapFree(Volume->MasterFileTable); + MmHeapFree(Volume); + return NULL; + } + ret = ArcRead(DeviceId, Volume->MasterFileTable, Volume->MftRecordSize, &Count); + if (ret != ESUCCESS || Count != Volume->MftRecordSize) + { + FileSystemError("Failed to read the Master File Table record."); + MmHeapFree(Volume->MasterFileTable); + MmHeapFree(Volume); + return NULL; + } + + // + // Keep device id + // + Volume->DeviceId = DeviceId; + + // + // Search DATA attribute + // + DPRINTM(DPRINT_FILESYSTEM, "Searching for DATA attribute...\n"); + Volume->MFTContext = NtfsFindAttribute(Volume, Volume->MasterFileTable, NTFS_ATTR_TYPE_DATA, L""); + if (!Volume->MFTContext) + { + FileSystemError("Can't find data attribute for Master File Table."); + MmHeapFree(Volume->MasterFileTable); + MmHeapFree(Volume); + return NULL; + } + + // + // Remember NTFS volume information + // + NtfsVolumes[DeviceId] = Volume; + + // + // Return success + // + return &NtfsFuncTable; +} Modified: trunk/reactos/boot/freeldr/freeldr/include/fs/ntfs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/fs/ntfs.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/fs/ntfs.h [iso-8859-1] Tue Sep 22 21:37:11 2009 @@ -214,11 +214,14 @@ NTFS_ATTR_RECORD Record; } NTFS_ATTR_CONTEXT, *PNTFS_ATTR_CONTEXT; +typedef struct _NTFS_VOLUME_INFO *PNTFS_VOLUME_INFO; + #include <pshpack1.h> typedef struct { PNTFS_ATTR_CONTEXT DataContext; ULONGLONG Offset; + PNTFS_VOLUME_INFO Volume; } NTFS_FILE_HANDLE, *PNTFS_FILE_HANDLE; #include <poppack.h>
15 years, 3 months
1
0
0
0
[hpoussin] 43114: [freeldr] Move definition of maximum number of available file descriptors to fs.h Fix typos
by hpoussin@svn.reactos.org
Author: hpoussin Date: Tue Sep 22 21:33:34 2009 New Revision: 43114 URL:
http://svn.reactos.org/svn/reactos?rev=43114&view=rev
Log: [freeldr] Move definition of maximum number of available file descriptors to fs.h Fix typos Modified: trunk/reactos/boot/freeldr/freeldr/fs/fs.c trunk/reactos/boot/freeldr/freeldr/include/fs.h Modified: trunk/reactos/boot/freeldr/freeldr/fs/fs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/fs/fs…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/fs/fs.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/fs/fs.c [iso-8859-1] Tue Sep 22 21:33:34 2009 @@ -163,7 +163,7 @@ } num++; - DPRINTM(DPRINT_FILESYSTEM, "FatGetNumPathParts() Path = %s NumPathParts = %d\n", Path, num); + DPRINTM(DPRINT_FILESYSTEM, "FsGetNumPathParts() Path = %s NumPathParts = %d\n", Path, num); return num; } @@ -195,10 +195,9 @@ Buffer[i] = 0; - DPRINTM(DPRINT_FILESYSTEM, "FatGetFirstNameFromPath() Path = %s FirstName = %s\n", Path, Buffer); -} - -#define MAX_FDS 60 + DPRINTM(DPRINT_FILESYSTEM, "FsGetFirstNameFromPath() Path = %s FirstName = %s\n", Path, Buffer); +} + typedef struct tagFILEDATA { ULONG DeviceId; @@ -398,6 +397,8 @@ DEVICE* pNewEntry; ULONG dwLength; + DPRINTM(DPRINT_FILESYSTEM, "FsRegisterDevice() Prefix = %s\n", Prefix); + dwLength = strlen(Prefix) + 1; pNewEntry = MmHeapAlloc(sizeof(DEVICE) + dwLength); if (!pNewEntry) Modified: trunk/reactos/boot/freeldr/freeldr/include/fs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/fs.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/fs.h [iso-8859-1] Tue Sep 22 21:33:34 2009 @@ -57,4 +57,6 @@ ULONG FsGetNumPathParts(PCSTR Path); VOID FsGetFirstNameFromPath(PCHAR Buffer, PCSTR Path); +#define MAX_FDS 60 + #endif // #defined __FS_H
15 years, 3 months
1
0
0
0
[hpoussin] 43113: [freeldr] Accept to read blocks whose size is not a multiple of device sector size
by hpoussin@svn.reactos.org
Author: hpoussin Date: Tue Sep 22 21:32:35 2009 New Revision: 43113 URL:
http://svn.reactos.org/svn/reactos?rev=43113&view=rev
Log: [freeldr] Accept to read blocks whose size is not a multiple of device sector size Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c [iso-8859-1] Tue Sep 22 21:32:35 2009 @@ -2,6 +2,7 @@ * FreeLoader * * Copyright (C) 2003, 2004 Eric Kohl + * Copyright (C) 2009 Hervé Poussineau * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -466,15 +467,16 @@ { DISKCONTEXT* Context = FsGetDeviceSpecific(FileId); UCHAR* Ptr = (UCHAR*)Buffer; - ULONG i; + ULONG i, Length; BOOLEAN ret; *Count = 0; - if (N & (Context->SectorSize - 1)) - return EINVAL; - - for (i = 0; i < N / Context->SectorSize; i++) - { + i = 0; + while (N > 0) + { + Length = N; + if (Length > Context->SectorSize) + Length = Context->SectorSize; ret = MachDiskReadLogicalSectors( Context->DriveNumber, Context->SectorNumber + Context->SectorOffset + i, @@ -482,11 +484,13 @@ (PVOID)DISKREADBUFFER); if (!ret) return EIO; - RtlCopyMemory(Ptr, (PVOID)DISKREADBUFFER, Context->SectorSize); - Ptr += Context->SectorSize; - } - - *Count = N; + RtlCopyMemory(Ptr, (PVOID)DISKREADBUFFER, Length); + Ptr += Length; + *Count += Length; + N -= Length; + i++; + } + return ESUCCESS; }
15 years, 3 months
1
0
0
0
[janderwald] 43112: - Partly implement IBandSite, IMenuBand
by janderwald@svn.reactos.org
Author: janderwald Date: Tue Sep 22 20:30:39 2009 New Revision: 43112 URL:
http://svn.reactos.org/svn/reactos?rev=43112&view=rev
Log: - Partly implement IBandSite, IMenuBand Modified: trunk/reactos/dll/win32/shell32/precomp.h trunk/reactos/dll/win32/shell32/regsvr.c trunk/reactos/dll/win32/shell32/shell32_main.h trunk/reactos/dll/win32/shell32/shellole.c trunk/reactos/dll/win32/shell32/startmenu.c Modified: trunk/reactos/dll/win32/shell32/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/precomp.…
============================================================================== --- trunk/reactos/dll/win32/shell32/precomp.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/precomp.h [iso-8859-1] Tue Sep 22 20:30:39 2009 @@ -68,6 +68,7 @@ extern const GUID CLSID_AdminFolderShortcut; extern const GUID CLSID_FontsFolderShortcut; extern const GUID CLSID_StartMenu; +extern const GUID CLSID_MenuBandSite; extern const GUID CLSID_OpenWith; extern const GUID CLSID_UnixFolder; extern const GUID CLSID_UnixDosFolder; Modified: trunk/reactos/dll/win32/shell32/regsvr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/regsvr.c…
============================================================================== --- trunk/reactos/dll/win32/shell32/regsvr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/regsvr.c [iso-8859-1] Tue Sep 22 20:30:39 2009 @@ -19,8 +19,9 @@ */ #include <precomp.h> -const GUID CLSID_AdminFolderShortcut = {0xD20EA4E1, 0x3957, 0x11D2, {0xA4, 0x0B, 0x0C, 0x50, 0x20, 0x52, 0x41, 0x53} }; +const GUID CLSID_AdminFolderShortcut = {0xD20EA4E1, 0x3957, 0x11D2, {0xA4, 0x0B, 0x0C, 0x50, 0x20, 0x52, 0x41, 0x53}}; const GUID CLSID_StartMenu = {0x4622AD11, 0xFF23, 0x11D0, {0x8D, 0x34, 0x00, 0xA0, 0xC9, 0x0F, 0x27, 0x19}}; +const GUID CLSID_MenuBandSite = {0xE13EF4E4, 0xD2F2, 0x11d0, {0x98, 0x16, 0x00, 0xC0, 0x4F, 0xD9, 0x19, 0x72}}; const GUID CLSID_OpenWith = {0x09799AFB, 0xAD67, 0x11d1, {0xAB, 0xCD, 0x00, 0xC0, 0x4F, 0xC3, 0x09, 0x36}}; const GUID CLSID_UnixFolder = {0xcc702eb2, 0x7dc5, 0x11d9, {0xc6, 0x87, 0x00, 0x04, 0x23, 0x8a, 0x01, 0xcd}}; const GUID CLSID_UnixDosFolder = {0x9d20aae8, 0x0625, 0x44b0, {0x9c, 0xa7, 0x71, 0x88, 0x9c, 0x22, 0x54, 0xd9}}; @@ -720,6 +721,13 @@ "shell32.dll", "Apartment" }, + { &CLSID_MenuBandSite, + "Menu Site", + 0, + NULL, + "shell32.dll", + "Apartment" + }, { NULL } /* list terminator */ }; Modified: trunk/reactos/dll/win32/shell32/shell32_main.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32_…
============================================================================== --- trunk/reactos/dll/win32/shell32/shell32_main.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shell32_main.h [iso-8859-1] Tue Sep 22 20:30:39 2009 @@ -113,6 +113,7 @@ HRESULT WINAPI SHEOW_Constructor(IUnknown * pUnkOuter, REFIID riif, LPVOID *ppv); HRESULT WINAPI ShellFSFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppv); HRESULT WINAPI StartMenu_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppv); +HRESULT WINAPI MenuBandSite_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppv); extern HRESULT CPanel_GetIconLocationW(LPCITEMIDLIST, LPWSTR, UINT, int*); HRESULT WINAPI CPanel_ExtractIconA(LPITEMIDLIST pidl, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize); HRESULT WINAPI CPanel_ExtractIconW(LPITEMIDLIST pidl, LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize); Modified: trunk/reactos/dll/win32/shell32/shellole.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellole…
============================================================================== --- trunk/reactos/dll/win32/shell32/shellole.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shellole.c [iso-8859-1] Tue Sep 22 20:30:39 2009 @@ -61,6 +61,7 @@ {&CLSID_OpenWith, &SHEOW_Constructor}, {&dummy1, &INewItem_Constructor}, {&CLSID_StartMenu, &StartMenu_Constructor}, + {&CLSID_MenuBandSite, &MenuBandSite_Constructor}, {NULL,NULL} }; Modified: trunk/reactos/dll/win32/shell32/startmenu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/startmen…
============================================================================== --- trunk/reactos/dll/win32/shell32/startmenu.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/startmenu.c [iso-8859-1] Tue Sep 22 20:30:39 2009 @@ -26,15 +26,26 @@ const IMenuPopupVtbl *vtbl; const IObjectWithSiteVtbl *objectSiteVtbl; const IInitializeObjectVtbl *initObjectVtbl; - const IBandSiteVtbl *bandSiteVtbl; + const IMenuBandVtbl *menuBandVtbl; IUnknown *pUnkSite; LONG refCount; + IBandSite * pBandSite; } StartMenu, *LPStartMenu; + +typedef struct _tagMenuBandSite { + const IBandSiteVtbl * lpVtbl; + LONG refCount; + + IUnknown ** Objects; + LONG ObjectsCount; + +} MenuBandSite, *LPMenuBandSite; static const IMenuPopupVtbl StartMenuVtbl; static const IObjectWithSiteVtbl StartMenu_ObjectWithSiteVtbl; static const IInitializeObjectVtbl StartMenu_InitializeObjectVtbl; static const IBandSiteVtbl StartMenu_BandSiteVtbl; +static const IMenuBandVtbl StartMenu_MenuBandVtbl; static LPStartMenu __inline impl_from_IMenuPopup(IMenuPopup *iface) { @@ -67,7 +78,7 @@ This->vtbl = &StartMenuVtbl; This->objectSiteVtbl = &StartMenu_ObjectWithSiteVtbl; This->initObjectVtbl = &StartMenu_InitializeObjectVtbl; - This->bandSiteVtbl = &StartMenu_BandSiteVtbl; + This->menuBandVtbl = &StartMenu_MenuBandVtbl; This->refCount = 1; TRACE("StartMenu_Constructor returning %p\n", This); @@ -87,7 +98,7 @@ StartMenu *This = impl_from_IMenuPopup(iface); *ppvOut = NULL; - TRACE("StartMenu_Constructor (%p, %s, %p)\n", iface, debugstr_guid(iid), ppvOut); + TRACE("StartMenu_QueryInterface (%p, %s, %p)\n", iface, debugstr_guid(iid), ppvOut); if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IOleWindow) || IsEqualIID(iid, &IID_IDeskBar) || IsEqualIID(iid, &IID_IMenuPopup)) @@ -102,11 +113,6 @@ { *ppvOut = &This->initObjectVtbl; } - else if (IsEqualIID(iid, &IID_IBandSite)) - { - *ppvOut = &This->bandSiteVtbl; - } - if (*ppvOut) { @@ -159,8 +165,10 @@ static HRESULT WINAPI StartMenu_GetClient(IMenuPopup *iface, IUnknown **ppunkClient) { StartMenu * This = (StartMenu*)iface; + TRACE("StartMenu_GetClient (%p, %p)\n", iface, ppunkClient); - *ppunkClient = (IUnknown*)&This->bandSiteVtbl; + + *ppunkClient = (IUnknown*)This->pBandSite; IUnknown_AddRef(*ppunkClient); return S_OK; } @@ -291,8 +299,15 @@ static HRESULT WINAPI StartMenu_IInitializeObject_Initialize(IInitializeObject *iface) { - FIXME("StartMenu_IInitializeObject_Initialize Stub\n"); - return S_OK; + HRESULT hr; + StartMenu *This = impl_from_IInitializeObject(iface); + TRACE("StartMenu_IInitializeObject_Initialize (%p)\n", iface); + + hr = MenuBandSite_Constructor(NULL, &IID_IBandSite, (LPVOID*)&This->pBandSite); + if (FAILED(hr)) + return hr; + + return IBandSite_AddBand(This->pBandSite, (IUnknown*)&This->menuBandVtbl); } static const IInitializeObjectVtbl StartMenu_InitializeObjectVtbl = @@ -304,71 +319,248 @@ StartMenu_IInitializeObject_Initialize, }; +//-------------------------------------------------------------- +// IMenuBand interface + + +static HRESULT STDMETHODCALLTYPE StartMenu_IMenuBand_QueryInterface(IMenuBand *iface, REFIID iid, LPVOID *ppvOut) +{ + StartMenu *This = (StartMenu*)CONTAINING_RECORD(iface, StartMenu, menuBandVtbl); + + if (IsEqualIID(iid, &IID_IUnknown) || + IsEqualIID(iid, &IID_IMenuBand)) + { + *ppvOut = &This->menuBandVtbl; + IUnknown_AddRef((IUnknown*)*ppvOut); + return S_OK; + } + + WARN("unsupported interface:(%p, %s, %p)\n", iface, debugstr_guid(iid), ppvOut); + return E_NOINTERFACE; +} + +static ULONG STDMETHODCALLTYPE StartMenu_IMenuBand_AddRef(IMenuBand *iface) +{ + StartMenu *This = (StartMenu*)CONTAINING_RECORD(iface, StartMenu, menuBandVtbl); + TRACE("StartMenu_IInitializeObject_AddRef(%p)\n", This); + return StartMenu_AddRef((IMenuPopup *)This); +} + +static ULONG STDMETHODCALLTYPE StartMenu_IMenuBand_Release(IMenuBand *iface) +{ + StartMenu *This = (StartMenu*)CONTAINING_RECORD(iface, StartMenu, menuBandVtbl); + TRACE("StartMenu_IInitializeObject_Release (%p)\n", This); + return StartMenu_Release((IMenuPopup *)This); +} + +HRESULT STDMETHODCALLTYPE StartMenu_IMenuBand_IsMenuMessage(IMenuBand *iface, MSG *pmsg) +{ + StartMenu *This = (StartMenu*)CONTAINING_RECORD(iface, StartMenu, menuBandVtbl); + TRACE("StartMenu_IMenuBand_IsMenuMessage Stub(%p)\n", This); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE StartMenu_IMenuBand_TranslateMenuMessage(IMenuBand *iface, MSG *pmsg, LRESULT *plRet) +{ + StartMenu *This = (StartMenu*)CONTAINING_RECORD(iface, StartMenu, menuBandVtbl); + TRACE("StartMenu_IMenuBand_TranslateMenuMessage Stub(%p)\n", This); + return E_NOTIMPL; +} + + +static const IMenuBandVtbl StartMenu_MenuBandVtbl = +{ + /* IUnknown methods */ + StartMenu_IMenuBand_QueryInterface, + StartMenu_IMenuBand_AddRef, + StartMenu_IMenuBand_Release, + /* IMenuBand methods */ + StartMenu_IMenuBand_IsMenuMessage, + StartMenu_IMenuBand_TranslateMenuMessage, +}; + + //--------------------------------------------------------------------------------------------------------- // IBandSite interface -static HRESULT WINAPI StartMenu_IBandSite_QueryInterface(IBandSite *iface, REFIID iid, LPVOID *ppvOut) -{ - StartMenu *This = (StartMenu*)CONTAINING_RECORD(iface, StartMenu, bandSiteVtbl); - TRACE("StartMenu_IBandSite_QueryInterface(%p, %s, %p)\n", iface, debugstr_guid(iid), ppvOut); - return StartMenu_QueryInterface((IMenuPopup *)This, iid, ppvOut); -} - -static ULONG WINAPI StartMenu_IBandSite_AddRef(IBandSite *iface) -{ - StartMenu *This = (StartMenu*)CONTAINING_RECORD(iface, StartMenu, bandSiteVtbl); - TRACE("StartMenu_IBandSite_AddRef(%p)\n", iface); - return StartMenu_AddRef((IMenuPopup *)This); -} - -static ULONG WINAPI StartMenu_IBandSite_Release(IBandSite *iface) -{ - StartMenu *This = (StartMenu*)CONTAINING_RECORD(iface, StartMenu, bandSiteVtbl); - TRACE("StartMenu_IBandSite_Release (%p)\n", iface); - return StartMenu_Release((IMenuPopup *)This); -} - - -static HRESULT STDMETHODCALLTYPE StartMenu_IBandSite_AddBand(IBandSite *iface, IUnknown *punk) -{ - FIXME("StartMenu_IBandSite_AddBand Stub punk %p\n", punk); + +HRESULT WINAPI MenuBandSite_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv) +{ + MenuBandSite *This; + HRESULT hr; + + TRACE("StartMenu_Constructor(%p, %s, %p)\n", pUnkOuter, debugstr_guid(riid), ppv); + + if (pUnkOuter) + return E_POINTER; + + This = CoTaskMemAlloc(sizeof(MenuBandSite)); + if (!This) + return E_OUTOFMEMORY; + + ZeroMemory(This, sizeof(MenuBandSite)); + This->lpVtbl = &StartMenu_BandSiteVtbl; + + hr = IUnknown_QueryInterface((IUnknown*)&This->lpVtbl, riid, ppv); + + if (FAILED(hr)) + { + CoTaskMemFree(This); + return hr; + } + + TRACE("StartMenu_Constructor returning %p\n", This); + *ppv = (IUnknown *)This; return S_OK; } -static HRESULT STDMETHODCALLTYPE StartMenu_IBandSite_EnumBands(IBandSite *iface, UINT uBand, DWORD *pdwBandID) -{ - FIXME("StartMenu_IBandSite_EnumBands Stub uBand %uu pdwBandID %p\n", uBand, pdwBandID); +static HRESULT WINAPI BandSite_QueryInterface(IBandSite *iface, REFIID iid, LPVOID *ppvOut) +{ + MenuBandSite *This = (MenuBandSite*)CONTAINING_RECORD(iface, MenuBandSite, lpVtbl); + + if (IsEqualIID(iid, &IID_IUnknown) || + IsEqualIID(iid, &IID_IBandSite)) + { + *ppvOut = &This->lpVtbl; + IUnknown_AddRef((IUnknown*)*ppvOut); + return S_OK; + } + + return E_NOINTERFACE; +} + +static ULONG WINAPI BandSite_AddRef(IBandSite *iface) +{ + MenuBandSite *This = (MenuBandSite*)CONTAINING_RECORD(iface, MenuBandSite, lpVtbl); + TRACE("BandSite_AddRef(%p)\n", iface); + return InterlockedIncrement(&This->refCount); +} + +static ULONG WINAPI BandSite_Release(IBandSite *iface) +{ + LONG ret; + MenuBandSite *This = (MenuBandSite*)CONTAINING_RECORD(iface, MenuBandSite, lpVtbl); + + ret = InterlockedDecrement(&This->refCount); + TRACE("BandSite_Release refCount %u\n", ret); + + if (ret == 0) + { + CoTaskMemFree(This->Objects); + CoTaskMemFree(This); + } + + return ret; +} + + +static HRESULT STDMETHODCALLTYPE BandSite_AddBand(IBandSite *iface, IUnknown *punk) +{ + IUnknown ** Objects; + MenuBandSite *This = (MenuBandSite*)CONTAINING_RECORD(iface, MenuBandSite, lpVtbl); + + TRACE("StartMenu_IBandSite_AddBand Stub punk %p\n", punk); + + if (!punk) + return E_FAIL; + + Objects = (IUnknown**) CoTaskMemAlloc(sizeof(IUnknown*) * (This->ObjectsCount + 1)); + if (!Objects) + return E_FAIL; + + RtlMoveMemory(Objects, This->Objects, sizeof(IUnknown*) * This->ObjectsCount); + + CoTaskMemFree(This->Objects); + + This->Objects = Objects; + Objects[This->ObjectsCount] = punk; + + IUnknown_AddRef(punk); + + This->ObjectsCount++; + + + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE BandSite_EnumBands(IBandSite *iface, UINT uBand, DWORD *pdwBandID) +{ + ULONG Index, ObjectCount; + MenuBandSite *This = (MenuBandSite*)CONTAINING_RECORD(iface, MenuBandSite, lpVtbl); + + TRACE("StartMenu_IBandSite_EnumBands Stub uBand %uu pdwBandID %p\n", uBand, pdwBandID); + + if (uBand == (UINT)-1) + return This->ObjectsCount; + + ObjectCount = 0; + + for(Index = 0; Index < This->ObjectsCount; Index++) + { + if (This->Objects[Index] != NULL) + { + if (uBand == ObjectCount) + { + *pdwBandID = Index; + return S_OK; + } + ObjectCount++; + } + } return E_FAIL; } -static HRESULT STDMETHODCALLTYPE StartMenu_IBandSite_QueryBand(IBandSite *iface, DWORD dwBandID, IDeskBand **ppstb, DWORD *pdwState, LPWSTR pszName, int cchName) + +static HRESULT STDMETHODCALLTYPE BandSite_QueryBand(IBandSite *iface, DWORD dwBandID, IDeskBand **ppstb, DWORD *pdwState, LPWSTR pszName, int cchName) { FIXME("StartMenu_IBandSite_QueryBand Stub dwBandID %u IDeskBand %p pdwState %p Name %p cchName %u\n", dwBandID, ppstb, pdwState, pszName, cchName); return E_FAIL; } -static HRESULT STDMETHODCALLTYPE StartMenu_IBandSite_SetBandState(IBandSite *iface, DWORD dwBandID, DWORD dwMask, DWORD dwState) +static HRESULT STDMETHODCALLTYPE BandSite_SetBandState(IBandSite *iface, DWORD dwBandID, DWORD dwMask, DWORD dwState) { FIXME("StartMenu_IBandSite_SetBandState Stub dwBandID %u dwMask %x dwState %u\n", dwBandID, dwMask, dwState); return E_FAIL; } -static HRESULT STDMETHODCALLTYPE StartMenu_IBandSite_RemoveBand(IBandSite *iface, DWORD dwBandID) -{ - FIXME("StartMenu_IBandSite_RemoveBand Stub dwBandID %p\n", dwBandID); +static HRESULT STDMETHODCALLTYPE BandSite_RemoveBand(IBandSite *iface, DWORD dwBandID) +{ + MenuBandSite *This = (MenuBandSite*)CONTAINING_RECORD(iface, MenuBandSite, lpVtbl); + TRACE("StartMenu_IBandSite_RemoveBand Stub dwBandID %u\n", dwBandID); + + if (This->ObjectsCount <= dwBandID) + return E_FAIL; + + if (This->Objects[dwBandID]) + { + This->Objects[dwBandID]->lpVtbl->Release(This->Objects[dwBandID]); + This->Objects[dwBandID] = NULL; + } + + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE BandSite_GetBandObject(IBandSite *iface, DWORD dwBandID, REFIID riid, void **ppv) +{ + MenuBandSite *This = (MenuBandSite*)CONTAINING_RECORD(iface, MenuBandSite, lpVtbl); + + TRACE("StartMenu_IBandSite_GetBandObject Stub dwBandID %u riid %p ppv %p\n", dwBandID, riid, ppv); + + if (This->ObjectsCount <= dwBandID) + return E_FAIL; + + if (This->Objects[dwBandID]) + { + return IUnknown_QueryInterface(This->Objects[dwBandID], riid, ppv); + } + return E_FAIL; } - -static HRESULT STDMETHODCALLTYPE StartMenu_IBandSite_GetBandObject(IBandSite *iface, DWORD dwBandID, REFIID riid, void **ppv) -{ - FIXME("StartMenu_IBandSite_GetBandObject Stub dwBandID %u riid %p ppv %p\n", dwBandID, riid, ppv); - return E_FAIL; -} -static HRESULT STDMETHODCALLTYPE StartMenu_IBandSite_SetBandSiteInfo(IBandSite *iface, const BANDSITEINFO *pbsinfo) +static HRESULT STDMETHODCALLTYPE BandSite_SetBandSiteInfo(IBandSite *iface, const BANDSITEINFO *pbsinfo) { FIXME("StartMenu_IBandSite_SetBandSiteInfo Stub pbsinfo %p\n", pbsinfo); return E_FAIL; } -static HRESULT STDMETHODCALLTYPE StartMenu_IBandSite_GetBandSiteInfo(IBandSite *iface, BANDSITEINFO *pbsinfo) +static HRESULT STDMETHODCALLTYPE BandSite_GetBandSiteInfo(IBandSite *iface, BANDSITEINFO *pbsinfo) { FIXME("StartMenu_IBandSite_GetBandSiteInfo Stub pbsinfo %p\n", pbsinfo); return E_FAIL; @@ -376,16 +568,16 @@ static const IBandSiteVtbl StartMenu_BandSiteVtbl = { - StartMenu_IBandSite_QueryInterface, - StartMenu_IBandSite_AddRef, - StartMenu_IBandSite_Release, - StartMenu_IBandSite_AddBand, - StartMenu_IBandSite_EnumBands, - StartMenu_IBandSite_QueryBand, - StartMenu_IBandSite_SetBandState, - StartMenu_IBandSite_RemoveBand, - StartMenu_IBandSite_GetBandObject, - StartMenu_IBandSite_SetBandSiteInfo, - StartMenu_IBandSite_GetBandSiteInfo + BandSite_QueryInterface, + BandSite_AddRef, + BandSite_Release, + BandSite_AddBand, + BandSite_EnumBands, + BandSite_QueryBand, + BandSite_SetBandState, + BandSite_RemoveBand, + BandSite_GetBandObject, + BandSite_SetBandSiteInfo, + BandSite_GetBandSiteInfo };
15 years, 3 months
1
0
0
0
[janderwald] 43111: - Fix a bug spotted by Timo
by janderwald@svn.reactos.org
Author: janderwald Date: Tue Sep 22 15:54:33 2009 New Revision: 43111 URL:
http://svn.reactos.org/svn/reactos?rev=43111&view=rev
Log: - Fix a bug spotted by Timo Modified: trunk/reactos/drivers/ksfilter/ks/allocators.c Modified: trunk/reactos/drivers/ksfilter/ks/allocators.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/alloca…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/allocators.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/allocators.c [iso-8859-1] Tue Sep 22 15:54:33 2009 @@ -315,7 +315,7 @@ if (Frame) { *OutFrame = Frame; - InterlockedIncrement((PLONG)This->Status.AllocatedFrames); + InterlockedIncrement((PLONG)&This->Status.AllocatedFrames); return STATUS_SUCCESS; }
15 years, 3 months
1
0
0
0
[janderwald] 43110: - Stubplement IBandSite interface
by janderwald@svn.reactos.org
Author: janderwald Date: Tue Sep 22 15:52:54 2009 New Revision: 43110 URL:
http://svn.reactos.org/svn/reactos?rev=43110&view=rev
Log: - Stubplement IBandSite interface Modified: trunk/reactos/dll/win32/shell32/startmenu.c Modified: trunk/reactos/dll/win32/shell32/startmenu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/startmen…
============================================================================== --- trunk/reactos/dll/win32/shell32/startmenu.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/startmenu.c [iso-8859-1] Tue Sep 22 15:52:54 2009 @@ -20,12 +20,13 @@ #include <precomp.h> -WINE_DEFAULT_DEBUG_CHANNEL(shell); +WINE_DEFAULT_DEBUG_CHANNEL(shell32start); typedef struct _tagStartMenu { const IMenuPopupVtbl *vtbl; const IObjectWithSiteVtbl *objectSiteVtbl; const IInitializeObjectVtbl *initObjectVtbl; + const IBandSiteVtbl *bandSiteVtbl; IUnknown *pUnkSite; LONG refCount; } StartMenu, *LPStartMenu; @@ -33,6 +34,7 @@ static const IMenuPopupVtbl StartMenuVtbl; static const IObjectWithSiteVtbl StartMenu_ObjectWithSiteVtbl; static const IInitializeObjectVtbl StartMenu_InitializeObjectVtbl; +static const IBandSiteVtbl StartMenu_BandSiteVtbl; static LPStartMenu __inline impl_from_IMenuPopup(IMenuPopup *iface) { @@ -53,7 +55,7 @@ { StartMenu *This; - TRACE("(%p, %s, %p)\n", pUnkOuter, debugstr_guid(riid), ppv); + TRACE("StartMenu_Constructor(%p, %s, %p)\n", pUnkOuter, debugstr_guid(riid), ppv); if (pUnkOuter) return E_POINTER; @@ -65,9 +67,10 @@ This->vtbl = &StartMenuVtbl; This->objectSiteVtbl = &StartMenu_ObjectWithSiteVtbl; This->initObjectVtbl = &StartMenu_InitializeObjectVtbl; + This->bandSiteVtbl = &StartMenu_BandSiteVtbl; This->refCount = 1; - TRACE("returning %p\n", This); + TRACE("StartMenu_Constructor returning %p\n", This); *ppv = (IUnknown *)This; return S_OK; } @@ -84,7 +87,7 @@ StartMenu *This = impl_from_IMenuPopup(iface); *ppvOut = NULL; - TRACE("(%p, %s, %p)\n", iface, debugstr_guid(iid), ppvOut); + TRACE("StartMenu_Constructor (%p, %s, %p)\n", iface, debugstr_guid(iid), ppvOut); if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IOleWindow) || IsEqualIID(iid, &IID_IDeskBar) || IsEqualIID(iid, &IID_IMenuPopup)) @@ -99,6 +102,11 @@ { *ppvOut = &This->initObjectVtbl; } + else if (IsEqualIID(iid, &IID_IBandSite)) + { + *ppvOut = &This->bandSiteVtbl; + } + if (*ppvOut) { @@ -113,7 +121,7 @@ static ULONG WINAPI StartMenu_AddRef(IMenuPopup *iface) { StartMenu *This = impl_from_IMenuPopup(iface); - TRACE("(%p)\n", iface); + TRACE("StartMenu_AddRef(%p)\n", iface); return InterlockedIncrement(&This->refCount); } @@ -122,7 +130,7 @@ StartMenu *This = impl_from_IMenuPopup(iface); ULONG ret; - TRACE("(%p)\n", iface); + TRACE("StartMenu_Release(%p)\n", iface); ret = InterlockedDecrement(&This->refCount); if (ret == 0) @@ -150,8 +158,11 @@ static HRESULT WINAPI StartMenu_GetClient(IMenuPopup *iface, IUnknown **ppunkClient) { - FIXME("(%p, %p)\n", iface, ppunkClient); - return E_NOTIMPL; + StartMenu * This = (StartMenu*)iface; + TRACE("StartMenu_GetClient (%p, %p)\n", iface, ppunkClient); + *ppunkClient = (IUnknown*)&This->bandSiteVtbl; + IUnknown_AddRef(*ppunkClient); + return S_OK; } static HRESULT WINAPI StartMenu_OnPosRectChangeDB(IMenuPopup *iface, LPRECT prc) @@ -180,17 +191,21 @@ static const IMenuPopupVtbl StartMenuVtbl = { + /* IUnknown */ StartMenu_QueryInterface, StartMenu_AddRef, StartMenu_Release, + /* IOleWindow */ StartMenu_GetWindow, StartMenu_ContextSensitiveHelp, + /* IDeskBar */ StartMenu_SetClient, StartMenu_GetClient, StartMenu_OnPosRectChangeDB, + /* IMenuPopup */ StartMenu_Popup, StartMenu_OnSelect, StartMenu_SetSubMenu, @@ -213,7 +228,7 @@ static ULONG WINAPI StartMenu_IObjectWithSite_Release(IObjectWithSite *iface) { StartMenu *This = impl_from_IObjectWithSite(iface); - TRACE("(%p)\n", iface); + TRACE("StartMenu_IObjectWithSite_Release (%p)\n", iface); return StartMenu_Release((IMenuPopup *)This); } @@ -221,7 +236,7 @@ { StartMenu *This = impl_from_IObjectWithSite(iface); - TRACE("(%p, %p)\n", iface, pUnkSite); + TRACE("StartMenu_IObjectWithSite_SetSite(%p, %p)\n", iface, pUnkSite); if (This->pUnkSite) IUnknown_Release(This->pUnkSite); @@ -263,20 +278,20 @@ static ULONG WINAPI StartMenu_IInitializeObject_AddRef(IInitializeObject *iface) { StartMenu *This = impl_from_IInitializeObject(iface); - TRACE("(%p)\n", iface); + TRACE("StartMenu_IInitializeObject_AddRef(%p)\n", iface); return StartMenu_AddRef((IMenuPopup *)This); } static ULONG WINAPI StartMenu_IInitializeObject_Release(IInitializeObject *iface) { StartMenu *This = impl_from_IInitializeObject(iface); - TRACE("(%p)\n", iface); + TRACE("StartMenu_IInitializeObject_Release (%p)\n", iface); return StartMenu_Release((IMenuPopup *)This); } static HRESULT WINAPI StartMenu_IInitializeObject_Initialize(IInitializeObject *iface) { - FIXME("Stub\n"); + FIXME("StartMenu_IInitializeObject_Initialize Stub\n"); return S_OK; } @@ -288,3 +303,89 @@ StartMenu_IInitializeObject_Initialize, }; + +//--------------------------------------------------------------------------------------------------------- +// IBandSite interface + +static HRESULT WINAPI StartMenu_IBandSite_QueryInterface(IBandSite *iface, REFIID iid, LPVOID *ppvOut) +{ + StartMenu *This = (StartMenu*)CONTAINING_RECORD(iface, StartMenu, bandSiteVtbl); + TRACE("StartMenu_IBandSite_QueryInterface(%p, %s, %p)\n", iface, debugstr_guid(iid), ppvOut); + return StartMenu_QueryInterface((IMenuPopup *)This, iid, ppvOut); +} + +static ULONG WINAPI StartMenu_IBandSite_AddRef(IBandSite *iface) +{ + StartMenu *This = (StartMenu*)CONTAINING_RECORD(iface, StartMenu, bandSiteVtbl); + TRACE("StartMenu_IBandSite_AddRef(%p)\n", iface); + return StartMenu_AddRef((IMenuPopup *)This); +} + +static ULONG WINAPI StartMenu_IBandSite_Release(IBandSite *iface) +{ + StartMenu *This = (StartMenu*)CONTAINING_RECORD(iface, StartMenu, bandSiteVtbl); + TRACE("StartMenu_IBandSite_Release (%p)\n", iface); + return StartMenu_Release((IMenuPopup *)This); +} + + +static HRESULT STDMETHODCALLTYPE StartMenu_IBandSite_AddBand(IBandSite *iface, IUnknown *punk) +{ + FIXME("StartMenu_IBandSite_AddBand Stub punk %p\n", punk); + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE StartMenu_IBandSite_EnumBands(IBandSite *iface, UINT uBand, DWORD *pdwBandID) +{ + FIXME("StartMenu_IBandSite_EnumBands Stub uBand %uu pdwBandID %p\n", uBand, pdwBandID); + return E_FAIL; +} +static HRESULT STDMETHODCALLTYPE StartMenu_IBandSite_QueryBand(IBandSite *iface, DWORD dwBandID, IDeskBand **ppstb, DWORD *pdwState, LPWSTR pszName, int cchName) +{ + FIXME("StartMenu_IBandSite_QueryBand Stub dwBandID %u IDeskBand %p pdwState %p Name %p cchName %u\n", dwBandID, ppstb, pdwState, pszName, cchName); + return E_FAIL; +} + +static HRESULT STDMETHODCALLTYPE StartMenu_IBandSite_SetBandState(IBandSite *iface, DWORD dwBandID, DWORD dwMask, DWORD dwState) +{ + FIXME("StartMenu_IBandSite_SetBandState Stub dwBandID %u dwMask %x dwState %u\n", dwBandID, dwMask, dwState); + return E_FAIL; +} +static HRESULT STDMETHODCALLTYPE StartMenu_IBandSite_RemoveBand(IBandSite *iface, DWORD dwBandID) +{ + FIXME("StartMenu_IBandSite_RemoveBand Stub dwBandID %p\n", dwBandID); + return E_FAIL; +} + +static HRESULT STDMETHODCALLTYPE StartMenu_IBandSite_GetBandObject(IBandSite *iface, DWORD dwBandID, REFIID riid, void **ppv) +{ + FIXME("StartMenu_IBandSite_GetBandObject Stub dwBandID %u riid %p ppv %p\n", dwBandID, riid, ppv); + return E_FAIL; +} +static HRESULT STDMETHODCALLTYPE StartMenu_IBandSite_SetBandSiteInfo(IBandSite *iface, const BANDSITEINFO *pbsinfo) +{ + FIXME("StartMenu_IBandSite_SetBandSiteInfo Stub pbsinfo %p\n", pbsinfo); + return E_FAIL; + +} +static HRESULT STDMETHODCALLTYPE StartMenu_IBandSite_GetBandSiteInfo(IBandSite *iface, BANDSITEINFO *pbsinfo) +{ + FIXME("StartMenu_IBandSite_GetBandSiteInfo Stub pbsinfo %p\n", pbsinfo); + return E_FAIL; +} + +static const IBandSiteVtbl StartMenu_BandSiteVtbl = +{ + StartMenu_IBandSite_QueryInterface, + StartMenu_IBandSite_AddRef, + StartMenu_IBandSite_Release, + StartMenu_IBandSite_AddBand, + StartMenu_IBandSite_EnumBands, + StartMenu_IBandSite_QueryBand, + StartMenu_IBandSite_SetBandState, + StartMenu_IBandSite_RemoveBand, + StartMenu_IBandSite_GetBandObject, + StartMenu_IBandSite_SetBandSiteInfo, + StartMenu_IBandSite_GetBandSiteInfo +}; +
15 years, 3 months
1
0
0
0
[khornicek] 43109: - don't return false on success
by khornicek@svn.reactos.org
Author: khornicek Date: Tue Sep 22 12:29:27 2009 New Revision: 43109 URL:
http://svn.reactos.org/svn/reactos?rev=43109&view=rev
Log: - don't return false on success Modified: trunk/reactos/subsystems/win32/win32k/objects/text.c Modified: trunk/reactos/subsystems/win32/win32k/objects/text.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/text.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/text.c [iso-8859-1] Tue Sep 22 12:29:27 2009 @@ -176,6 +176,8 @@ SetLastNtError(Status); return FALSE; } + + return TRUE; } } return FALSE;
15 years, 3 months
1
0
0
0
[sginsberg] 43108: - Use __writeeflags instead of clc to clear the carry flag.
by sginsberg@svn.reactos.org
Author: sginsberg Date: Tue Sep 22 00:08:44 2009 New Revision: 43108 URL:
http://svn.reactos.org/svn/reactos?rev=43108&view=rev
Log: - Use __writeeflags instead of clc to clear the carry flag. Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/pcrtc.c Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/pcrtc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/pcrtc.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/pcrtc.c [iso-8859-1] Tue Sep 22 00:08:44 2009 @@ -19,19 +19,6 @@ #include <freeldr.h> -FORCEINLINE -VOID -ClearCarryFlag(VOID) -{ -#if defined(__GNUC__) - __asm__ ("clc"); -#elif defined(_MSC_VER) - __asm clc; -#else -#error -#endif -} - #define BCD_INT(bcd) (((bcd & 0xf0) >> 4) * 10 + (bcd &0x0f)) TIMEINFO* @@ -44,7 +31,7 @@ * in the Compaq Deskpro EP/SB, leave CF unchanged * if successful, so CF should be cleared before * calling this function. */ - ClearCarryFlag(); + __writeeflags(__readeflags() & ~EFLAGS_CF); /* Int 1Ah AH=04h * TIME - GET REAL-TIME CLOCK DATE (AT,XT286,PS) @@ -68,7 +55,7 @@ /* Some BIOSes leave CF unchanged if successful, * so CF should be cleared before calling this function. */ - ClearCarryFlag(); + __writeeflags(__readeflags() & ~EFLAGS_CF); /* Int 1Ah AH=02h * TIME - GET REAL-TIME CLOCK TIME (AT,XT286,PS)
15 years, 3 months
1
0
0
0
[janderwald] 43107: - Fix up-down control spinning See issue #3390 for more details.
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Sep 21 21:31:19 2009 New Revision: 43107 URL:
http://svn.reactos.org/svn/reactos?rev=43107&view=rev
Log: - Fix up-down control spinning See issue #3390 for more details. Modified: trunk/reactos/dll/cpl/sysdm/hardprof.c Modified: trunk/reactos/dll/cpl/sysdm/hardprof.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/hardprof.c?r…
============================================================================== --- trunk/reactos/dll/cpl/sysdm/hardprof.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/sysdm/hardprof.c [iso-8859-1] Mon Sep 21 21:31:19 2009 @@ -56,6 +56,9 @@ SendMessage(GetDlgItem(hwndDlg, IDC_HRDPROFDWN), BM_SETIMAGE,(WPARAM)IMAGE_ICON, (LPARAM)(HANDLE)LoadIcon(hApplet, MAKEINTRESOURCE(IDI_DOWN))); + + SendDlgItemMessageW(hwndDlg, IDC_HRDPROFUPDWN, UDM_SETRANGE, (WPARAM) 0, (LPARAM) MAKELONG((short) 500, 0)); + //SendDlgItemMessageW(hwndDlg, IDC_HRDPROFUPDWN, UDM_SETPOS, (WPARAM) 0, (LPARAM) MAKELONG((short) 30, 0)); } break;
15 years, 3 months
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
27
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
Results per page:
10
25
50
100
200