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
2025
January
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
April 2009
----- 2025 -----
January 2025
----- 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
25 participants
476 discussions
Start a n
N
ew thread
[tkreuzer] 40757: merge 37282 from amd64-branch: Give rsym it's own directory (Timo Kreuzer)
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri May 1 03:26:02 2009 New Revision: 40757 URL:
http://svn.reactos.org/svn/reactos?rev=40757&view=rev
Log: merge 37282 from amd64-branch: Give rsym it's own directory (Timo Kreuzer) Added: trunk/reactos/tools/rsym/ (props changed) - copied from r37282, branches/ros-amd64-bringup/reactos/tools/rsym/ Removed: trunk/reactos/tools/rsym.c trunk/reactos/tools/rsym.h trunk/reactos/tools/rsym.mak trunk/reactos/tools/rsym_common.c Modified: trunk/reactos/tools/rsym/rsym.c trunk/reactos/tools/tools.mak Propchange: trunk/reactos/tools/rsym/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Fri May 1 03:26:02 2009 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/tools/rsym/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/tools/rsym/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/tools/rsym/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Removed: trunk/reactos/tools/rsym.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rsym.c?rev=40756&vie…
============================================================================== --- trunk/reactos/tools/rsym.c [iso-8859-1] (original) +++ trunk/reactos/tools/rsym.c (removed) @@ -1,985 +1,0 @@ -/* - * Usage: rsym input-file output-file - * - * There are two sources of information: the .stab/.stabstr - * sections of the executable and the COFF symbol table. Most - * of the information is in the .stab/.stabstr sections. - * However, most of our asm files don't contain .stab directives, - * so routines implemented in assembler won't show up in the - * .stab section. They are present in the COFF symbol table. - * So, we mostly use the .stab/.stabstr sections, but we augment - * the info there with info from the COFF symbol table when - * possible. - * - * This is a tool and is compiled using the host compiler, - * i.e. on Linux gcc and not mingw-gcc (cross-compiler). - * Therefore we can't include SDK headers and we have to - * duplicate some definitions here. - * Also note that the internal functions are "old C-style", - * returning an int, where a return of 0 means success and - * non-zero is failure. - */ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <assert.h> - -#include "rsym.h" - -static int -CompareSymEntry(const PROSSYM_ENTRY SymEntry1, const PROSSYM_ENTRY SymEntry2) -{ - if (SymEntry1->Address < SymEntry2->Address) - { - return -1; - } - - if (SymEntry2->Address < SymEntry1->Address) - { - return +1; - } - - return 0; -} - -static int -GetStabInfo(void *FileData, PIMAGE_FILE_HEADER PEFileHeader, - PIMAGE_SECTION_HEADER PESectionHeaders, - ULONG *StabSymbolsLength, void **StabSymbolsBase, - ULONG *StabStringsLength, void **StabStringsBase) -{ - ULONG Idx; - - /* Load .stab and .stabstr sections if available */ - *StabSymbolsBase = NULL; - *StabSymbolsLength = 0; - *StabStringsBase = NULL; - *StabStringsLength = 0; - - for (Idx = 0; Idx < PEFileHeader->NumberOfSections; Idx++) - { - /* printf("section: '%.08s'\n", PESectionHeaders[Idx].Name); */ - if ((strncmp((char*)PESectionHeaders[Idx].Name, ".stab", 5) == 0) - && (PESectionHeaders[Idx].Name[5] == 0)) - { - /* printf(".stab section found. Size %d\n", - PESectionHeaders[Idx].SizeOfRawData); */ - - *StabSymbolsLength = PESectionHeaders[Idx].SizeOfRawData; - *StabSymbolsBase = (void *)((char *) FileData + PESectionHeaders[Idx].PointerToRawData); - } - - if (strncmp((char*)PESectionHeaders[Idx].Name, ".stabstr", 8) == 0) - { - /* printf(".stabstr section found. Size %d\n", - PESectionHeaders[Idx].SizeOfRawData); */ - - *StabStringsLength = PESectionHeaders[Idx].SizeOfRawData; - *StabStringsBase = (void *)((char *) FileData + PESectionHeaders[Idx].PointerToRawData); - } - } - - return 0; -} - -static int -GetCoffInfo(void *FileData, PIMAGE_FILE_HEADER PEFileHeader, - PIMAGE_SECTION_HEADER PESectionHeaders, - ULONG *CoffSymbolsLength, void **CoffSymbolsBase, - ULONG *CoffStringsLength, void **CoffStringsBase) -{ - - if (0 == PEFileHeader->PointerToSymbolTable || 0 == PEFileHeader->NumberOfSymbols) - { - /* No COFF symbol table */ - *CoffSymbolsLength = 0; - *CoffStringsLength = 0; - } - else - { - *CoffSymbolsLength = PEFileHeader->NumberOfSymbols * sizeof(COFF_SYMENT); - *CoffSymbolsBase = (void *)((char *) FileData + PEFileHeader->PointerToSymbolTable); - *CoffStringsLength = *((ULONG *) ((char *) *CoffSymbolsBase + *CoffSymbolsLength)); - *CoffStringsBase = (void *)((char *) *CoffSymbolsBase + *CoffSymbolsLength); - } - - return 0; -} - -static ULONG -FindOrAddString(char *StringToFind, ULONG *StringsLength, void *StringsBase) -{ - char *Search, *End; - - Search = (char *) StringsBase; - End = Search + *StringsLength; - - while (Search < End) - { - if (0 == strcmp(Search, StringToFind)) - { - return Search - (char *) StringsBase; - } - Search += strlen(Search) + 1; - } - - strcpy(Search, StringToFind); - *StringsLength += strlen(StringToFind) + 1; - - return Search - (char *) StringsBase; -} - -static int -ConvertStabs(ULONG *SymbolsCount, PROSSYM_ENTRY *SymbolsBase, - ULONG *StringsLength, void *StringsBase, - ULONG StabSymbolsLength, void *StabSymbolsBase, - ULONG StabStringsLength, void *StabStringsBase, - ULONG_PTR ImageBase, PIMAGE_FILE_HEADER PEFileHeader, - PIMAGE_SECTION_HEADER PESectionHeaders) -{ - PSTAB_ENTRY StabEntry; - ULONG Count, i; - ULONG_PTR Address, LastFunctionAddress; - int First = 1; - char *Name; - ULONG NameLen; - char FuncName[256]; - PROSSYM_ENTRY Current; - - StabEntry = StabSymbolsBase; - Count = StabSymbolsLength / sizeof(STAB_ENTRY); - *SymbolsCount = 0; - if (Count == 0) - { - /* No symbol info */ - *SymbolsBase = NULL; - return 0; - } - - *SymbolsBase = malloc(Count * sizeof(ROSSYM_ENTRY)); - if (NULL == *SymbolsBase) - { - fprintf(stderr, "Failed to allocate memory for converted .stab symbols\n"); - return 1; - } - Current = *SymbolsBase; - memset ( Current, 0, sizeof(*Current) ); - - LastFunctionAddress = 0; - for (i = 0; i < Count; i++) - { - if ( 0 == LastFunctionAddress ) - { - Address = StabEntry[i].n_value - ImageBase; - } - else - { - Address = LastFunctionAddress + StabEntry[i].n_value; - } - switch (StabEntry[i].n_type) - { - case N_SO: - case N_SOL: - case N_BINCL: - Name = (char *) StabStringsBase + StabEntry[i].n_strx; - if (StabStringsLength < StabEntry[i].n_strx - ||'\0' == *Name || '/' == Name[strlen(Name) - 1] - || '\\' == Name[strlen(Name) - 1] - || StabEntry[i].n_value < ImageBase) - { - continue; - } - if ( First || Address != Current->Address ) - { - if ( !First ) - { - memset ( ++Current, 0, sizeof(*Current) ); - Current->FunctionOffset = Current[-1].FunctionOffset; - } - else - First = 0; - Current->Address = Address; - } - Current->FileOffset = FindOrAddString((char *)StabStringsBase - + StabEntry[i].n_strx, - StringsLength, - StringsBase); - break; - case N_FUN: - if (0 == StabEntry[i].n_desc || StabEntry[i].n_value < ImageBase) - { - LastFunctionAddress = 0; /* line # 0 = end of function */ - continue; - } - if ( First || Address != Current->Address ) - { - if ( !First ) - memset ( ++Current, 0, sizeof(*Current) ); - else - First = 0; - Current->Address = Address; - Current->FileOffset = Current[-1].FileOffset; - } - Name = (char *) StabStringsBase + StabEntry[i].n_strx; - NameLen = strcspn(Name, ":"); - if (sizeof(FuncName) <= NameLen) - { - free(*SymbolsBase); - fprintf(stderr, "Function name too long\n"); - return 1; - } - memcpy(FuncName, Name, NameLen); - FuncName[NameLen] = '\0'; - Current->FunctionOffset = FindOrAddString(FuncName, - StringsLength, - StringsBase); - Current->SourceLine = 0; - LastFunctionAddress = Address; - break; - case N_SLINE: - if ( First || Address != Current->Address ) - { - if ( !First ) - { - memset ( ++Current, 0, sizeof(*Current) ); - Current->FileOffset = Current[-1].FileOffset; - Current->FunctionOffset = Current[-1].FunctionOffset; - } - else - First = 0; - Current->Address = Address; - } - Current->SourceLine = StabEntry[i].n_desc; - break; - default: - continue; - } - } - *SymbolsCount = (Current - *SymbolsBase + 1); - - qsort(*SymbolsBase, *SymbolsCount, sizeof(ROSSYM_ENTRY), (int (*)(const void *, const void *)) CompareSymEntry); - - return 0; -} - -static int -ConvertCoffs(ULONG *SymbolsCount, PROSSYM_ENTRY *SymbolsBase, - ULONG *StringsLength, void *StringsBase, - ULONG CoffSymbolsLength, void *CoffSymbolsBase, - ULONG CoffStringsLength, void *CoffStringsBase, - ULONG_PTR ImageBase, PIMAGE_FILE_HEADER PEFileHeader, - PIMAGE_SECTION_HEADER PESectionHeaders) -{ - ULONG Count, i; - PCOFF_SYMENT CoffEntry; - char FuncName[256]; - char *p; - PROSSYM_ENTRY Current; - - CoffEntry = (PCOFF_SYMENT) CoffSymbolsBase; - Count = CoffSymbolsLength / sizeof(COFF_SYMENT); - *SymbolsBase = malloc(Count * sizeof(ROSSYM_ENTRY)); - if (NULL == *SymbolsBase) - { - fprintf(stderr, "Unable to allocate memory for converted COFF symbols\n"); - return 1; - } - *SymbolsCount = 0; - Current = *SymbolsBase; - - for (i = 0; i < Count; i++) - { - if (ISFCN(CoffEntry[i].e_type) || C_EXT == CoffEntry[i].e_sclass) - { - Current->Address = CoffEntry[i].e_value; - if (0 < CoffEntry[i].e_scnum) - { - if (PEFileHeader->NumberOfSections < CoffEntry[i].e_scnum) - { - free(*SymbolsBase); - fprintf(stderr, "Invalid section number %d in COFF symbols (only %d sections present)\n", - CoffEntry[i].e_scnum, PEFileHeader->NumberOfSections); - return 1; - } - Current->Address += PESectionHeaders[CoffEntry[i].e_scnum - 1].VirtualAddress; - } - Current->FileOffset = 0; - if (0 == CoffEntry[i].e.e.e_zeroes) - { - if (sizeof(FuncName) <= strlen((char *) CoffStringsBase + CoffEntry[i].e.e.e_offset)) - { - free(*SymbolsBase); - fprintf(stderr, "Function name too long\n"); - return 1; - } - strcpy(FuncName, (char *) CoffStringsBase + CoffEntry[i].e.e.e_offset); - } - else - { - memcpy(FuncName, CoffEntry[i].e.e_name, E_SYMNMLEN); - FuncName[E_SYMNMLEN] = '\0'; - } - - /* Name demangling: stdcall */ - p = strrchr(FuncName, '@'); - if (NULL != p) - { - *p = '\0'; - } - p = ('_' == FuncName[0] || '@' == FuncName[0] ? FuncName + 1 : FuncName); - Current->FunctionOffset = FindOrAddString(p, - StringsLength, - StringsBase); - Current->SourceLine = 0; - memset ( ++Current, 0, sizeof(*Current) ); - } - i += CoffEntry[i].e_numaux; - } - - *SymbolsCount = (Current - *SymbolsBase + 1); - qsort(*SymbolsBase, *SymbolsCount, sizeof(ROSSYM_ENTRY), (int (*)(const void *, const void *)) CompareSymEntry); - - return 0; -} - -static int -MergeStabsAndCoffs(ULONG *MergedSymbolCount, PROSSYM_ENTRY *MergedSymbols, - ULONG StabSymbolsCount, PROSSYM_ENTRY StabSymbols, - ULONG CoffSymbolsCount, PROSSYM_ENTRY CoffSymbols) -{ - ULONG StabIndex, j; - ULONG CoffIndex; - ULONG_PTR StabFunctionStartAddress; - ULONG StabFunctionStringOffset, NewStabFunctionStringOffset; - - *MergedSymbolCount = 0; - if (StabSymbolsCount == 0) - { - *MergedSymbols = NULL; - return 0; - } - *MergedSymbols = malloc(StabSymbolsCount * sizeof(ROSSYM_ENTRY)); - if (NULL == *MergedSymbols) - { - fprintf(stderr, "Unable to allocate memory for merged symbols\n"); - return 1; - } - - StabFunctionStartAddress = 0; - StabFunctionStringOffset = 0; - CoffIndex = 0; - for (StabIndex = 0; StabIndex < StabSymbolsCount; StabIndex++) - { - (*MergedSymbols)[*MergedSymbolCount] = StabSymbols[StabIndex]; - for (j = StabIndex + 1; - j < StabSymbolsCount && StabSymbols[j].Address == StabSymbols[StabIndex].Address; - j++) - { - if (0 != StabSymbols[j].FileOffset && 0 == (*MergedSymbols)[*MergedSymbolCount].FileOffset) - { - (*MergedSymbols)[*MergedSymbolCount].FileOffset = StabSymbols[j].FileOffset; - } - if (0 != StabSymbols[j].FunctionOffset && 0 == (*MergedSymbols)[*MergedSymbolCount].FunctionOffset) - { - (*MergedSymbols)[*MergedSymbolCount].FunctionOffset = StabSymbols[j].FunctionOffset; - } - if (0 != StabSymbols[j].SourceLine && 0 == (*MergedSymbols)[*MergedSymbolCount].SourceLine) - { - (*MergedSymbols)[*MergedSymbolCount].SourceLine = StabSymbols[j].SourceLine; - } - } - StabIndex = j - 1; - while (CoffIndex < CoffSymbolsCount - && CoffSymbols[CoffIndex + 1].Address <= (*MergedSymbols)[*MergedSymbolCount].Address) - { - CoffIndex++; - } - NewStabFunctionStringOffset = (*MergedSymbols)[*MergedSymbolCount].FunctionOffset; - if (CoffSymbolsCount > 0 && - CoffSymbols[CoffIndex].Address < (*MergedSymbols)[*MergedSymbolCount].Address - && StabFunctionStartAddress < CoffSymbols[CoffIndex].Address - && 0 != CoffSymbols[CoffIndex].FunctionOffset) - { - (*MergedSymbols)[*MergedSymbolCount].FunctionOffset = CoffSymbols[CoffIndex].FunctionOffset; - } - if (StabFunctionStringOffset != NewStabFunctionStringOffset) - { - StabFunctionStartAddress = (*MergedSymbols)[*MergedSymbolCount].Address; - } - StabFunctionStringOffset = NewStabFunctionStringOffset; - (*MergedSymbolCount)++; - } - - return 0; -} - -static PIMAGE_SECTION_HEADER -FindSectionForRVA(DWORD RVA, unsigned NumberOfSections, PIMAGE_SECTION_HEADER SectionHeaders) -{ - unsigned Section; - - for (Section = 0; Section < NumberOfSections; Section++) - { - if (SectionHeaders[Section].VirtualAddress <= RVA && - RVA < SectionHeaders[Section].VirtualAddress + SectionHeaders[Section].Misc.VirtualSize) - { - return SectionHeaders + Section; - } - } - - return NULL; -} - -static int -IncludeRelocationsForSection(PIMAGE_SECTION_HEADER SectionHeader) -{ - static char *BlacklistedSections[] = - { - ".edata", - ".idata", - ".reloc" - }; - char SectionName[IMAGE_SIZEOF_SHORT_NAME]; - unsigned i; - - if (0 != (SectionHeader->Characteristics & IMAGE_SCN_LNK_REMOVE)) - { - return 0; - } - - for (i = 0; i < sizeof(BlacklistedSections) / sizeof(BlacklistedSections[0]); i++) - { - strncpy(SectionName, BlacklistedSections[i], IMAGE_SIZEOF_SHORT_NAME); - if (0 == memcmp(SectionName, SectionHeader->Name, IMAGE_SIZEOF_SHORT_NAME)) - { - return 0; - } - } - - return 1; -} - -static int -ProcessRelocations(ULONG *ProcessedRelocsLength, void **ProcessedRelocs, - void *RawData, PIMAGE_OPTIONAL_HEADER OptHeader, - unsigned NumberOfSections, PIMAGE_SECTION_HEADER SectionHeaders) -{ - PIMAGE_SECTION_HEADER RelocSectionHeader, TargetSectionHeader; - PIMAGE_BASE_RELOCATION BaseReloc, End, AcceptedRelocs; - int Found; - - if (OptHeader->NumberOfRvaAndSizes < IMAGE_DIRECTORY_ENTRY_BASERELOC - || 0 == OptHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress) - { - /* No relocation entries */ - *ProcessedRelocsLength = 0; - *ProcessedRelocs = NULL; - return 0; - } - - RelocSectionHeader = FindSectionForRVA(OptHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress, - NumberOfSections, SectionHeaders); - if (NULL == RelocSectionHeader) - { - fprintf(stderr, "Can't find section header for relocation data\n"); - return 1; - } - - *ProcessedRelocs = malloc(RelocSectionHeader->SizeOfRawData); - if (NULL == *ProcessedRelocs) - { - fprintf(stderr, "Failed to allocate %u bytes for relocations\n", (unsigned int)RelocSectionHeader->SizeOfRawData); - return 1; - } - *ProcessedRelocsLength = 0; - - BaseReloc = (PIMAGE_BASE_RELOCATION) ((char *) RawData - + RelocSectionHeader->PointerToRawData - + (OptHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress - - RelocSectionHeader->VirtualAddress)); - End = (PIMAGE_BASE_RELOCATION) ((char *) BaseReloc - + OptHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].Size); - - while (BaseReloc < End && 0 < BaseReloc->SizeOfBlock) - { - TargetSectionHeader = FindSectionForRVA(BaseReloc->VirtualAddress, NumberOfSections, - SectionHeaders); - if (NULL != TargetSectionHeader && IncludeRelocationsForSection(TargetSectionHeader)) - { - AcceptedRelocs = *ProcessedRelocs; - Found = 0; - while (AcceptedRelocs < (PIMAGE_BASE_RELOCATION) ((char *) *ProcessedRelocs + - *ProcessedRelocsLength) - && ! Found) - { - Found = BaseReloc->SizeOfBlock == AcceptedRelocs->SizeOfBlock - && 0 == memcmp(BaseReloc, AcceptedRelocs, AcceptedRelocs->SizeOfBlock); - AcceptedRelocs= (PIMAGE_BASE_RELOCATION) ((char *) AcceptedRelocs + - AcceptedRelocs->SizeOfBlock); - } - if (! Found) - { - memcpy((char *) *ProcessedRelocs + *ProcessedRelocsLength, - BaseReloc, BaseReloc->SizeOfBlock); - *ProcessedRelocsLength += BaseReloc->SizeOfBlock; - } - } - BaseReloc = (PIMAGE_BASE_RELOCATION)((char *) BaseReloc + BaseReloc->SizeOfBlock); - } - - return 0; -} - -static int -CreateOutputFile(FILE *OutFile, void *InData, - PIMAGE_DOS_HEADER InDosHeader, PIMAGE_FILE_HEADER InFileHeader, - PIMAGE_OPTIONAL_HEADER InOptHeader, PIMAGE_SECTION_HEADER InSectionHeaders, - ULONG RosSymLength, void *RosSymSection) -{ - ULONG StartOfRawData; - unsigned Section; - void *OutHeader, *ProcessedRelocs, *PaddedRosSym, *Data; - PIMAGE_DOS_HEADER OutDosHeader; - PIMAGE_FILE_HEADER OutFileHeader; - PIMAGE_OPTIONAL_HEADER OutOptHeader; - PIMAGE_SECTION_HEADER OutSectionHeaders, CurrentSectionHeader; - DWORD CheckSum; - ULONG Length, i; - ULONG ProcessedRelocsLength; - ULONG RosSymOffset, RosSymFileLength; - int InRelocSectionIndex; - PIMAGE_SECTION_HEADER OutRelocSection; - - StartOfRawData = 0; - for (Section = 0; Section < InFileHeader->NumberOfSections; Section++) - { - if ((0 == StartOfRawData - || InSectionHeaders[Section].PointerToRawData < StartOfRawData) - && 0 != InSectionHeaders[Section].PointerToRawData - && 0 == (InSectionHeaders[Section].Characteristics & IMAGE_SCN_LNK_REMOVE)) - { - StartOfRawData = InSectionHeaders[Section].PointerToRawData; - } - } - OutHeader = malloc(StartOfRawData); - if (NULL == OutHeader) - { - fprintf(stderr, "Failed to allocate %u bytes for output file header\n", (unsigned int)StartOfRawData); - return 1; - } - memset(OutHeader, '\0', StartOfRawData); - - OutDosHeader = (PIMAGE_DOS_HEADER) OutHeader; - memcpy(OutDosHeader, InDosHeader, InDosHeader->e_lfanew + sizeof(ULONG)); - - OutFileHeader = (PIMAGE_FILE_HEADER)((char *) OutHeader + OutDosHeader->e_lfanew + sizeof(ULONG)); - memcpy(OutFileHeader, InFileHeader, sizeof(IMAGE_FILE_HEADER)); - OutFileHeader->PointerToSymbolTable = 0; - OutFileHeader->NumberOfSymbols = 0; - OutFileHeader->Characteristics &= ~(IMAGE_FILE_LINE_NUMS_STRIPPED | IMAGE_FILE_LOCAL_SYMS_STRIPPED | - IMAGE_FILE_DEBUG_STRIPPED); - - OutOptHeader = (PIMAGE_OPTIONAL_HEADER)(OutFileHeader + 1); - memcpy(OutOptHeader, InOptHeader, sizeof(IMAGE_OPTIONAL_HEADER)); - OutOptHeader->CheckSum = 0; - - OutSectionHeaders = (PIMAGE_SECTION_HEADER)((char *) OutOptHeader + OutFileHeader->SizeOfOptionalHeader); - - if (ProcessRelocations(&ProcessedRelocsLength, &ProcessedRelocs, InData, InOptHeader, - InFileHeader->NumberOfSections, InSectionHeaders)) - { - return 1; - } - if (InOptHeader->NumberOfRvaAndSizes < IMAGE_DIRECTORY_ENTRY_BASERELOC - || 0 == InOptHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress) - { - InRelocSectionIndex = -1; - } - else - { - InRelocSectionIndex = FindSectionForRVA(InOptHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress, - InFileHeader->NumberOfSections, InSectionHeaders) - InSectionHeaders; - } - - OutFileHeader->NumberOfSections = 0; - CurrentSectionHeader = OutSectionHeaders; - OutOptHeader->SizeOfImage = 0; - RosSymOffset = 0; - OutRelocSection = NULL; - for (Section = 0; Section < InFileHeader->NumberOfSections; Section++) - { - if (0 == (InSectionHeaders[Section].Characteristics & IMAGE_SCN_LNK_REMOVE)) - { - *CurrentSectionHeader = InSectionHeaders[Section]; - CurrentSectionHeader->PointerToLinenumbers = 0; - CurrentSectionHeader->NumberOfLinenumbers = 0; - if (OutOptHeader->SizeOfImage < CurrentSectionHeader->VirtualAddress + - CurrentSectionHeader->Misc.VirtualSize) - { - OutOptHeader->SizeOfImage = ROUND_UP(CurrentSectionHeader->VirtualAddress + - CurrentSectionHeader->Misc.VirtualSize, - OutOptHeader->SectionAlignment); - } - if (RosSymOffset < CurrentSectionHeader->PointerToRawData + CurrentSectionHeader->SizeOfRawData) - { - RosSymOffset = CurrentSectionHeader->PointerToRawData + CurrentSectionHeader->SizeOfRawData; - } - if (Section == (ULONG)InRelocSectionIndex) - { - OutRelocSection = CurrentSectionHeader; - } - (OutFileHeader->NumberOfSections) ++; - CurrentSectionHeader++; - } - } - - if (OutRelocSection == CurrentSectionHeader - 1) - { - OutOptHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].Size = ProcessedRelocsLength; - if (OutOptHeader->SizeOfImage == OutRelocSection->VirtualAddress + - ROUND_UP(OutRelocSection->Misc.VirtualSize, - OutOptHeader->SectionAlignment)) - { - OutOptHeader->SizeOfImage = OutRelocSection->VirtualAddress + - ROUND_UP(ProcessedRelocsLength, - OutOptHeader->SectionAlignment); - } - OutRelocSection->Misc.VirtualSize = ProcessedRelocsLength; - if (RosSymOffset == OutRelocSection->PointerToRawData - + OutRelocSection->SizeOfRawData) - { - RosSymOffset = OutRelocSection->PointerToRawData + - ROUND_UP(ProcessedRelocsLength, OutOptHeader->FileAlignment); - } - OutRelocSection->SizeOfRawData = ROUND_UP(ProcessedRelocsLength, - OutOptHeader->FileAlignment); - } - - if (RosSymLength > 0) - { - RosSymFileLength = ROUND_UP(RosSymLength, OutOptHeader->FileAlignment); - memcpy(CurrentSectionHeader->Name, ".rossym", 8); /* We're lucky: string is exactly 8 bytes long */ - CurrentSectionHeader->Misc.VirtualSize = RosSymLength; - CurrentSectionHeader->VirtualAddress = OutOptHeader->SizeOfImage; - CurrentSectionHeader->SizeOfRawData = RosSymFileLength; - CurrentSectionHeader->PointerToRawData = RosSymOffset; - CurrentSectionHeader->PointerToRelocations = 0; - CurrentSectionHeader->PointerToLinenumbers = 0; - CurrentSectionHeader->NumberOfRelocations = 0; - CurrentSectionHeader->NumberOfLinenumbers = 0; - CurrentSectionHeader->Characteristics = IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_DISCARDABLE - | IMAGE_SCN_LNK_REMOVE | IMAGE_SCN_TYPE_NOLOAD; - OutOptHeader->SizeOfImage = ROUND_UP(CurrentSectionHeader->VirtualAddress + - CurrentSectionHeader->Misc.VirtualSize, - OutOptHeader->SectionAlignment); - (OutFileHeader->NumberOfSections)++; - - PaddedRosSym = malloc(RosSymFileLength); - if (NULL == PaddedRosSym) - { - fprintf(stderr, "Failed to allocate %u bytes for padded .rossym\n", (unsigned int)RosSymFileLength); - return 1; - } - memcpy(PaddedRosSym, RosSymSection, RosSymLength); - memset((char *) PaddedRosSym + RosSymLength, '\0', RosSymFileLength - RosSymLength); - } - else - { - PaddedRosSym = NULL; - } - CheckSum = 0; - for (i = 0; i < StartOfRawData / 2; i++) - { - CheckSum += ((unsigned short*) OutHeader)[i]; - CheckSum = 0xffff & (CheckSum + (CheckSum >> 16)); - } - Length = StartOfRawData; - for (Section = 0; Section < OutFileHeader->NumberOfSections; Section++) - { - DWORD SizeOfRawData; - if (OutRelocSection == OutSectionHeaders + Section) - { - Data = (void *) ProcessedRelocs; - SizeOfRawData = ProcessedRelocsLength; - } - else if (RosSymLength > 0 && Section + 1 == OutFileHeader->NumberOfSections) - { - Data = (void *) PaddedRosSym; - SizeOfRawData = OutSectionHeaders[Section].SizeOfRawData; - } - else - { - Data = (void *) ((char *) InData + OutSectionHeaders[Section].PointerToRawData); - SizeOfRawData = OutSectionHeaders[Section].SizeOfRawData; - } - for (i = 0; i < SizeOfRawData / 2; i++) - { - CheckSum += ((unsigned short*) Data)[i]; - CheckSum = 0xffff & (CheckSum + (CheckSum >> 16)); - } - Length += OutSectionHeaders[Section].SizeOfRawData; - } - CheckSum += Length; - OutOptHeader->CheckSum = CheckSum; - - if (fwrite(OutHeader, 1, StartOfRawData, OutFile) != StartOfRawData) - { - perror("Error writing output header\n"); - free(OutHeader); - return 1; - } - - for (Section = 0; Section < OutFileHeader->NumberOfSections; Section++) - { - if (0 != OutSectionHeaders[Section].SizeOfRawData) - { - DWORD SizeOfRawData; - fseek(OutFile, OutSectionHeaders[Section].PointerToRawData, SEEK_SET); - if (OutRelocSection == OutSectionHeaders + Section) - { - Data = (void *) ProcessedRelocs; - SizeOfRawData = ProcessedRelocsLength; - } - else if (RosSymLength > 0 && Section + 1 == OutFileHeader->NumberOfSections) - { - Data = (void *) PaddedRosSym; - SizeOfRawData = OutSectionHeaders[Section].SizeOfRawData; - } - else - { - Data = (void *) ((char *) InData + OutSectionHeaders[Section].PointerToRawData); - SizeOfRawData = OutSectionHeaders[Section].SizeOfRawData; - } - if (fwrite(Data, 1, SizeOfRawData, OutFile) != SizeOfRawData) - { - perror("Error writing section data\n"); - free(PaddedRosSym); - free(OutHeader); - return 1; - } - } - } - - if (PaddedRosSym) - { - free(PaddedRosSym); - } - free(OutHeader); - - return 0; -} - -int main(int argc, char* argv[]) -{ - PSYMBOLFILE_HEADER SymbolFileHeader; - PIMAGE_DOS_HEADER PEDosHeader; - PIMAGE_FILE_HEADER PEFileHeader; - PIMAGE_OPTIONAL_HEADER PEOptHeader; - PIMAGE_SECTION_HEADER PESectionHeaders; - ULONG ImageBase; - void *StabBase; - ULONG StabsLength; - void *StabStringBase; - ULONG StabStringsLength; - void *CoffBase = NULL; - ULONG CoffsLength; - void *CoffStringBase = NULL; - ULONG CoffStringsLength; - char* path1; - char* path2; - FILE* out; - void *StringBase; - ULONG StringsLength; - ULONG StabSymbolsCount; - PROSSYM_ENTRY StabSymbols; - ULONG CoffSymbolsCount; - PROSSYM_ENTRY CoffSymbols; - ULONG MergedSymbolsCount; - PROSSYM_ENTRY MergedSymbols; - size_t FileSize; - void *FileData; - ULONG RosSymLength; - void *RosSymSection; - char elfhdr[4] = { '\177', 'E', 'L', 'F' }; - - if (3 != argc) - { - fprintf(stderr, "Usage: rsym <exefile> <symfile>\n"); - exit(1); - } - - path1 = convert_path(argv[1]); - path2 = convert_path(argv[2]); - - FileData = load_file ( path1, &FileSize ); - if ( !FileData ) - { - fprintf ( stderr, "An error occured loading '%s'\n", path1 ); - exit(1); - } - - /* Check if MZ header exists */ - PEDosHeader = (PIMAGE_DOS_HEADER) FileData; - if (PEDosHeader->e_magic != IMAGE_DOS_MAGIC || PEDosHeader->e_lfanew == 0L) - { - /* Ignore elf */ - if (!memcmp(PEDosHeader, elfhdr, sizeof(elfhdr))) - exit(0); - perror("Input file is not a PE image.\n"); - free(FileData); - exit(1); - } - - /* Locate PE file header */ - /* sizeof(ULONG) = sizeof(MAGIC) */ - PEFileHeader = (PIMAGE_FILE_HEADER)((char *) FileData + PEDosHeader->e_lfanew + sizeof(ULONG)); - - /* Locate optional header */ - assert(sizeof(ULONG) == 4); - PEOptHeader = (PIMAGE_OPTIONAL_HEADER)(PEFileHeader + 1); - ImageBase = PEOptHeader->ImageBase; - - /* Locate PE section headers */ - PESectionHeaders = (PIMAGE_SECTION_HEADER)((char *) PEOptHeader + PEFileHeader->SizeOfOptionalHeader); - - if (GetStabInfo(FileData, PEFileHeader, PESectionHeaders, &StabsLength, &StabBase, - &StabStringsLength, &StabStringBase)) - { - free(FileData); - exit(1); - } - - if (GetCoffInfo(FileData, PEFileHeader, PESectionHeaders, &CoffsLength, &CoffBase, - &CoffStringsLength, &CoffStringBase)) - { - free(FileData); - exit(1); - } - - StringBase = malloc(1 + StabStringsLength + CoffStringsLength + - (CoffsLength / sizeof(ROSSYM_ENTRY)) * (E_SYMNMLEN + 1)); - if (NULL == StringBase) - { - free(FileData); - fprintf(stderr, "Failed to allocate memory for strings table\n"); - exit(1); - } - /* Make offset 0 into an empty string */ - *((char *) StringBase) = '\0'; - StringsLength = 1; - - if (ConvertStabs(&StabSymbolsCount, &StabSymbols, &StringsLength, StringBase, - StabsLength, StabBase, StabStringsLength, StabStringBase, - ImageBase, PEFileHeader, PESectionHeaders)) - { - free(StringBase); - free(FileData); - fprintf(stderr, "Failed to allocate memory for strings table\n"); - exit(1); - } - - if (ConvertCoffs(&CoffSymbolsCount, &CoffSymbols, &StringsLength, StringBase, - CoffsLength, CoffBase, CoffStringsLength, CoffStringBase, - ImageBase, PEFileHeader, PESectionHeaders)) - { - if (StabSymbols) - { - free(StabSymbols); - } - free(StringBase); - free(FileData); - exit(1); - } - - if (MergeStabsAndCoffs(&MergedSymbolsCount, &MergedSymbols, - StabSymbolsCount, StabSymbols, - CoffSymbolsCount, CoffSymbols)) - { - if (CoffSymbols) - { - free(CoffSymbols); - } - if (StabSymbols) - { - free(StabSymbols); - } - free(StringBase); - free(FileData); - exit(1); - } - - if (CoffSymbols) - { - free(CoffSymbols); - } - if (StabSymbols) - { - free(StabSymbols); - } - if (MergedSymbolsCount == 0) - { - RosSymLength = 0; - RosSymSection = NULL; - } - else - { - RosSymLength = sizeof(SYMBOLFILE_HEADER) + MergedSymbolsCount * sizeof(ROSSYM_ENTRY) - + StringsLength; - RosSymSection = malloc(RosSymLength); - if (NULL == RosSymSection) - { - free(MergedSymbols); - free(StringBase); - free(FileData); - fprintf(stderr, "Unable to allocate memory for .rossym section\n"); - exit(1); - } - memset(RosSymSection, '\0', RosSymLength); - - SymbolFileHeader = (PSYMBOLFILE_HEADER) RosSymSection; - SymbolFileHeader->SymbolsOffset = sizeof(SYMBOLFILE_HEADER); - SymbolFileHeader->SymbolsLength = MergedSymbolsCount * sizeof(ROSSYM_ENTRY); - SymbolFileHeader->StringsOffset = SymbolFileHeader->SymbolsOffset + SymbolFileHeader->SymbolsLength; - SymbolFileHeader->StringsLength = StringsLength; - - memcpy((char *) RosSymSection + SymbolFileHeader->SymbolsOffset, MergedSymbols, - SymbolFileHeader->SymbolsLength); - memcpy((char *) RosSymSection + SymbolFileHeader->StringsOffset, StringBase, - SymbolFileHeader->StringsLength); - - free(MergedSymbols); - } - free(StringBase); - out = fopen(path2, "wb"); - if (out == NULL) - { - perror("Cannot open output file"); - free(RosSymSection); - free(FileData); - exit(1); - } - - if (CreateOutputFile(out, FileData, PEDosHeader, PEFileHeader, PEOptHeader, - PESectionHeaders, RosSymLength, RosSymSection)) - { - fclose(out); - if (RosSymSection) - { - free(RosSymSection); - } - free(FileData); - exit(1); - } - - fclose(out); - if (RosSymSection) - { - free(RosSymSection); - } - free(FileData); - - return 0; -} - -/* EOF */ Removed: trunk/reactos/tools/rsym.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rsym.h?rev=40756&vie…
============================================================================== --- trunk/reactos/tools/rsym.h [iso-8859-1] (original) +++ trunk/reactos/tools/rsym.h (removed) @@ -1,354 +1,0 @@ -/* rsym.h */ - -#ifndef RSYM_H -#define RSYM_H - -#define IMAGE_DOS_MAGIC 0x5a4d -#define IMAGE_PE_MAGIC 0x00004550 -#define IMAGE_SIZEOF_SHORT_NAME 8 -#define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b -#define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b - -#define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 -#define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 -#define IMAGE_FILE_DEBUG_STRIPPED 0x0200 - -#define IMAGE_DIRECTORY_ENTRY_BASERELOC 5 - -#define IMAGE_SCN_TYPE_NOLOAD 0x00000002 -#define IMAGE_SCN_LNK_REMOVE 0x00000800 -#define IMAGE_SCN_MEM_READ 0x40000000 -#define IMAGE_SCN_MEM_DISCARDABLE 0x02000000 - -#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 - -typedef unsigned char BYTE; -typedef unsigned char UCHAR; -typedef unsigned short WORD; -typedef unsigned short USHORT; -typedef unsigned long long ULONGLONG; -#if defined(__x86_64__) && defined(unix) -typedef signed int LONG; -typedef unsigned int ULONG; -typedef unsigned int DWORD; -#else -typedef signed long LONG; -typedef unsigned long ULONG; -typedef unsigned long DWORD; -#endif -#if defined(_WIN64) -typedef unsigned __int64 ULONG_PTR; -#else -#if defined(__x86_64__) && defined(unix) -typedef unsigned int ULONG_PTR; -#else -typedef unsigned long ULONG_PTR; -#endif -#endif - -#pragma pack(push,2) -typedef struct _IMAGE_DOS_HEADER { - WORD e_magic; - WORD e_cblp; - WORD e_cp; - WORD e_crlc; - WORD e_cparhdr; - WORD e_minalloc; - WORD e_maxalloc; - WORD e_ss; - WORD e_sp; - WORD e_csum; - WORD e_ip; - WORD e_cs; - WORD e_lfarlc; - WORD e_ovno; - WORD e_res[4]; - WORD e_oemid; - WORD e_oeminfo; - WORD e_res2[10]; - LONG e_lfanew; -} IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER; -#pragma pack(pop) - -#pragma pack(push,4) -typedef struct _IMAGE_FILE_HEADER { - WORD Machine; - WORD NumberOfSections; - DWORD TimeDateStamp; - DWORD PointerToSymbolTable; - DWORD NumberOfSymbols; - WORD SizeOfOptionalHeader; - WORD Characteristics; -} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER; -#pragma pack(pop) - -typedef struct _IMAGE_DATA_DIRECTORY { - DWORD VirtualAddress; - DWORD Size; -} IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY; - -typedef struct _IMAGE_OPTIONAL_HEADER32 { - WORD Magic; - BYTE MajorLinkerVersion; - BYTE MinorLinkerVersion; - DWORD SizeOfCode; - DWORD SizeOfInitializedData; - DWORD SizeOfUninitializedData; - DWORD AddressOfEntryPoint; - DWORD BaseOfCode; - DWORD BaseOfData; - DWORD ImageBase; - DWORD SectionAlignment; - DWORD FileAlignment; - WORD MajorOperatingSystemVersion; - WORD MinorOperatingSystemVersion; - WORD MajorImageVersion; - WORD MinorImageVersion; - WORD MajorSubsystemVersion; - WORD MinorSubsystemVersion; - DWORD Win32VersionValue; - DWORD SizeOfImage; - DWORD SizeOfHeaders; - DWORD CheckSum; - WORD Subsystem; - WORD DllCharacteristics; - DWORD SizeOfStackReserve; - DWORD SizeOfStackCommit; - DWORD SizeOfHeapReserve; - DWORD SizeOfHeapCommit; - DWORD LoaderFlags; - DWORD NumberOfRvaAndSizes; - IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; -} IMAGE_OPTIONAL_HEADER32, *PIMAGE_OPTIONAL_HEADER32; - -typedef struct _IMAGE_OPTIONAL_HEADER64 { - WORD Magic; - BYTE MajorLinkerVersion; - BYTE MinorLinkerVersion; - DWORD SizeOfCode; - DWORD SizeOfInitializedData; - DWORD SizeOfUninitializedData; - DWORD AddressOfEntryPoint; - DWORD BaseOfCode; - ULONGLONG ImageBase; - DWORD SectionAlignment; - DWORD FileAlignment; - WORD MajorOperatingSystemVersion; - WORD MinorOperatingSystemVersion; - WORD MajorImageVersion; - WORD MinorImageVersion; - WORD MajorSubsystemVersion; - WORD MinorSubsystemVersion; - DWORD Win32VersionValue; - DWORD SizeOfImage; - DWORD SizeOfHeaders; - DWORD CheckSum; - WORD Subsystem; - WORD DllCharacteristics; - ULONGLONG SizeOfStackReserve; - ULONGLONG SizeOfStackCommit; - ULONGLONG SizeOfHeapReserve; - ULONGLONG SizeOfHeapCommit; - DWORD LoaderFlags; - DWORD NumberOfRvaAndSizes; - IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; -} IMAGE_OPTIONAL_HEADER64, *PIMAGE_OPTIONAL_HEADER64; - -#ifdef _TARGET_PE64 -typedef IMAGE_OPTIONAL_HEADER64 IMAGE_OPTIONAL_HEADER; -typedef PIMAGE_OPTIONAL_HEADER64 PIMAGE_OPTIONAL_HEADER; -#else -typedef IMAGE_OPTIONAL_HEADER32 IMAGE_OPTIONAL_HEADER; -typedef PIMAGE_OPTIONAL_HEADER32 PIMAGE_OPTIONAL_HEADER; -#endif - -typedef struct _IMAGE_SECTION_HEADER { - BYTE Name[IMAGE_SIZEOF_SHORT_NAME]; - union { - DWORD PhysicalAddress; - DWORD VirtualSize; - } Misc; - DWORD VirtualAddress; - DWORD SizeOfRawData; - DWORD PointerToRawData; - DWORD PointerToRelocations; - DWORD PointerToLinenumbers; - WORD NumberOfRelocations; - WORD NumberOfLinenumbers; - DWORD Characteristics; -} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER; - -#pragma pack(push,4) -typedef struct _IMAGE_BASE_RELOCATION { - DWORD VirtualAddress; - DWORD SizeOfBlock; - WORD TypeOffset[1]; -} IMAGE_BASE_RELOCATION, *PIMAGE_BASE_RELOCATION; -#pragma pack(pop) - -typedef struct { - USHORT f_magic; /* magic number */ - USHORT f_nscns; /* number of sections */ - ULONG f_timdat; /* time & date stamp */ - ULONG f_symptr; /* file pointer to symtab */ - ULONG f_nsyms; /* number of symtab entries */ - USHORT f_opthdr; /* sizeof(optional hdr) */ - USHORT f_flags; /* flags */ -} FILHDR; - -typedef struct { - char s_name[8]; /* section name */ - ULONG s_paddr; /* physical address, aliased s_nlib */ - ULONG s_vaddr; /* virtual address */ - ULONG s_size; /* section size */ - ULONG s_scnptr; /* file ptr to raw data for section */ - ULONG s_relptr; /* file ptr to relocation */ - ULONG s_lnnoptr; /* file ptr to line numbers */ - USHORT s_nreloc; /* number of relocation entries */ - USHORT s_nlnno; /* number of line number entries */ - ULONG s_flags; /* flags */ -} SCNHDR; -#pragma pack(4) - -typedef struct _SYMBOLFILE_HEADER { - ULONG SymbolsOffset; - ULONG SymbolsLength; - ULONG StringsOffset; - ULONG StringsLength; -} SYMBOLFILE_HEADER, *PSYMBOLFILE_HEADER; - -typedef struct _STAB_ENTRY { - ULONG n_strx; /* index into string table of name */ - UCHAR n_type; /* type of symbol */ - UCHAR n_other; /* misc info (usually empty) */ - USHORT n_desc; /* description field */ - ULONG n_value; /* value of symbol */ -} STAB_ENTRY, *PSTAB_ENTRY; - -/*
http://www.math.utah.edu/docs/info/stabs_12.html
*/ - -#define N_GYSM 0x20 -#define N_FNAME 0x22 -#define N_FUN 0x24 -#define N_STSYM 0x26 -#define N_LCSYM 0x28 -#define N_MAIN 0x2A -#define N_PC 0x30 -#define N_NSYMS 0x32 -#define N_NOMAP 0x34 -#define N_RSYM 0x40 -#define N_M2C 0x42 -#define N_SLINE 0x44 -#define N_DSLINE 0x46 -#define N_BSLINE 0x48 -#define N_BROWS 0x48 -#define N_DEFD 0x4A -#define N_EHDECL 0x50 -#define N_MOD2 0x50 -#define N_CATCH 0x54 -#define N_SSYM 0x60 -#define N_SO 0x64 -#define N_LSYM 0x80 -#define N_BINCL 0x82 -#define N_SOL 0x84 -#define N_PSYM 0xA0 -#define N_EINCL 0xA2 -#define N_ENTRY 0xA4 -#define N_LBRAC 0xC0 -#define N_EXCL 0xC2 -#define N_SCOPE 0xC4 -#define N_RBRAC 0xE0 -#define N_BCOMM 0xE2 -#define N_ECOMM 0xE4 -#define N_ECOML 0xE8 -#define N_LENG 0xFE - -/* COFF symbol table */ - -#define E_SYMNMLEN 8 /* # characters in a symbol name */ -#define E_FILNMLEN 14 /* # characters in a file name */ -#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */ - -#define N_BTMASK (0xf) -#define N_TMASK (0x30) -#define N_BTSHFT (4) -#define N_TSHIFT (2) - -/* derived types, in e_type */ - -#define DT_NON (0) /* no derived type */ -#define DT_PTR (1) /* pointer */ -#define DT_FCN (2) /* function */ -#define DT_ARY (3) /* array */ - -#define BTYPE(x) ((x) & N_BTMASK) - -#define ISPTR(x) (((x) & N_TMASK) == (DT_PTR << N_BTSHFT)) -#define ISFCN(x) (((x) & N_TMASK) == (DT_FCN << N_BTSHFT)) -#define ISARY(x) (((x) & N_TMASK) == (DT_ARY << N_BTSHFT)) -#define ISTAG(x) ((x) == C_STRTAG || (x) == C_UNTAG || (x) == C_ENTAG) -#define DECREF(x) ((((x) >> N_TSHIFT) & ~N_BTMASK) | ((x) & N_BTMASK)) - -#define C_EFCN 0xff /* physical end of function */ -#define C_NULL 0 -#define C_AUTO 1 /* automatic variable */ -#define C_EXT 2 /* external symbol */ -#define C_STAT 3 /* static */ -#define C_REG 4 /* register variable */ -#define C_EXTDEF 5 /* external definition */ -#define C_LABEL 6 /* label */ -#define C_ULABEL 7 /* undefined label */ -#define C_MOS 8 /* member of structure */ -#define C_ARG 9 /* function argument */ -#define C_STRTAG 10 /* structure tag */ -#define C_MOU 11 /* member of union */ -#define C_UNTAG 12 /* union tag */ -#define C_TPDEF 13 /* type definition */ -#define C_USTATIC 14 /* undefined static */ -#define C_ENTAG 15 /* enumeration tag */ -#define C_MOE 16 /* member of enumeration */ -#define C_REGPARM 17 /* register parameter */ -#define C_FIELD 18 /* bit field */ -#define C_AUTOARG 19 /* auto argument */ -#define C_LASTENT 20 /* dummy entry (end of block) */ -#define C_BLOCK 100 /* ".bb" or ".eb" */ -#define C_FCN 101 /* ".bf" or ".ef" */ -#define C_EOS 102 /* end of structure */ -#define C_FILE 103 /* file name */ -#define C_LINE 104 /* line# reformatted as symbol table entry */ -#define C_ALIAS 105 /* duplicate tag */ -#define C_HIDDEN 106 /* ext symbol in dmert public lib */ - -#pragma pack(1) -typedef struct _COFF_SYMENT { - union { - char e_name[E_SYMNMLEN]; - struct { - ULONG e_zeroes; - ULONG e_offset; - } e; - } e; - ULONG e_value; - short e_scnum; - USHORT e_type; - UCHAR e_sclass; - UCHAR e_numaux; -} COFF_SYMENT, *PCOFF_SYMENT; -#pragma pack(4) - -typedef struct _ROSSYM_ENTRY { - ULONG_PTR Address; - ULONG FunctionOffset; - ULONG FileOffset; - ULONG SourceLine; -} ROSSYM_ENTRY, *PROSSYM_ENTRY; - -#define ROUND_UP(N, S) (((N) + (S) - 1) & ~((S) - 1)) - -extern char * -convert_path(const char *origpath); - -extern void * -load_file(const char *file_name, size_t *file_size); - -#endif /* RSYM_H */ Removed: trunk/reactos/tools/rsym.mak URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rsym.mak?rev=40756&v…
============================================================================== --- trunk/reactos/tools/rsym.mak [iso-8859-1] (original) +++ trunk/reactos/tools/rsym.mak (removed) @@ -1,45 +1,0 @@ -RSYM_BASE = $(TOOLS_BASE) -RSYM_BASE_ = $(RSYM_BASE)$(SEP) - -RSYM_INT = $(INTERMEDIATE_)$(RSYM_BASE) -RSYM_INT_ = $(RSYM_INT)$(SEP) -RSYM_OUT = $(OUTPUT_)$(RSYM_BASE) -RSYM_OUT_ = $(RSYM_OUT)$(SEP) - -RSYM_TARGET = \ - $(RSYM_OUT_)rsym$(EXEPOSTFIX) - -RSYM_SOURCES = \ - $(RSYM_BASE_)rsym.c \ - $(RSYM_BASE_)rsym_common.c - -RSYM_OBJECTS = \ - $(addprefix $(INTERMEDIATE_), $(RSYM_SOURCES:.c=.o)) - -ifeq ($(ARCH),amd64) -RSYM_HOST_CFLAGS = $(TOOLS_CFLAGS) -D_TARGET_PE64 -else -RSYM_HOST_CFLAGS = $(TOOLS_CFLAGS) -endif - -RSYM_HOST_LFLAGS = $(TOOLS_LFLAGS) - -.PHONY: rsym -rsym: $(RSYM_TARGET) - -$(RSYM_TARGET): $(RSYM_OBJECTS) | $(RSYM_OUT) - $(ECHO_HOSTLD) - ${host_gcc} $(RSYM_OBJECTS) $(RSYM_HOST_LFLAGS) -o $@ - -$(RSYM_INT_)rsym.o: $(RSYM_BASE_)rsym.c | $(RSYM_INT) - $(ECHO_HOSTCC) - ${host_gcc} $(RSYM_HOST_CFLAGS) -c $< -o $@ - -$(RSYM_INT_)rsym_common.o: $(RSYM_BASE_)rsym_common.c | $(RSYM_INT) - $(ECHO_HOSTCC) - ${host_gcc} $(RSYM_HOST_CFLAGS) -c $< -o $@ - -.PHONY: rsym_clean -rsym_clean: - -@$(rm) $(RSYM_TARGET) $(RSYM_OBJECTS) 2>$(NUL) -clean: rsym_clean Modified: trunk/reactos/tools/rsym/rsym.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rsym/rsym.c?rev=4075…
============================================================================== --- trunk/reactos/tools/rsym/rsym.c [iso-8859-1] (original) +++ trunk/reactos/tools/rsym/rsym.c [iso-8859-1] Fri May 1 03:26:02 2009 @@ -489,7 +489,7 @@ *ProcessedRelocs = malloc(RelocSectionHeader->SizeOfRawData); if (NULL == *ProcessedRelocs) { - fprintf(stderr, "Failed to allocate %lu bytes for relocations\n", RelocSectionHeader->SizeOfRawData); + fprintf(stderr, "Failed to allocate %u bytes for relocations\n", (unsigned int)RelocSectionHeader->SizeOfRawData); return 1; } *ProcessedRelocsLength = 0; @@ -565,7 +565,7 @@ OutHeader = malloc(StartOfRawData); if (NULL == OutHeader) { - fprintf(stderr, "Failed to allocate %lu bytes for output file header\n", StartOfRawData); + fprintf(stderr, "Failed to allocate %u bytes for output file header\n", (unsigned int)StartOfRawData); return 1; } memset(OutHeader, '\0', StartOfRawData); @@ -678,7 +678,7 @@ PaddedRosSym = malloc(RosSymFileLength); if (NULL == PaddedRosSym) { - fprintf(stderr, "Failed to allocate %lu bytes for padded .rossym\n", RosSymFileLength); + fprintf(stderr, "Failed to allocate %u bytes for padded .rossym\n", (unsigned int)RosSymFileLength); return 1; } memcpy(PaddedRosSym, RosSymSection, RosSymLength); @@ -697,19 +697,23 @@ Length = StartOfRawData; for (Section = 0; Section < OutFileHeader->NumberOfSections; Section++) { + DWORD SizeOfRawData; if (OutRelocSection == OutSectionHeaders + Section) { Data = (void *) ProcessedRelocs; + SizeOfRawData = ProcessedRelocsLength; } else if (RosSymLength > 0 && Section + 1 == OutFileHeader->NumberOfSections) { Data = (void *) PaddedRosSym; + SizeOfRawData = OutSectionHeaders[Section].SizeOfRawData; } else { Data = (void *) ((char *) InData + OutSectionHeaders[Section].PointerToRawData); - } - for (i = 0; i < OutSectionHeaders[Section].SizeOfRawData / 2; i++) + SizeOfRawData = OutSectionHeaders[Section].SizeOfRawData; + } + for (i = 0; i < SizeOfRawData / 2; i++) { CheckSum += ((unsigned short*) Data)[i]; CheckSum = 0xffff & (CheckSum + (CheckSum >> 16)); @@ -730,21 +734,24 @@ { if (0 != OutSectionHeaders[Section].SizeOfRawData) { + DWORD SizeOfRawData; fseek(OutFile, OutSectionHeaders[Section].PointerToRawData, SEEK_SET); if (OutRelocSection == OutSectionHeaders + Section) { Data = (void *) ProcessedRelocs; + SizeOfRawData = ProcessedRelocsLength; } else if (RosSymLength > 0 && Section + 1 == OutFileHeader->NumberOfSections) { Data = (void *) PaddedRosSym; + SizeOfRawData = OutSectionHeaders[Section].SizeOfRawData; } else { Data = (void *) ((char *) InData + OutSectionHeaders[Section].PointerToRawData); - } - if (fwrite(Data, 1, OutSectionHeaders[Section].SizeOfRawData, OutFile) != - OutSectionHeaders[Section].SizeOfRawData) + SizeOfRawData = OutSectionHeaders[Section].SizeOfRawData; + } + if (fwrite(Data, 1, SizeOfRawData, OutFile) != SizeOfRawData) { perror("Error writing section data\n"); free(PaddedRosSym); Removed: trunk/reactos/tools/rsym_common.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rsym_common.c?rev=40…
============================================================================== --- trunk/reactos/tools/rsym_common.c [iso-8859-1] (original) +++ trunk/reactos/tools/rsym_common.c (removed) @@ -1,62 +1,0 @@ -/* rsym_common.c */ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> - -#include "rsym.h" - -char* -convert_path ( const char* origpath ) -{ - char* newpath; - int i; - - newpath = strdup(origpath); - - i = 0; - while (newpath[i] != 0) - { -#ifdef UNIX_PATHS - if (newpath[i] == '\\') - { - newpath[i] = '/'; - } -#else -#ifdef DOS_PATHS - if (newpath[i] == '/') - { - newpath[i] = '\\'; - } -#endif -#endif - i++; - } - return(newpath); -} - -void* -load_file ( const char* file_name, size_t* file_size ) -{ - FILE* f; - void* FileData = NULL; - - f = fopen ( file_name, "rb" ); - if (f != NULL) - { - fseek(f, 0L, SEEK_END); - *file_size = ftell(f); - fseek(f, 0L, SEEK_SET); - FileData = malloc(*file_size); - if (FileData != NULL) - { - if ( *file_size != fread(FileData, 1, *file_size, f) ) - { - free(FileData); - FileData = NULL; - } - } - fclose(f); - } - return FileData; -} Modified: trunk/reactos/tools/tools.mak URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/tools.mak?rev=40757&…
============================================================================== --- trunk/reactos/tools/tools.mak [iso-8859-1] (original) +++ trunk/reactos/tools/tools.mak [iso-8859-1] Fri May 1 03:26:02 2009 @@ -51,4 +51,4 @@ include tools/pefixup.mak include tools/raddr2line.mak include tools/rbuild/rbuild.mak -include tools/rsym.mak +include tools/rsym/rsym.mak
15 years, 8 months
1
0
0
0
[dreimer] 40756: Some cleanup and hopefully right understood line skips at the If blocks...
by dreimer@svn.reactos.org
Author: dreimer Date: Thu Apr 30 21:46:34 2009 New Revision: 40756 URL:
http://svn.reactos.org/svn/reactos?rev=40756&view=rev
Log: Some cleanup and hopefully right understood line skips at the If blocks... Modified: trunk/tools/RosBE/RosBE-Windows/RosBE.nsi trunk/tools/RosBE/RosBE-Windows/RosBE64.nsi Modified: trunk/tools/RosBE/RosBE-Windows/RosBE.nsi URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/RosBE.ns…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/RosBE.nsi [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/RosBE.nsi [iso-8859-1] Thu Apr 30 21:46:34 2009 @@ -277,12 +277,12 @@ ;; ;; Add our start menu shortcuts. ;; - IfFileExists "$SMPROGRAMS\$ICONS_GROUP\ReactOS Build Environment.lnk" +12 0 + IfFileExists "$SMPROGRAMS\$ICONS_GROUP\ReactOS Build Environment.lnk" +13 0 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application CreateDirectory "$SMPROGRAMS\$ICONS_GROUP" SetOutPath $REACTOS_SOURCE_DIRECTORY CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\ReactOS Build Environment.lnk" "$SYSDIR\cmd.exe" '/t:0A /k "$INSTDIR\RosBE.cmd"' "$INSTDIR\rosbe.ico" - IfFileExists "$INSTDIR\RosBE.ps1" 0 +1 + IfFileExists "$INSTDIR\RosBE.ps1" 0 +2 CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\ReactOS Build Environment - Powershell.lnk" "$SYSDIR\WindowsPowerShell\v1.0\powershell.exe" '-noexit &"$INSTDIR\RosBE.ps1"' "$INSTDIR\rosbe.ico" SetOutPath $PROFILE CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Standard MinGW Build Environment.lnk" "$SYSDIR\cmd.exe" '/k "$INSTDIR\MinGW.cmd"' "$INSTDIR\mingw.ico" @@ -300,10 +300,10 @@ ;; ;; Add our desktop shortcuts. ;; - IfFileExists "$DESKTOP\ReactOS Build Environment.lnk" +6 0 + IfFileExists "$DESKTOP\ReactOS Build Environment.lnk" +7 0 SetOutPath $REACTOS_SOURCE_DIRECTORY CreateShortCut "$DESKTOP\ReactOS Build Environment.lnk" "$SYSDIR\cmd.exe" '/k "$INSTDIR\RosBE.cmd"' "$INSTDIR\rosbe.ico" - IfFileExists "$INSTDIR\RosBE.ps1" 0 +1 + IfFileExists "$INSTDIR\RosBE.ps1" 0 +2 CreateShortCut "$DESKTOP\ReactOS Build Environment - Powershell.lnk" "$SYSDIR\WindowsPowerShell\v1.0\powershell.exe" '-noexit &"$INSTDIR\RosBE.ps1"' "$INSTDIR\rosbe.ico" SetOutPath $PROFILE CreateShortCut "$DESKTOP\Standard MinGW Build Environment.lnk" "$SYSDIR\cmd.exe" '/k "$INSTDIR\MinGW.cmd"' "$INSTDIR\mingw.ico" @@ -315,10 +315,10 @@ ;; ;; Add our quick launch shortcuts. ;; - IfFileExists "$QUICKLAUNCH\ReactOS Build Environment.lnk" +6 0 + IfFileExists "$QUICKLAUNCH\ReactOS Build Environment.lnk" +7 0 SetOutPath $REACTOS_SOURCE_DIRECTORY CreateShortCut "$QUICKLAUNCH\ReactOS Build Environment.lnk" "$SYSDIR\cmd.exe" '/k "$INSTDIR\RosBE.cmd"' "$INSTDIR\rosbe.ico" - IfFileExists "$INSTDIR\RosBE.ps1" 0 +1 + IfFileExists "$INSTDIR\RosBE.ps1" 0 +2 CreateShortCut "$QUICKLAUNCH\ReactOS Build Environment - Powershell.lnk" "$SYSDIR\WindowsPowerShell\v1.0\powershell.exe" '-noexit &"$INSTDIR\RosBE.ps1"' "$INSTDIR\rosbe.ico" SetOutPath $PROFILE CreateShortCut "$QUICKLAUNCH\Standard MinGW Build Environment.lnk" "$SYSDIR\cmd.exe" '/k "$INSTDIR\MinGW.cmd"' "$INSTDIR\mingw.ico" @@ -343,31 +343,25 @@ "Are you sure you want to remove ReactOS Build Environment and all of its components?" \ IDYES +2 Abort - IfFileExists "$PROFILE\RosBE\." 0 +2 + IfFileExists "$PROFILE\RosBE\." 0 +3 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 \ "Do you want to remove the ReactOS Build Environment configuration file from the Profile Path?" \ IDNO +1 RMDir /r /REBOOTOK "$PROFILE\RosBE" - IfFileExists "$APPDATA\RosBE\." 0 +2 + IfFileExists "$APPDATA\RosBE\." 0 +3 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 \ "Do you want to remove the ReactOS Build Environment configuration file from the Application Data Path?" \ IDNO +1 RMDir /r /REBOOTOK "$APPDATA\RosBE" MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 \ "Do you want to remove the Shortcuts? If you just want to Update to a new Version of RosBE, keep them. This keeps your previous settings." \ - IDNO +12 - IfFileExists "$DESKTOP\ReactOS Build Environment.lnk" 0 +1 - Delete /REBOOTOK "$DESKTOP\ReactOS Build Environment.lnk" - IfFileExists "$QUICKLAUNCH\ReactOS Build Environment.lnk" 0 +1 - Delete /REBOOTOK "$QUICKLAUNCH\ReactOS Build Environment.lnk" - IfFileExists "$DESKTOP\Standard MinGW Build Environment.lnk" 0 +1 - Delete /REBOOTOK "$DESKTOP\Standard MinGW Build Environment.lnk" - IfFileExists "$QUICKLAUNCH\Standard MinGW Build Environment.lnk" 0 +1 - Delete /REBOOTOK "$QUICKLAUNCH\Standard MinGW Build Environment.lnk" - IfFileExists "$DESKTOP\ReactOS Build Environment - Powershell.lnk" 0 +1 - Delete /REBOOTOK "$DESKTOP\ReactOS Build Environment - Powershell.lnk" - IfFileExists "$QUICKLAUNCH\ReactOS Build Environment - Powershell.lnk" 0 +1 - Delete /REBOOTOK "$QUICKLAUNCH\ReactOS Build Environment - Powershell.lnk" + IDNO +7 + Delete /REBOOTOK "$DESKTOP\ReactOS Build Environment.lnk" + Delete /REBOOTOK "$QUICKLAUNCH\ReactOS Build Environment.lnk" + Delete /REBOOTOK "$DESKTOP\Standard MinGW Build Environment.lnk" + Delete /REBOOTOK "$QUICKLAUNCH\Standard MinGW Build Environment.lnk" + Delete /REBOOTOK "$DESKTOP\ReactOS Build Environment - Powershell.lnk" + Delete /REBOOTOK "$QUICKLAUNCH\ReactOS Build Environment - Powershell.lnk" FunctionEnd Section Uninstall Modified: trunk/tools/RosBE/RosBE-Windows/RosBE64.nsi URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/RosBE64.…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/RosBE64.nsi [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/RosBE64.nsi [iso-8859-1] Thu Apr 30 21:46:34 2009 @@ -199,10 +199,8 @@ Delete /REBOOTOK "$INSTDIR\Uninstall-${PRODUCT_VERSION}.exe" ;; Whoever dares to change this back into: RMDir /r /REBOOTOK "$INSTDIR" will be KILLED!!! RMDir /REBOOTOK "$INSTDIR" - IfFileExists "$DESKTOP\ReactOS Build Environment 64-bit.lnk" 0 +2 - Delete /REBOOTOK "$DESKTOP\ReactOS Build Environment 64-bit.lnk" - IfFileExists "$QUICKLAUNCH\ReactOS Build Environment 64-bit.lnk" 0 +2 - Delete /REBOOTOK "$QUICKLAUNCH\ReactOS Build Environment 64-bit.lnk" + Delete /REBOOTOK "$DESKTOP\ReactOS Build Environment 64-bit.lnk" + Delete /REBOOTOK "$QUICKLAUNCH\ReactOS Build Environment 64-bit.lnk" ;; ;; Clean up the registry.
15 years, 8 months
1
0
0
0
[tkreuzer] 40755: No more need for allowwarnings="true"
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Apr 30 14:59:15 2009 New Revision: 40755 URL:
http://svn.reactos.org/svn/reactos?rev=40755&view=rev
Log: No more need for allowwarnings="true" Modified: branches/ros-amd64-bringup/reactos/dll/directx/dinput/dinput.rbuild branches/ros-amd64-bringup/reactos/dll/directx/dsound/dsound.rbuild Modified: branches/ros-amd64-bringup/reactos/dll/directx/dinput/dinput.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/d…
============================================================================== --- branches/ros-amd64-bringup/reactos/dll/directx/dinput/dinput.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/directx/dinput/dinput.rbuild [iso-8859-1] Thu Apr 30 14:59:15 2009 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> -<module name="dinput" type="win32dll" baseaddress="${BASEADDRESS_DINPUT}" installbase="system32" installname="dinput.dll" allowwarnings ="true" unicode="yes"> +<module name="dinput" type="win32dll" baseaddress="${BASEADDRESS_DINPUT}" installbase="system32" installname="dinput.dll" unicode="yes"> <autoregister infsection="OleControlDlls" type="DllRegisterServer" /> <importlibrary definition="dinput.spec" /> <define name="_WIN32_WINNT">0x600</define> Modified: branches/ros-amd64-bringup/reactos/dll/directx/dsound/dsound.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/d…
============================================================================== --- branches/ros-amd64-bringup/reactos/dll/directx/dsound/dsound.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/directx/dsound/dsound.rbuild [iso-8859-1] Thu Apr 30 14:59:15 2009 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> -<module name="dsound" type="win32dll" baseaddress="${BASEADDRESS_DSOUND}" installbase="system32" installname="dsound.dll" allowwarnings ="true" crt="msvcrt"> +<module name="dsound" type="win32dll" baseaddress="${BASEADDRESS_DSOUND}" installbase="system32" installname="dsound.dll" crt="msvcrt"> <autoregister infsection="OleControlDlls" type="DllRegisterServer" /> <importlibrary definition="dsound.spec" /> <include base="dsound">.</include>
15 years, 8 months
1
0
0
0
[dreimer] 40754: Same fix for the 64 bit installer.
by dreimer@svn.reactos.org
Author: dreimer Date: Thu Apr 30 14:58:46 2009 New Revision: 40754 URL:
http://svn.reactos.org/svn/reactos?rev=40754&view=rev
Log: Same fix for the 64 bit installer. Modified: trunk/tools/RosBE/RosBE-Windows/RosBE64.nsi Modified: trunk/tools/RosBE/RosBE-Windows/RosBE64.nsi URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/RosBE64.…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/RosBE64.nsi [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/RosBE64.nsi [iso-8859-1] Thu Apr 30 14:58:46 2009 @@ -108,8 +108,9 @@ SetOutPath "$INSTDIR" SetOverwrite try File /r Root\charch.cmd + File /r Root\options.cmd + IfFileExists "$INSTDIR\RosBE.ps1" 0 +2 File /r Root\charch.ps1 - File /r Root\options.cmd File /r Root\options.ps1 SetOutPath "$INSTDIR\Tools" SetOverwrite try
15 years, 8 months
1
0
0
0
[tkreuzer] 40753: dsound: Make DSDRIVERDESC.dnDevNode a DWORD_PTR and DSPROPERTY.InstanceId a ULONG_PTR.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Apr 30 14:57:39 2009 New Revision: 40753 URL:
http://svn.reactos.org/svn/reactos?rev=40753&view=rev
Log: dsound: Make DSDRIVERDESC.dnDevNode a DWORD_PTR and DSPROPERTY.InstanceId a ULONG_PTR. Modified: branches/ros-amd64-bringup/reactos/dll/directx/dsound/primary.c branches/ros-amd64-bringup/reactos/dll/directx/dsound/propset.c branches/ros-amd64-bringup/reactos/include/psdk/dsdriver.h Modified: branches/ros-amd64-bringup/reactos/dll/directx/dsound/primary.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/d…
============================================================================== --- branches/ros-amd64-bringup/reactos/dll/directx/dsound/primary.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/directx/dsound/primary.c [iso-8859-1] Thu Apr 30 14:57:39 2009 @@ -126,7 +126,7 @@ if (device->driver) flags |= WAVE_DIRECTSOUND; - hres = mmErr(waveOutOpen(&(device->hwo), device->drvdesc.dnDevNode, device->pwfx, (DWORD_PTR)DSOUND_callback, (DWORD)device, flags)); + hres = mmErr(waveOutOpen(&(device->hwo), device->drvdesc.dnDevNode, device->pwfx, (DWORD_PTR)DSOUND_callback, (DWORD_PTR)device, flags)); if (FAILED(hres)) { WARN("waveOutOpen failed\n"); if (device->driver) Modified: branches/ros-amd64-bringup/reactos/dll/directx/dsound/propset.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/d…
============================================================================== --- branches/ros-amd64-bringup/reactos/dll/directx/dsound/propset.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/directx/dsound/propset.c [iso-8859-1] Thu Apr 30 14:57:39 2009 @@ -109,7 +109,7 @@ S(prop).Set = *guidPropSet; S(prop).Id = dwPropID; S(prop).Flags = 0; /* unused */ - S(prop).InstanceId = (ULONG)This->dsb->device; + S(prop).InstanceId = (ULONG_PTR)This->dsb->device; hres = IDsDriverPropertySet_Get(ps, &prop, pInstanceData, cbInstanceData, pPropData, cbPropData, pcbReturned); @@ -145,7 +145,7 @@ S(prop).Set = *guidPropSet; S(prop).Id = dwPropID; S(prop).Flags = 0; /* unused */ - S(prop).InstanceId = (ULONG)This->dsb->device; + S(prop).InstanceId = (ULONG_PTR)This->dsb->device; hres = IDsDriverPropertySet_Set(ps,&prop,pInstanceData,cbInstanceData,pPropData,cbPropData); IDsDriverPropertySet_Release(ps); Modified: branches/ros-amd64-bringup/reactos/include/psdk/dsdriver.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
============================================================================== --- branches/ros-amd64-bringup/reactos/include/psdk/dsdriver.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/include/psdk/dsdriver.h [iso-8859-1] Thu Apr 30 14:57:39 2009 @@ -64,7 +64,7 @@ DWORD dwFlags; TCHAR szDesc[256]; TCHAR szDrvname[256]; - DWORD dnDevNode; + DWORD_PTR dnDevNode; WORD wVxdId; WORD wReserved; ULONG ulDeviceNum; @@ -120,7 +120,7 @@ GUID Set; ULONG Id; ULONG Flags; - ULONG InstanceId; + ULONG_PTR InstanceId; } DUMMYSTRUCTNAME; ULONGLONG Alignment; } DSPROPERTY,*PDSPROPERTY;
15 years, 8 months
1
0
0
0
[dreimer] 40752: Fix charch to be compatible to arch specific configuration, too. Powershell shortcuts are only generated if the PS files are installed too. Still untested.
by dreimer@svn.reactos.org
Author: dreimer Date: Thu Apr 30 14:53:51 2009 New Revision: 40752 URL:
http://svn.reactos.org/svn/reactos?rev=40752&view=rev
Log: Fix charch to be compatible to arch specific configuration, too. Powershell shortcuts are only generated if the PS files are installed too. Still untested. Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/charch.ps1 trunk/tools/RosBE/RosBE-Windows/Root/charch.cmd trunk/tools/RosBE/RosBE-Windows/RosBE.nsi Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/charch.ps1 URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershe…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/charch.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/charch.ps1 [iso-8859-1] Thu Apr 30 14:53:51 2009 @@ -17,6 +17,12 @@ # Refresh all needed Params by recalling the main Path setting CMD File. # function SYSPARAM { + + # arch specific settings. + if (Test-Path "$ENV:APPDATA\RosBE\rosbe-options-$_ROSBE_ARCH.ps1") { + IEX "& '$ENV:APPDATA\RosBE\rosbe-options-$_ROSBE_ARCH.ps1'" + } + IEX "& '$_ROSBE_BASEDIR\rosbe-gcc-env.ps1'" version } Modified: trunk/tools/RosBE/RosBE-Windows/Root/charch.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/cha…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/charch.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/charch.cmd [iso-8859-1] Thu Apr 30 14:53:51 2009 @@ -36,7 +36,13 @@ :EOA +:: arch specific settings. +if exist "%APPDATA%\RosBE\rosbe-options-%ROS_ARCH%.cmd" ( + call "%APPDATA%\RosBE\rosbe-options-%ROS_ARCH%.cmd" +) + call "%_ROSBE_BASEDIR%\rosbe-gcc-env.cmd" + "%_ROSBE_BASEDIR%\version.cmd" goto :EOC Modified: trunk/tools/RosBE/RosBE-Windows/RosBE.nsi URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/RosBE.ns…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/RosBE.nsi [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/RosBE.nsi [iso-8859-1] Thu Apr 30 14:53:51 2009 @@ -277,11 +277,12 @@ ;; ;; Add our start menu shortcuts. ;; - IfFileExists "$SMPROGRAMS\$ICONS_GROUP\ReactOS Build Environment.lnk" +10 0 + IfFileExists "$SMPROGRAMS\$ICONS_GROUP\ReactOS Build Environment.lnk" +12 0 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application CreateDirectory "$SMPROGRAMS\$ICONS_GROUP" SetOutPath $REACTOS_SOURCE_DIRECTORY CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\ReactOS Build Environment.lnk" "$SYSDIR\cmd.exe" '/t:0A /k "$INSTDIR\RosBE.cmd"' "$INSTDIR\rosbe.ico" + IfFileExists "$INSTDIR\RosBE.ps1" 0 +1 CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\ReactOS Build Environment - Powershell.lnk" "$SYSDIR\WindowsPowerShell\v1.0\powershell.exe" '-noexit &"$INSTDIR\RosBE.ps1"' "$INSTDIR\rosbe.ico" SetOutPath $PROFILE CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Standard MinGW Build Environment.lnk" "$SYSDIR\cmd.exe" '/k "$INSTDIR\MinGW.cmd"' "$INSTDIR\mingw.ico" @@ -299,9 +300,10 @@ ;; ;; Add our desktop shortcuts. ;; - IfFileExists "$DESKTOP\ReactOS Build Environment.lnk" +4 0 + IfFileExists "$DESKTOP\ReactOS Build Environment.lnk" +6 0 SetOutPath $REACTOS_SOURCE_DIRECTORY CreateShortCut "$DESKTOP\ReactOS Build Environment.lnk" "$SYSDIR\cmd.exe" '/k "$INSTDIR\RosBE.cmd"' "$INSTDIR\rosbe.ico" + IfFileExists "$INSTDIR\RosBE.ps1" 0 +1 CreateShortCut "$DESKTOP\ReactOS Build Environment - Powershell.lnk" "$SYSDIR\WindowsPowerShell\v1.0\powershell.exe" '-noexit &"$INSTDIR\RosBE.ps1"' "$INSTDIR\rosbe.ico" SetOutPath $PROFILE CreateShortCut "$DESKTOP\Standard MinGW Build Environment.lnk" "$SYSDIR\cmd.exe" '/k "$INSTDIR\MinGW.cmd"' "$INSTDIR\mingw.ico" @@ -313,9 +315,10 @@ ;; ;; Add our quick launch shortcuts. ;; - IfFileExists "$QUICKLAUNCH\ReactOS Build Environment.lnk" +4 0 + IfFileExists "$QUICKLAUNCH\ReactOS Build Environment.lnk" +6 0 SetOutPath $REACTOS_SOURCE_DIRECTORY CreateShortCut "$QUICKLAUNCH\ReactOS Build Environment.lnk" "$SYSDIR\cmd.exe" '/k "$INSTDIR\RosBE.cmd"' "$INSTDIR\rosbe.ico" + IfFileExists "$INSTDIR\RosBE.ps1" 0 +1 CreateShortCut "$QUICKLAUNCH\ReactOS Build Environment - Powershell.lnk" "$SYSDIR\WindowsPowerShell\v1.0\powershell.exe" '-noexit &"$INSTDIR\RosBE.ps1"' "$INSTDIR\rosbe.ico" SetOutPath $PROFILE CreateShortCut "$QUICKLAUNCH\Standard MinGW Build Environment.lnk" "$SYSDIR\cmd.exe" '/k "$INSTDIR\MinGW.cmd"' "$INSTDIR\mingw.ico" @@ -352,15 +355,19 @@ RMDir /r /REBOOTOK "$APPDATA\RosBE" MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 \ "Do you want to remove the Shortcuts? If you just want to Update to a new Version of RosBE, keep them. This keeps your previous settings." \ - IDNO +8 - IfFileExists "$DESKTOP\ReactOS Build Environment.lnk" 0 +2 + IDNO +12 + IfFileExists "$DESKTOP\ReactOS Build Environment.lnk" 0 +1 Delete /REBOOTOK "$DESKTOP\ReactOS Build Environment.lnk" - IfFileExists "$QUICKLAUNCH\ReactOS Build Environment.lnk" 0 +2 + IfFileExists "$QUICKLAUNCH\ReactOS Build Environment.lnk" 0 +1 Delete /REBOOTOK "$QUICKLAUNCH\ReactOS Build Environment.lnk" - IfFileExists "$DESKTOP\Standard MinGW Build Environment.lnk" 0 +2 + IfFileExists "$DESKTOP\Standard MinGW Build Environment.lnk" 0 +1 Delete /REBOOTOK "$DESKTOP\Standard MinGW Build Environment.lnk" - IfFileExists "$QUICKLAUNCH\Standard MinGW Build Environment.lnk" 0 +2 + IfFileExists "$QUICKLAUNCH\Standard MinGW Build Environment.lnk" 0 +1 Delete /REBOOTOK "$QUICKLAUNCH\Standard MinGW Build Environment.lnk" + IfFileExists "$DESKTOP\ReactOS Build Environment - Powershell.lnk" 0 +1 + Delete /REBOOTOK "$DESKTOP\ReactOS Build Environment - Powershell.lnk" + IfFileExists "$QUICKLAUNCH\ReactOS Build Environment - Powershell.lnk" 0 +1 + Delete /REBOOTOK "$QUICKLAUNCH\ReactOS Build Environment - Powershell.lnk" FunctionEnd Section Uninstall
15 years, 8 months
1
0
0
0
[dreimer] 40751: Make the setup modify the Powershell Security Settings to RemoteSigned. This makes it possible to use the scripts without any fiddling in PS. Add shortcuts for the Powershell Version. TBD: only make them if it was chosen to install the PS Scripts at all. Not tested yet!
by dreimer@svn.reactos.org
Author: dreimer Date: Thu Apr 30 13:54:45 2009 New Revision: 40751 URL:
http://svn.reactos.org/svn/reactos?rev=40751&view=rev
Log: Make the setup modify the Powershell Security Settings to RemoteSigned. This makes it possible to use the scripts without any fiddling in PS. Add shortcuts for the Powershell Version. TBD: only make them if it was chosen to install the PS Scripts at all. Not tested yet! Modified: trunk/tools/RosBE/RosBE-Windows/RosBE.nsi Modified: trunk/tools/RosBE/RosBE-Windows/RosBE.nsi URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/RosBE.ns…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/RosBE.nsi [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/RosBE.nsi [iso-8859-1] Thu Apr 30 13:54:45 2009 @@ -254,6 +254,7 @@ File /r Components\Powershell\sSVN.ps1 File /r Components\Powershell\update.ps1 File /r Components\Powershell\version.ps1 + WriteRegStr HKLM "Software\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell" "ExecutionPolicy" "RemoteSigned" SectionEnd Section "Update Script" SEC11 @@ -281,6 +282,7 @@ CreateDirectory "$SMPROGRAMS\$ICONS_GROUP" SetOutPath $REACTOS_SOURCE_DIRECTORY CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\ReactOS Build Environment.lnk" "$SYSDIR\cmd.exe" '/t:0A /k "$INSTDIR\RosBE.cmd"' "$INSTDIR\rosbe.ico" + CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\ReactOS Build Environment - Powershell.lnk" "$SYSDIR\WindowsPowerShell\v1.0\powershell.exe" '-noexit &"$INSTDIR\RosBE.ps1"' "$INSTDIR\rosbe.ico" SetOutPath $PROFILE CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Standard MinGW Build Environment.lnk" "$SYSDIR\cmd.exe" '/k "$INSTDIR\MinGW.cmd"' "$INSTDIR\mingw.ico" SetOutPath $INSTDIR @@ -300,6 +302,7 @@ IfFileExists "$DESKTOP\ReactOS Build Environment.lnk" +4 0 SetOutPath $REACTOS_SOURCE_DIRECTORY CreateShortCut "$DESKTOP\ReactOS Build Environment.lnk" "$SYSDIR\cmd.exe" '/k "$INSTDIR\RosBE.cmd"' "$INSTDIR\rosbe.ico" + CreateShortCut "$DESKTOP\ReactOS Build Environment - Powershell.lnk" "$SYSDIR\WindowsPowerShell\v1.0\powershell.exe" '-noexit &"$INSTDIR\RosBE.ps1"' "$INSTDIR\rosbe.ico" SetOutPath $PROFILE CreateShortCut "$DESKTOP\Standard MinGW Build Environment.lnk" "$SYSDIR\cmd.exe" '/k "$INSTDIR\MinGW.cmd"' "$INSTDIR\mingw.ico" SectionEnd @@ -313,6 +316,7 @@ IfFileExists "$QUICKLAUNCH\ReactOS Build Environment.lnk" +4 0 SetOutPath $REACTOS_SOURCE_DIRECTORY CreateShortCut "$QUICKLAUNCH\ReactOS Build Environment.lnk" "$SYSDIR\cmd.exe" '/k "$INSTDIR\RosBE.cmd"' "$INSTDIR\rosbe.ico" + CreateShortCut "$QUICKLAUNCH\ReactOS Build Environment - Powershell.lnk" "$SYSDIR\WindowsPowerShell\v1.0\powershell.exe" '-noexit &"$INSTDIR\RosBE.ps1"' "$INSTDIR\rosbe.ico" SetOutPath $PROFILE CreateShortCut "$QUICKLAUNCH\Standard MinGW Build Environment.lnk" "$SYSDIR\cmd.exe" '/k "$INSTDIR\MinGW.cmd"' "$INSTDIR\mingw.ico" SectionEnd
15 years, 8 months
1
0
0
0
[fireball] 40750: - Make debug pool return 8-bytes aligned pointers. The padding area (up to 7 bytes) is not being checked for overruns now. ReactOS fully boots and works with this change and a debug pool.
by fireball@svn.reactos.org
Author: fireball Date: Thu Apr 30 13:09:03 2009 New Revision: 40750 URL:
http://svn.reactos.org/svn/reactos?rev=40750&view=rev
Log: - Make debug pool return 8-bytes aligned pointers. The padding area (up to 7 bytes) is not being checked for overruns now. ReactOS fully boots and works with this change and a debug pool. Modified: trunk/reactos/ntoskrnl/mm/dbgpool.c Modified: trunk/reactos/ntoskrnl/mm/dbgpool.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/dbgpool.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/mm/dbgpool.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/dbgpool.c [iso-8859-1] Thu Apr 30 13:09:03 2009 @@ -24,12 +24,23 @@ NTAPI ExpIsPoolTagDebuggable(ULONG Tag) { +#if 0 if (Tag == TAG('C', 'a', 'l', 'l')) return FALSE; if (Tag == TAG('D', 'r', 'i', 'v')) return FALSE; if (Tag == TAG('D', 'e', 'v', 'i')) return FALSE; if (Tag == TAG('A', 'd', 'a', 'p')) return FALSE; - return FALSE;//TRUE; + if (Tag == TAG('S', 'e', 'S', 'd')) return FALSE; + if (Tag == TAG('O', 'b', 'D', 'i')) return FALSE; + if (Tag == TAG('O', 'b', 'N', 'm')) return FALSE; + if (Tag == TAG('O', 'b', 'N', 'D')) return FALSE; + if (Tag == TAG('O', 'b', 't', 'b')) return FALSE; + if (Tag == TAG('O', 'b', 'S', 'c')) return FALSE; + //if (Tag == TAG('S', 'e', 'S', 'i')) return FALSE; + //if (Tag == TAG('S', 'e', 'A', 'c')) return FALSE; +#endif + + return TRUE; } @@ -37,11 +48,15 @@ NTAPI ExpAllocateDebugPool(POOL_TYPE Type, ULONG Size, ULONG Tag, PVOID Caller, BOOLEAN EndOfPage) { - ULONG UserSize = Size + sizeof(EI_WHOLE_PAGE_HEADER); - ULONG TotalSize = UserSize + 2*PAGE_SIZE; + ULONG UserSize, TotalSize, AlignedSize; ULONG_PTR UserData, GuardArea; PEI_WHOLE_PAGE_HEADER Header; ULONG_PTR Buffer; + + /* Calculate sizes */ + AlignedSize = ROUND_UP(Size, MM_POOL_ALIGNMENT); + UserSize = AlignedSize + sizeof(EI_WHOLE_PAGE_HEADER); + TotalSize = UserSize + 2*PAGE_SIZE; /* Right now we support only end-of-page allocations */ ASSERT(EndOfPage); @@ -70,13 +85,13 @@ GuardArea = PAGE_ROUND_DOWN(Buffer + TotalSize - PAGE_SIZE + 1); /* Calculate user data and header pointers */ - UserData = GuardArea - Size; + UserData = GuardArea - AlignedSize; Header = (PEI_WHOLE_PAGE_HEADER)(UserData - sizeof(EI_WHOLE_PAGE_HEADER)); /* Fill out the header */ Header->ActualAddress = (PVOID)Buffer; Header->Tag = Tag; - Header->Size = Size; + Header->Size = AlignedSize; /* Protect the guard page */ MmSetPageProtect(NULL, (PVOID)GuardArea, PAGE_NOACCESS);
15 years, 8 months
1
0
0
0
[dreimer] 40749: Prepare for Version 1.4.2 and 64 bit Version 1.1. Time to mention Physicus now. ; -) The color thingy was his idea.
by dreimer@svn.reactos.org
Author: dreimer Date: Thu Apr 30 11:50:57 2009 New Revision: 40749 URL:
http://svn.reactos.org/svn/reactos?rev=40749&view=rev
Log: Prepare for Version 1.4.2 and 64 bit Version 1.1. Time to mention Physicus now. ;-) The color thingy was his idea. Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1 trunk/tools/RosBE/RosBE-Windows/Root/ChangeLog.txt trunk/tools/RosBE/RosBE-Windows/Root/LICENSE.txt trunk/tools/RosBE/RosBE-Windows/Root/README.odt trunk/tools/RosBE/RosBE-Windows/Root/RosBE.cmd trunk/tools/RosBE/RosBE-Windows/RosBE64.nsi Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1 URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershe…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1 [iso-8859-1] Thu Apr 30 11:50:57 2009 @@ -19,7 +19,7 @@ $ENV:APPDATA = $ENV:USERPROFILE } $ENV:PATH = "$ENV:SystemRoot\system32;$ENV:SystemRoot" -$global:_ROSBE_VERSION = 1.4 +$global:_ROSBE_VERSION = 1.4.2 $global:0 = $myInvocation.MyCommand.Definition $global:_ROSBE_BASEDIR = [System.IO.Path]::GetDirectoryName($0) $global:_ROSBE_MODE = "RosBE" Modified: trunk/tools/RosBE/RosBE-Windows/Root/ChangeLog.txt URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/Cha…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/ChangeLog.txt [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/ChangeLog.txt [iso-8859-1] Thu Apr 30 11:50:57 2009 @@ -1,4 +1,21 @@ -*** February xxth, 200x - RosBE 1.4 Released +*** May XXth, 2009 - RosBE 1.4.2 Released + +- Add the environment variables ROSBE_HOST_CFLAGS, ROSBE_HOST_CXXFLAGS, ROSBE_TARGET_CFLAGS, ROSBE_TARGET_CXXFLAGS + They contain existing pathes for the built-in include directories of the Host C/C++ and Target C/C++ compilers as compiler flags. + Required for kjk's rbuild work. (Colin Finck) +- Fixes for the Uninstall Routine to keep most settings, if wished, on a update. (Daniel Reimer) +- Remove some stupid setlocals. (Daniel Reimer) +- New Built GCC which supports the recent variable changes (Colin Finck) +- Make it possible to set different settings for any arch in RosBE. (Daniel Reimer, Timo Kreuzer) + + +*** April 07th, 2009 - RosBE 1.4.1 Released + +- Updated:SVN 1.6 included (Daniel Reimer) +- Fixed: Sped up starting of rosbe (Daniel Reimer) +- Fixed: Hopefully fixed bison. (Daniel Reimer) + +*** February 01st, 2009 - RosBE 1.4 Released "Quote of the year: A loooong time ago there was something called Batch. It was a old scripting "language" which you could use for some stuff, but with hacks, so ugly, you Modified: trunk/tools/RosBE/RosBE-Windows/Root/LICENSE.txt URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/LIC…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/LICENSE.txt [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/LICENSE.txt [iso-8859-1] Thu Apr 30 11:50:57 2009 @@ -1,4 +1,4 @@ -ReactOS Build Environment v1.3 +ReactOS Build Environment v1.4.2 Various parts of the ReactOS Build Environment are under different license's, the license's are as follows. (The complete text for each license is included in this document excluding Subversion) @@ -87,7 +87,8 @@ The precise terms and conditions for copying, distribution and modification follow. - + + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION @@ -142,7 +143,8 @@ License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) - + + These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in @@ -200,7 +202,8 @@ access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. - + + 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is @@ -257,7 +260,8 @@ This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - + + 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License @@ -310,7 +314,8 @@ POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS - + + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest @@ -1103,7 +1108,8 @@ want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. - + + Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect @@ -1150,7 +1156,8 @@ Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. - + + GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION @@ -1197,7 +1204,8 @@ You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - + + 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 @@ -1255,7 +1263,8 @@ ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - + + Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. @@ -1306,7 +1315,8 @@ distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - + + 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work @@ -1360,7 +1370,8 @@ accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - + + 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined @@ -1401,7 +1412,8 @@ restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. - + + 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or @@ -1453,7 +1465,8 @@ the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - + + 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is @@ -1487,7 +1500,8 @@ DAMAGES. END OF TERMS AND CONDITIONS - + + Appendix: How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest @@ -1592,7 +1606,8 @@ that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. - + + Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a @@ -1648,7 +1663,8 @@ "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. - + + GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION @@ -1695,7 +1711,8 @@ You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - + + 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 @@ -1753,7 +1770,8 @@ ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - + + Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. @@ -1804,7 +1822,8 @@ distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - + + 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work @@ -1866,7 +1885,8 @@ accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - + + 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined @@ -1907,7 +1927,8 @@ restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. - + + 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or @@ -1959,7 +1980,8 @@ the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - + + 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is @@ -1993,7 +2015,8 @@ DAMAGES. END OF TERMS AND CONDITIONS - + + How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest Modified: trunk/tools/RosBE/RosBE-Windows/Root/README.odt URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/REA…
============================================================================== Binary files - no diff available. Modified: trunk/tools/RosBE/RosBE-Windows/Root/RosBE.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/Ros…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/RosBE.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/RosBE.cmd [iso-8859-1] Thu Apr 30 11:50:57 2009 @@ -21,7 +21,7 @@ :: if not defined APPDATA set APPDATA=%USERPROFILE% set PATH=%SystemRoot%\system32;%SystemRoot% -set _ROSBE_VERSION=1.4 +set _ROSBE_VERSION=1.4.2 set _ROSBE_BASEDIR=%~dp0 set _ROSBE_BASEDIR=%_ROSBE_BASEDIR:~0,-1% set _ROSBE_MODE=RosBE Modified: trunk/tools/RosBE/RosBE-Windows/RosBE64.nsi URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/RosBE64.…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/RosBE64.nsi [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/RosBE64.nsi [iso-8859-1] Thu Apr 30 11:50:57 2009 @@ -1,5 +1,5 @@ !define PRODUCT_NAME "ReactOS Build Environment for Windows - 64 Bit Target Compiler" -!define PRODUCT_VERSION "1.0" +!define PRODUCT_VERSION "1.1" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\RosBE.cmd" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" !define PRODUCT_UNINST_ROOT_KEY "HKCU" @@ -17,15 +17,15 @@ ;; ;; Add version/product information metadata to the installation file. ;; -VIAddVersionKey /LANG=1033 "FileVersion" "1.0.0.0" +VIAddVersionKey /LANG=1033 "FileVersion" "1.1.0.0" VIAddVersionKey /LANG=1033 "ProductVersion" "${PRODUCT_VERSION}" VIAddVersionKey /LANG=1033 "ProductName" "${PRODUCT_NAME}" VIAddVersionKey /LANG=1033 "Comments" "This installer was written by Peter Ward and Daniel Reimer using Nullsoft Scriptable Install System (
http://nsis.sourceforge.net/
)" VIAddVersionKey /LANG=1033 "CompanyName" "ReactOS Team" -VIAddVersionKey /LANG=1033 "LegalTrademarks" "Copyright © 2008 ReactOS Team" -VIAddVersionKey /LANG=1033 "LegalCopyright" "Copyright © 2008 ReactOS Team" +VIAddVersionKey /LANG=1033 "LegalTrademarks" "Copyright © 2009 ReactOS Team" +VIAddVersionKey /LANG=1033 "LegalCopyright" "Copyright © 2009 ReactOS Team" VIAddVersionKey /LANG=1033 "FileDescription" "${PRODUCT_NAME} Setup" -VIProductVersion "1.0.0.0" +VIProductVersion "1.1.0.0" CRCCheck force SetCompressor /FINAL /SOLID lzma
15 years, 8 months
1
0
0
0
[dreimer] 40748: rename the app to options64 and add it to the nsi installer. fix options.cmd/ps1 to select the right options.exe
by dreimer@svn.reactos.org
Author: dreimer Date: Thu Apr 30 11:32:09 2009 New Revision: 40748 URL:
http://svn.reactos.org/svn/reactos?rev=40748&view=rev
Log: rename the app to options64 and add it to the nsi installer. fix options.cmd/ps1 to select the right options.exe Added: trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options64.c - copied, changed from r40747, trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.c trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options64.exe.Manifest - copied unchanged from r40747, trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.exe.Manifest trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options64.h - copied, changed from r40747, trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.h trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options64.ico - copied unchanged from r40747, trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.ico trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options64.rc - copied, changed from r40747, trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.rc Removed: trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.c trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.exe.Manifest trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.h trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.ico trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.rc Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/options.ps1 trunk/tools/RosBE/RosBE-Windows/Root/options.cmd trunk/tools/RosBE/RosBE-Windows/RosBE64.nsi trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/makefile Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/options.ps1 URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershe…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/options.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/options.ps1 [iso-8859-1] Thu Apr 30 11:32:09 2009 @@ -9,20 +9,33 @@ $host.ui.RawUI.WindowTitle = "Options" + +if "%ROS_ARCH%" == "amd64" ( + $options=$_ROSBE_BASEDIR\Tools\options64.exe + $cfgfile=$ENV:APPDATA\RosBE\rosbe-options-amd64.cmd +else + $options=$_ROSBE_BASEDIR\Tools\options.exe + $cfgfile=$ENV:APPDATA\RosBE\rosbe-options.cmd +) + # # Run options.exe # -if (Test-Path "$_ROSBE_BASEDIR\Tools\options.exe") { + +if (Test-Path "$options") { Push-Location "$_ROSBE_BASEDIR" - & "$_ROSBE_BASEDIR\Tools\options.exe" | out-null + & "$options" | out-null Pop-Location - if (Test-Path "$ENV:APPDATA\RosBE\rosbe-options.cmd") { - & "$ENV:APPDATA\RosBE\rosbe-options.cmd" + if (Test-Path "$cfgfile") { + & "$cfgfile" } } else { - "ERROR: options.exe was not found." + "ERROR: options executable was not found." } if ($_ROSBE_VERSION -ne $null) { $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" } + +$options = $null +$cfgfile = $null Modified: trunk/tools/RosBE/RosBE-Windows/Root/options.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/opt…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/options.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/options.cmd [iso-8859-1] Thu Apr 30 11:32:09 2009 @@ -14,20 +14,31 @@ title Options +if "%ROS_ARCH%" == "amd64" ( + set options=%_ROSBE_BASEDIR%\Tools\options64.exe + set cfgfile=%APPDATA%\RosBE\rosbe-options-amd64.cmd +else + set options=%_ROSBE_BASEDIR%\Tools\options.exe + set cfgfile=%APPDATA%\RosBE\rosbe-options.cmd +) + :: :: Run options.exe :: -if exist "%_ROSBE_BASEDIR%\Tools\options.exe" ( +if exist "%options%" ( pushd "%_ROSBE_BASEDIR%" - call "%_ROSBE_BASEDIR%\Tools\options.exe" + call "%options%" popd - if exist "%APPDATA%\RosBE\rosbe-options.cmd" ( - call "%APPDATA%\RosBE\rosbe-options.cmd" + if exist "%cfgfile%" ( + call "%cfgfile%" ) ) else ( - echo ERROR: options.exe was not found. + echo ERROR: options executable was not found. ) if defined _ROSBE_VERSION ( title ReactOS Build Environment %_ROSBE_VERSION% ) + +set options= +set cfgfile= Modified: trunk/tools/RosBE/RosBE-Windows/RosBE64.nsi URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/RosBE64.…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/RosBE64.nsi [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/RosBE64.nsi [iso-8859-1] Thu Apr 30 11:32:09 2009 @@ -108,6 +108,18 @@ SetOutPath "$INSTDIR" SetOverwrite try File /r Root\charch.cmd + File /r Root\charch.ps1 + File /r Root\options.cmd + File /r Root\options.ps1 + SetOutPath "$INSTDIR\Tools" + SetOverwrite try + File /r Components\Tools\options64.exe + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + CreateDirectory "$SMPROGRAMS\$ICONS_GROUP" + SetOutPath $INSTDIR + CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Options x86-64.lnk" \ + "$INSTDIR\Tools\options64.exe" + !insertmacro MUI_STARTMENU_WRITE_END SectionEnd Section -MinGWGCCNASM SEC02 @@ -182,6 +194,7 @@ ;; RMDir /r /REBOOTOK "$INSTDIR\x86_64" Delete /REBOOTOK "$INSTDIR\charch.cmd" + Delete /REBOOTOK "$INSTDIR\charch.ps1" Delete /REBOOTOK "$INSTDIR\Uninstall-${PRODUCT_VERSION}.exe" ;; Whoever dares to change this back into: RMDir /r /REBOOTOK "$INSTDIR" will be KILLED!!! RMDir /REBOOTOK "$INSTDIR" Modified: trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/makefile URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Tools/co…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/makefile [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/makefile [iso-8859-1] Thu Apr 30 11:32:09 2009 @@ -1,4 +1,4 @@ -TARGET := options.exe +TARGET := options64.exe .PHONY: all Removed: trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.c URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Tools/co…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.c [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.c (removed) @@ -1,641 +1,0 @@ -/* - * PROJECT: RosBE Options Dialog - * LICENSE: GNU General Public License v2. (see LICENSE.txt) - * FILE: Tools/config/options.c - * PURPOSE: Configuring RosBE - * COPYRIGHT: Copyright 2007 Maarten Bosma - * Copyright 2007 Pierre Schweitzer - * - */ - -#include "options.h" - -typedef struct _OPTIONS_DLG -{ - HWND hwndDlg; - HWND hwndToolTip; - HICON hIcon; - HFONT hFont; - SETTINGS Settings; -} OPTIONS_DLG, *POPTIONS_DLG; - -HINSTANCE hInstance; - -BOOL CreateDir(HWND hwnd, WCHAR* dir) -{ - WCHAR msgerror[256]; - - if (0 > (LONG)GetFileAttributes(dir)) - { - if (CreateDirectory(dir, NULL) == 0) - { - LoadString(hInstance, MSG_DIREFAILED, msgerror, 256); - MessageBox(hwnd, msgerror, NULL, MB_ICONERROR); - return FALSE; - } - } - return TRUE; -} - -static -const -WCHAR* -getConfigFileCMD() -{ - static WCHAR filename[MAX_PATH]; - if (SHGetSpecialFolderPathW(NULL, filename, CSIDL_APPDATA, FALSE)) - { - if ((wcslen(filename) + wcslen(L"\\RosBE\\rosbe-options-amd64.cmd")) < MAX_PATH) - wcscat(filename, L"\\RosBE\\rosbe-options-amd64.cmd"); - } - else - { - wcscpy(filename, L"rosbe-options-amd64.cmd"); - } - return filename; -} - -static -const -WCHAR* -getConfigFilePS1() -{ - static WCHAR filename[MAX_PATH]; - if (SHGetSpecialFolderPathW(NULL, filename, CSIDL_APPDATA, FALSE)) - { - if ((wcslen(filename) + wcslen(L"\\RosBE\\rosbe-options-amd64.ps1")) < MAX_PATH) - wcscat(filename, L"\\RosBE\\rosbe-options-amd64.ps1"); - } - else - { - wcscpy(filename, L"rosbe-options-amd64.ps1"); - } - return filename; -} - -INT -WriteSettings(POPTIONS_DLG infoPtr) -{ - INT foreground, background; - BOOL showtime, writelog, useccache, strip, nostrip, objstate, outstate; - WCHAR logdir[MAX_PATH], objdir[MAX_PATH], outdir[MAX_PATH], mingwpath[MAX_PATH], checkmgw[MAX_PATH]; - WCHAR msgerror[256]; - HANDLE hFile; - FILE *pFilecmd, *pFileps1; - - showtime = (SendDlgItemMessage(infoPtr->hwndDlg, ID_SHOWBUILDTIME, BM_GETCHECK, 0, 0) == BST_CHECKED); - writelog = (SendDlgItemMessage(infoPtr->hwndDlg, ID_SAVELOGS, BM_GETCHECK, 0, 0) == BST_CHECKED); - useccache = (SendDlgItemMessage(infoPtr->hwndDlg, ID_USECCACHE, BM_GETCHECK, 0, 0) == BST_CHECKED); - strip = (SendDlgItemMessageW(infoPtr->hwndDlg, ID_STRIP, BM_GETCHECK, 0, 0) == BST_CHECKED); - nostrip = (SendDlgItemMessageW(infoPtr->hwndDlg, ID_NOSTRIP, BM_GETCHECK, 0, 0) == BST_CHECKED); - objstate = (SendDlgItemMessage(infoPtr->hwndDlg, ID_OTHEROBJ, BM_GETCHECK, 0, 0) == BST_CHECKED); - outstate = (SendDlgItemMessageW(infoPtr->hwndDlg, ID_OTHEROUT, BM_GETCHECK, 0, 0) == BST_CHECKED); - foreground = (INT) SendDlgItemMessageW(infoPtr->hwndDlg, IDC_FONT, CB_GETCURSEL, 0, 0); - background = (INT) SendDlgItemMessageW(infoPtr->hwndDlg, IDC_BACK, CB_GETCURSEL, 0, 0); - GetDlgItemTextW(infoPtr->hwndDlg, ID_LOGDIR, logdir, MAX_PATH); - GetDlgItemTextW(infoPtr->hwndDlg, ID_MGWDIR, mingwpath, MAX_PATH); - GetDlgItemTextW(infoPtr->hwndDlg, ID_OBJDIR, objdir, MAX_PATH); - GetDlgItemTextW(infoPtr->hwndDlg, ID_OUTDIR, outdir, MAX_PATH); - - if (writelog && (logdir[0] != 0)) - if (!CreateDir(infoPtr->hwndDlg, logdir)) - return FALSE; - - if (objstate && (objdir[0] != 0)) - if (!CreateDir(infoPtr->hwndDlg, objdir)) - return FALSE; - - if (outstate && (outdir[0] != 0)) - if (!CreateDir(infoPtr->hwndDlg, outdir)) - return FALSE; - - wcscpy(checkmgw, mingwpath); - if ((wcslen(checkmgw) + wcslen(L"\\bin\\gcc.exe")) < MAX_PATH) - wcscat(checkmgw, L"\\bin\\gcc.exe"); - hFile = CreateFile(checkmgw, 0, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (hFile == INVALID_HANDLE_VALUE) - { - LoadString(hInstance, MSG_NOGCCFOUND, msgerror, 256); - MessageBox(infoPtr->hwndDlg, msgerror, NULL, MB_ICONERROR); - return FALSE; - } - CloseHandle(hFile); - - pFilecmd = _wfopen(getConfigFileCMD(), L"w"); - pFileps1 = _wfopen(getConfigFilePS1(), L"w"); - - if (pFilecmd) - { - fwprintf(pFilecmd, L"::\n"); - fwprintf(pFilecmd, L":: This file has been automatically generated by the ReactOS\n"); - fwprintf(pFilecmd, L":: Build Environment options utility.\n"); - fwprintf(pFilecmd, L"::\n\n"); - fwprintf(pFilecmd, L"color %X%X\n", background, foreground); - fwprintf(pFilecmd, L"set _ROSBE_SHOWTIME=%d\n", showtime); - fwprintf(pFilecmd, L"set _ROSBE_USECCACHE=%d\n", useccache); - fwprintf(pFilecmd, L"set _ROSBE_STRIP=%d\n", strip); - fwprintf(pFilecmd, L"set _ROSBE_NOSTRIP=%d\n", nostrip); - fwprintf(pFilecmd, L"set _ROSBE_WRITELOG=%d\n", writelog); - if (logdir[0] != 0) fwprintf(pFilecmd, L"set _ROSBE_LOGDIR=%s\n", logdir); - if (mingwpath[0] != 0) fwprintf(pFilecmd, L"set _ROSBE_TARGET_MINGWPATH=%s\n", mingwpath); - if ((objdir[0] != 0) && objstate) fwprintf(pFilecmd, L"set _ROSBE_OBJPATH=%s\n", objdir); - if ((outdir[0] != 0) && outstate) fwprintf(pFilecmd, L"set _ROSBE_OUTPATH=%s\n", outdir); - } - - if (pFileps1) - { - fwprintf(pFileps1, L"#\n"); - fwprintf(pFileps1, L"# This file has been automatically generated by the ReactOS\n"); - fwprintf(pFileps1, L"# Build Environment options utility.\n"); - fwprintf(pFileps1, L"#\n\n"); - fwprintf(pFileps1, L"(Get-Host).UI.RawUI.ForegroundColor = 0x%X\n", foreground); - fwprintf(pFileps1, L"(Get-Host).UI.RawUI.BackgroundColor = 0x%X\n", background); - fwprintf(pFileps1, L"clear-host\n"); - fwprintf(pFileps1, L"$_ROSBE_SHOWTIME = %d\n", showtime); - fwprintf(pFileps1, L"$_ROSBE_USECCACHE = %d\n", useccache); - fwprintf(pFileps1, L"$_ROSBE_STRIP = %d\n", strip); - fwprintf(pFileps1, L"$_ROSBE_NOSTRIP = %d\n", nostrip); - fwprintf(pFileps1, L"$_ROSBE_WRITELOG = %d\n", writelog); - if (logdir[0] != 0) fwprintf(pFileps1, L"$_ROSBE_LOGDIR = \"%s\"\n", logdir); - if (mingwpath[0] != 0) fwprintf(pFileps1, L"$_ROSBE_TARGET_MINGWPATH = \"%s\"\n", mingwpath); - if ((objdir[0] != 0) && objstate) fwprintf(pFileps1, L"$_ROSBE_OBJPATH = \"%s\"\n", objdir); - if ((outdir[0] != 0) && outstate) fwprintf(pFileps1, L"$_ROSBE_OUTPATH = \"%s\"\n", outdir); - } - - if (pFilecmd && pFileps1) - { - fclose(pFilecmd); - fclose(pFileps1); - return TRUE; - } - - if (!pFilecmd) - { - fclose(pFilecmd); - fclose(pFileps1); - LoadString(hInstance, MSG_CMDFFAILED, msgerror, 256); - MessageBox(infoPtr->hwndDlg, msgerror, NULL, MB_ICONERROR); - } - - if (!pFileps1) - { - fclose(pFilecmd); - fclose(pFileps1); - LoadString(hInstance, MSG_PS1FFAILED, msgerror, 256); - MessageBox(infoPtr->hwndDlg, msgerror, NULL, MB_ICONERROR); - } - return FALSE; -} - -VOID LoadSettings(POPTIONS_DLG infoPtr) -{ - FILE *pFile; - WCHAR *ptr, *ptr2; - WCHAR WTempLine[25+MAX_PATH]; - WCHAR SBTitle[256]; - PSETTINGS LoadedSettings = &infoPtr->Settings; - - pFile = _wfopen(getConfigFileCMD(), L"r"); - if (pFile) - { - while (fgetws(WTempLine, 24+MAX_PATH, pFile)) - { - ptr = wcstok(WTempLine, L" "); - if (wcscmp(ptr, L"color") == 0) - { - ptr = wcstok(NULL, L" "); - ptr[2] = ptr[1]; - ptr[1] = 0; - LoadedSettings->background = wcstol(&ptr[0], NULL, 16); - LoadedSettings->foreground = wcstol(&ptr[2], NULL, 16); - } - else if (wcscmp(ptr, L"set") == 0) - { - ptr = wcstok(NULL, L"\0"); - ptr = wcstok(ptr, L"="); - ptr2 = wcstok(NULL, L"="); - if (wcscmp(ptr, L"_ROSBE_SHOWTIME") == 0) - LoadedSettings->showtime = wcstol(ptr2, NULL, 2); - else if (wcscmp(ptr, L"_ROSBE_USECCACHE") == 0) - LoadedSettings->useccache = wcstol(ptr2, NULL, 2); - else if (wcscmp(ptr, L"_ROSBE_STRIP") == 0) - LoadedSettings->strip = wcstol(ptr2, NULL, 2); - else if (wcscmp(ptr, L"_ROSBE_NOSTRIP") == 0) - LoadedSettings->nostrip = wcstol(ptr2, NULL, 2); - else if (wcscmp(ptr, L"_ROSBE_WRITELOG") == 0) - LoadedSettings->writelog = wcstol(ptr2, NULL, 2); - else if (wcscmp(ptr, L"_ROSBE_LOGDIR") == 0) - wcsncpy(LoadedSettings->logdir, ptr2, wcslen(ptr2)-1); - else if (wcscmp(ptr, L"_ROSBE_TARGET_MINGWPATH") == 0) - wcsncpy(LoadedSettings->mingwpath, ptr2, wcslen(ptr2)-1); - else if (wcscmp(ptr, L"_ROSBE_OBJPATH") == 0) - wcsncpy(LoadedSettings->objdir, ptr2, wcslen(ptr2)-1); - else if (wcscmp(ptr, L"_ROSBE_OUTPATH") == 0) - wcsncpy(LoadedSettings->outdir, ptr2, wcslen(ptr2)-1); - } - } - fclose(pFile); - LoadString(hInstance, MSG_SETLOADSUC, SBTitle, 256); - SetDlgItemText(infoPtr->hwndDlg, ID_STATUSBAR, SBTitle); - } - else - { - LoadedSettings->foreground = 0xb; - LoadedSettings->background = 0; - LoadedSettings->showtime = 1; - LoadedSettings->writelog = 1; - GetCurrentDirectory(MAX_PATH, LoadedSettings->mingwpath); - if ((wcslen(LoadedSettings->mingwpath) + wcslen(MINGWVERSION)) < MAX_PATH) - wcscat(LoadedSettings->mingwpath, MINGWVERSION); - - LoadString(hInstance, HLP_DEFAULTMSG, SBTitle, 256); - SetDlgItemText(infoPtr->hwndDlg, ID_STATUSBAR, SBTitle); - } - SendDlgItemMessageW(infoPtr->hwndDlg, IDC_FONT, CB_SETCURSEL, LoadedSettings->foreground, 0); - SendDlgItemMessageW(infoPtr->hwndDlg, IDC_BACK, CB_SETCURSEL, LoadedSettings->background, 0); - SendDlgItemMessage(infoPtr->hwndDlg, ID_SHOWBUILDTIME, BM_SETCHECK, LoadedSettings->showtime, 0); - SendDlgItemMessage(infoPtr->hwndDlg, ID_SAVELOGS, BM_SETCHECK, LoadedSettings->writelog, 0); - if (LoadedSettings->writelog) - { - EnableWindow(GetDlgItem(infoPtr->hwndDlg, ID_BROWSE), TRUE); - EnableWindow(GetDlgItem(infoPtr->hwndDlg, ID_LOGDIR), TRUE); - } - SendDlgItemMessage(infoPtr->hwndDlg, ID_USECCACHE, BM_SETCHECK, LoadedSettings->useccache, 0); - SendDlgItemMessageW(infoPtr->hwndDlg, ID_STRIP, BM_SETCHECK, LoadedSettings->strip, 0); - SendDlgItemMessageW(infoPtr->hwndDlg, ID_NOSTRIP, BM_SETCHECK, LoadedSettings->nostrip, 0); - SetDlgItemText(infoPtr->hwndDlg, ID_MGWDIR, LoadedSettings->mingwpath); - SetDlgItemText(infoPtr->hwndDlg, ID_LOGDIR, LoadedSettings->logdir); - if (LoadedSettings->objdir[0] != 0) - { - LoadedSettings->objstate = 1; - SetDlgItemText(infoPtr->hwndDlg, ID_OBJDIR, LoadedSettings->objdir); - SendDlgItemMessage(infoPtr->hwndDlg, ID_OTHEROBJ, BM_SETCHECK, BST_CHECKED, 0); - EnableWindow(GetDlgItem(infoPtr->hwndDlg, ID_BROWSEOBJ), TRUE); - EnableWindow(GetDlgItem(infoPtr->hwndDlg, ID_OBJDIR), TRUE); - } - if (LoadedSettings->outdir[0] != 0) - { - LoadedSettings->outstate = 1; - SetDlgItemText(infoPtr->hwndDlg, ID_OUTDIR, LoadedSettings->outdir); - SendDlgItemMessage(infoPtr->hwndDlg, ID_OTHEROUT, BM_SETCHECK, BST_CHECKED, 0); - EnableWindow(GetDlgItem(infoPtr->hwndDlg, ID_BROWSEOUT), TRUE); - EnableWindow(GetDlgItem(infoPtr->hwndDlg, ID_OUTDIR), TRUE); - } -} - -VOID SetSaveState(POPTIONS_DLG infoPtr) -{ - INT foreground, background; - BOOL showtime, writelog, useccache, strip, nostrip, objstate, outstate; - WCHAR logdir[MAX_PATH], objdir[MAX_PATH], outdir[MAX_PATH], mingwpath[MAX_PATH]; - BOOL StateObj = TRUE, StateOut = TRUE, StateLog = TRUE, State = TRUE; - PSETTINGS DefaultSettings = &infoPtr->Settings; - - showtime = (SendDlgItemMessage(infoPtr->hwndDlg, ID_SHOWBUILDTIME, BM_GETCHECK, 0, 0) == BST_CHECKED); - writelog = (SendDlgItemMessage(infoPtr->hwndDlg, ID_SAVELOGS, BM_GETCHECK, 0, 0) == BST_CHECKED); - useccache = (SendDlgItemMessage(infoPtr->hwndDlg, ID_USECCACHE, BM_GETCHECK, 0, 0) == BST_CHECKED); - strip = (SendDlgItemMessageW(infoPtr->hwndDlg, ID_STRIP, BM_GETCHECK, 0, 0) == BST_CHECKED); - nostrip = (SendDlgItemMessageW(infoPtr->hwndDlg, ID_NOSTRIP, BM_GETCHECK, 0, 0) == BST_CHECKED); - objstate = (SendDlgItemMessageW(infoPtr->hwndDlg, ID_OTHEROBJ, BM_GETCHECK, 0, 0) == BST_CHECKED); - outstate = (SendDlgItemMessageW(infoPtr->hwndDlg, ID_OTHEROUT, BM_GETCHECK, 0, 0) == BST_CHECKED); - foreground = (INT) SendDlgItemMessageW(infoPtr->hwndDlg, IDC_FONT, CB_GETCURSEL, 0, 0); - background = (INT) SendDlgItemMessageW(infoPtr->hwndDlg, IDC_BACK, CB_GETCURSEL, 0, 0); - GetDlgItemTextW(infoPtr->hwndDlg, ID_LOGDIR, logdir, MAX_PATH); - GetDlgItemTextW(infoPtr->hwndDlg, ID_MGWDIR, mingwpath, MAX_PATH); - GetDlgItemTextW(infoPtr->hwndDlg, ID_OBJDIR, objdir, MAX_PATH); - GetDlgItemTextW(infoPtr->hwndDlg, ID_OUTDIR, outdir, MAX_PATH); - - if (objstate) - if ((wcscmp(objdir, DefaultSettings->objdir) != 0) && (wcslen(objdir) > 0)) - StateObj = FALSE; - if (outstate) - if ((wcscmp(outdir, DefaultSettings->outdir) != 0) && (wcslen(outdir) > 0)) - StateOut = FALSE; - if (writelog) - if ((wcscmp(logdir, DefaultSettings->logdir) != 0) && (wcslen(logdir) > 0)) - StateLog = FALSE; - - State ^= ((foreground == DefaultSettings->foreground) && (background == DefaultSettings->background) && - (showtime == DefaultSettings->showtime) && (writelog == DefaultSettings->writelog) && - (useccache == DefaultSettings->useccache) && (strip == DefaultSettings->strip) && - (objstate == DefaultSettings->objstate) && (outstate == DefaultSettings->outstate) && - (StateLog) && (wcscmp(mingwpath, DefaultSettings->mingwpath) == 0) && - (StateObj) && (StateOut) && (nostrip == DefaultSettings->nostrip)); - - EnableWindow(GetDlgItem(infoPtr->hwndDlg, ID_OK), State); -} - -INT CALLBACK -BrowseProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - HWND hwndParent; - hwndParent = GetWindow(Dlg, GW_OWNER); - switch (Msg) - { - case BFFM_INITIALIZED: - { - WCHAR ActualPath[MAX_PATH]; - GetDlgItemText(hwndParent, (INT) lParam, ActualPath, MAX_PATH); - SendMessage(Dlg, BFFM_SETSELECTION, TRUE, (LPARAM)ActualPath); - break; - } - case BFFM_VALIDATEFAILED: - { - if (lParam != ID_MGWDIR) - { - WCHAR BoxMsg[256], BoxTitle[128]; - size_t PathLen; - LoadString(hInstance, MSG_WARNINGBOX, BoxTitle, 128); - LoadString(hInstance, MSG_INVALIDDIR, BoxMsg, 256); - if (MessageBox(Dlg, BoxMsg, BoxTitle, MB_ICONWARNING | MB_YESNO) == IDYES) - { - PathLen = wcslen((LPWSTR)wParam); - if (wcscmp((LPWSTR)wParam+PathLen, L"\\")) - wcsset((LPWSTR)wParam+(PathLen-1), '\0'); - if (CreateDirectory((LPWSTR)wParam, NULL) == 0) - { - LoadString(hInstance, MSG_DIREFAILED, BoxMsg, 256); - MessageBox(Dlg, BoxMsg, NULL, MB_ICONERROR); - } - else - { - SetDlgItemText(hwndParent, (INT) lParam, (LPWSTR)wParam); - } - } - } - break; - } - } - return FALSE; -} - -static VOID -AssociateToolWithControl(POPTIONS_DLG infoPtr, int ControlId, UINT StringId) -{ - HWND hwndControl; - TOOLINFO ti; - - hwndControl = GetDlgItem(infoPtr->hwndDlg, ControlId); - if (infoPtr->hwndToolTip && hwndControl) - { - ZeroMemory(&ti, sizeof(ti)); - ti.cbSize = sizeof(ti); - ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS; - ti.hwnd = infoPtr->hwndDlg; - ti.uId = (UINT_PTR)hwndControl; - ti.hinst = hInstance; - ti.lpszText = MAKEINTRESOURCE(StringId); - - SendMessage(infoPtr->hwndToolTip, TTM_ADDTOOL, 0, (LPARAM)&ti); - } -} - -INT_PTR CALLBACK -DlgProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - POPTIONS_DLG infoPtr = NULL; - - if (Msg != WM_INITDIALOG) - { - infoPtr = (POPTIONS_DLG)GetWindowLongPtr(Dlg, DWLP_USER); - if (infoPtr == NULL) - return FALSE; - } - - switch (Msg) - { - case WM_INITDIALOG: - { - static const struct { - int ControlId; - UINT StringId; - } ToolTipAssociations[] = { - {IDC_BACK, HLP_BACKCOLORC}, - {IDC_FONT, HLP_FONTCOLORC}, - {ID_SHOWBUILDTIME, HLP_SBUILDTIME}, - {ID_USECCACHE, HLP_CCACHEUSED}, - {ID_STRIP, HLP_STRIPEDEXE}, - {ID_NOSTRIP, HLP_NOSTRIP}, - {ID_MGWDIR, HLP_FINDMGWDIR}, - {ID_BROWSEMGW, HLP_FINDMGWDIR}, - {ID_LOGDIR, HLP_FINDLOGDIR}, - {ID_BROWSE, HLP_FINDLOGDIR}, - {ID_SAVELOGS, HLP_FINDLOGDIR}, - {ID_OBJDIR, HLP_FINDOBJDIR}, - {ID_BROWSEOBJ, HLP_FINDOBJDIR}, - {ID_OTHEROBJ, HLP_FINDOBJDIR}, - {ID_OUTDIR, HLP_FINDOUTDIR}, - {ID_BROWSEOUT, HLP_FINDOUTDIR}, - {ID_OTHEROUT, HLP_FINDOUTDIR}, - {ID_OK, HLP_SAVEBUTTON}, - {ID_CANCEL, HLP_QUITBUTTON}, - }; - int i; - UINT j; - LOGFONT lf; - WCHAR TempColor[256]; - - infoPtr = (POPTIONS_DLG)lParam; - infoPtr->hwndDlg = Dlg; - - SetWindowLongPtr(Dlg, DWLP_USER, (LONG_PTR)infoPtr); - - infoPtr->hwndToolTip = CreateWindowEx(0, - TOOLTIPS_CLASS, - NULL, - WS_POPUP | TTS_ALWAYSTIP, - CW_USEDEFAULT, - CW_USEDEFAULT, - CW_USEDEFAULT, - CW_USEDEFAULT, - infoPtr->hwndDlg, - NULL, - hInstance, - NULL); - - for (i = 0; i < sizeof(ToolTipAssociations) / sizeof(ToolTipAssociations[0]); i++) - AssociateToolWithControl(infoPtr, ToolTipAssociations[i].ControlId, ToolTipAssociations[i].StringId); - - infoPtr->hIcon = LoadImage( hInstance, - MAKEINTRESOURCE(ID_OPTICON), - IMAGE_ICON, - GetSystemMetrics(SM_CXSMICON), - GetSystemMetrics(SM_CYSMICON), - 0); - if(infoPtr->hIcon) - SendMessage(Dlg, WM_SETICON, ICON_SMALL, (LPARAM)infoPtr->hIcon); - - GetObject(GetStockObject(ANSI_FIXED_FONT), sizeof(LOGFONT), &lf); - lf.lfWeight = FW_BOLD; - infoPtr->hFont = CreateFont(lf.lfHeight, lf.lfWidth, lf.lfEscapement, lf.lfOrientation, lf.lfWeight, - lf.lfItalic, lf.lfUnderline, lf.lfStrikeOut, lf.lfCharSet, lf.lfOutPrecision, - lf.lfClipPrecision, lf.lfQuality, lf.lfPitchAndFamily, lf.lfFaceName); - - for(j = 0; j < 16; j++) - { - LoadString(hInstance, j, TempColor, 256); - SendDlgItemMessageW(Dlg, IDC_BACK, CB_ADDSTRING, 0, (LPARAM) TempColor); - SendDlgItemMessageW(Dlg, IDC_FONT, CB_ADDSTRING, 0, (LPARAM) TempColor); - } - LoadSettings(infoPtr); - return TRUE; - } - - case WM_COMMAND: - { - if ((HIWORD(wParam) == CBN_SELCHANGE) && ((LOWORD(wParam) == IDC_FONT) || (LOWORD(wParam) == IDC_BACK))) - { - InvalidateRect(GetDlgItem(Dlg, ID_EXAMPLE), NULL, FALSE); - } - else - { - switch (wParam) - { - case ID_OK: - { - if (!WriteSettings(infoPtr)) - break; - } - case ID_CANCEL: - { - WCHAR BoxMsg[256], BoxTitle[128]; - if ((IsWindowEnabled(GetDlgItem(Dlg, ID_OK))) && (wParam == ID_CANCEL)) - { - LoadString(hInstance, MSG_WARNINGBOX, BoxTitle, 128); - LoadString(hInstance, MSG_EXITCHANGE, BoxMsg, 256); - if (MessageBox(Dlg, BoxMsg, BoxTitle, MB_ICONWARNING | MB_YESNO) == IDNO) - break; - } - PostMessage(Dlg, WM_CLOSE, 0, 0); - break; - } - case ID_BROWSE: - case ID_BROWSEMGW: - case ID_BROWSEOBJ: - case ID_BROWSEOUT: - { - BROWSEINFO PathInfo; - LPITEMIDLIST pidl; - LPMALLOC pMalloc; - INT Control = ID_LOGDIR; - INT IDText = MSG_FINDLOGDIR; - WCHAR path[MAX_PATH]; - WCHAR Text[512]; - - if (SHGetMalloc(&pMalloc) == NOERROR) - { - ZeroMemory(&PathInfo, sizeof(BROWSEINFO)); - PathInfo.hwndOwner = Dlg; - PathInfo.ulFlags = BIF_EDITBOX | BIF_VALIDATE; - PathInfo.lpfn = (BFFCALLBACK)BrowseProc; - PathInfo.lParam = ID_LOGDIR; - PathInfo.pidlRoot = NULL; - if ((wParam == ID_BROWSEMGW) || (wParam == ID_BROWSEOBJ) || (wParam == ID_BROWSEOUT)) - { - Control = ID_MGWDIR; - IDText = MSG_FINDMGWDIR; - if (wParam == ID_BROWSEOBJ) - { - Control = ID_OBJDIR; - IDText = MSG_FINDOBJDIR; - } - else if (wParam == ID_BROWSEOUT) - { - Control = ID_OUTDIR; - IDText = MSG_FINDOUTDIR; - } - PathInfo.lParam = Control; - } - LoadString(hInstance, IDText, Text, 512); - PathInfo.lpszTitle = Text; - if ((pidl = SHBrowseForFolder(&PathInfo)) != NULL) - { - if (SHGetPathFromIDList(pidl, path)) - SetDlgItemText(Dlg, Control, path); - pMalloc->lpVtbl->Free(pMalloc, pidl); - } - pMalloc->lpVtbl->Release(pMalloc); - } - break; - } - case ID_OTHEROBJ: - case ID_OTHEROUT: - case ID_SAVELOGS: - { - BOOL WriteLogSet; - INT Dialog1 = ID_BROWSE; - INT Dialog2 = ID_LOGDIR; - WriteLogSet = (SendDlgItemMessageW(Dlg, (INT)wParam, BM_GETCHECK, 0, 0) == BST_CHECKED); - if (wParam == ID_OTHEROBJ) - { - Dialog1 = ID_BROWSEOBJ; - Dialog2 = ID_OBJDIR; - } - else if (wParam == ID_OTHEROUT) - { - Dialog1 = ID_BROWSEOUT; - Dialog2 = ID_OUTDIR; - } - EnableWindow(GetDlgItem(Dlg, Dialog1), WriteLogSet); - EnableWindow(GetDlgItem(Dlg, Dialog2), WriteLogSet); - break; - } - } - - } - SetSaveState(infoPtr); - return FALSE; - } - - case WM_CTLCOLORSTATIC: - { - HFONT hFontOld; - // note: do not change the order - it matches to previous order - static const COLORREF ColorsRGB[] = { 0x00000000, 0x00800000, 0x00008000, 0x00808000, 0x00000080, 0x00800080, - 0x00008080, 0x00c0c0c0, 0x00808080, 0x00ff0000, 0x0000ff00, - 0x00ffff00, 0x000000ff, 0x00ff00ff, 0x0000ffff, 0x00ffffff - }; - - if((HWND)lParam == GetDlgItem(Dlg, ID_EXAMPLE)) - { - hFontOld = SelectObject((HDC)wParam, infoPtr->hFont); - SetTextColor((HDC)wParam, ColorsRGB[SendDlgItemMessageW(Dlg, IDC_FONT, CB_GETCURSEL, 0, 0)]); - SetBkColor((HDC)wParam, ColorsRGB[SendDlgItemMessageW(Dlg, IDC_BACK, CB_GETCURSEL, 0, 0)]); - return (INT_PTR)CreateSolidBrush(ColorsRGB[SendDlgItemMessageW(Dlg, IDC_BACK, CB_GETCURSEL, 0, 0)]); - } - break; - } - - case WM_DESTROY: - { - if (infoPtr->hIcon) - DestroyIcon(infoPtr->hIcon); - if (infoPtr->hFont) - DeleteObject(infoPtr->hFont); - - } - - case WM_CLOSE: - { - EndDialog(Dlg, 0); - return TRUE; - } - } - return FALSE; -} - -int WINAPI -WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow) -{ - POPTIONS_DLG OptionsDlgInfo; - hInstance = hInst; - - OptionsDlgInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(*OptionsDlgInfo)); - if (OptionsDlgInfo != NULL) - { - ZeroMemory(OptionsDlgInfo, sizeof(OPTIONS_DLG)); - DialogBoxParam(hInst, MAKEINTRESOURCE(ID_DIALOG), 0, DlgProc, (LPARAM)OptionsDlgInfo); - HeapFree(GetProcessHeap(), 0, OptionsDlgInfo); - } - return 0; -} Removed: trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.exe.Manifest URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Tools/co…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.exe.Manifest [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.exe.Manifest (removed) @@ -1,21 +1,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> -<assemblyIdentity - name="ReactOS.options" - processorArchitecture="x86" - version="1.1.0.0" - type="win32"/> -<description>Config Tool</description> -<dependency> - <dependentAssembly> - <assemblyIdentity - type="win32" - name="Microsoft.Windows.Common-Controls" - version="6.0.0.0" - processorArchitecture="x86" - publicKeyToken="6595b64144ccf1df" - language="*" - /> - </dependentAssembly> -</dependency> -</assembly> Removed: trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.h URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Tools/co…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.h [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.h (removed) @@ -1,37 +1,0 @@ -/* - * PROJECT: RosBE Options Dialog - * LICENSE: GNU General Public License v2. (see LICENSE.txt) - * FILE: Tools/config/options.h - * PURPOSE: Configuring RosBE - * COPYRIGHT: Copyright 2007 Maarten Bosma - * Copyright 2007 Pierre Schweitzer - * - */ - -#include <windows.h> -#include <stdio.h> -#include <shlobj.h> -#include <wchar.h> -#include "resources.h" - -#define MINGWVERSION L"\\i386" - -typedef struct _SETTINGS -{ - WCHAR logdir[MAX_PATH]; - WCHAR objdir[MAX_PATH]; - WCHAR outdir[MAX_PATH]; - WCHAR mingwpath[MAX_PATH]; - INT foreground; - INT background; - BOOL showtime; - BOOL useccache; - BOOL strip; - BOOL nostrip; - BOOL writelog; - BOOL objstate; - BOOL outstate; -} -SETTINGS, *PSETTINGS; - -wchar_t *wcsset(wchar_t *string, wchar_t c); Removed: trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.ico URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Tools/co…
============================================================================== Binary file - no diff available. Removed: trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.rc URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Tools/co…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.rc [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.rc (removed) @@ -1,41 +1,0 @@ -#include <windows.h> -#include "resources.h" - -ID_OPTICON ICON "options.ico" - -1 24 "options.exe.Manifest" - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,1,0,0 - PRODUCTVERSION 1,1,0,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", "Marteen Bosma / Daniel Reimer / Pierre Schweitzer\0" - VALUE "FileDescription", "Config Tool for RosBE\0" - VALUE "FileVersion", "1.1.0.0\0" - VALUE "InternalName", "options\0" - VALUE "LegalCopyright", "Copyright © Daniel Reimer 2007\0" - VALUE "OriginalFilename", "options.exe\0" - VALUE "ProductName", "Config Tool for RosBE\0" - VALUE "ProductVersion", "1.1.0.0\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#include "rsrc.rc" Copied: trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options64.c (from r40747, trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.c) URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Tools/co…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.c [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options64.c [iso-8859-1] Thu Apr 30 11:32:09 2009 @@ -8,7 +8,7 @@ * */ -#include "options.h" +#include "options64.h" typedef struct _OPTIONS_DLG { Copied: trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options64.h (from r40747, trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.h) URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Tools/co…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.h [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options64.h [iso-8859-1] Thu Apr 30 11:32:09 2009 @@ -14,7 +14,7 @@ #include <wchar.h> #include "resources.h" -#define MINGWVERSION L"\\i386" +#define MINGWVERSION L"\\x86_64" typedef struct _SETTINGS { Copied: trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options64.rc (from r40747, trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.rc) URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Tools/co…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options.rc [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Tools/config/amd64/options64.rc [iso-8859-1] Thu Apr 30 11:32:09 2009 @@ -1,9 +1,9 @@ #include <windows.h> #include "resources.h" -ID_OPTICON ICON "options.ico" +ID_OPTICON ICON "options64.ico" -1 24 "options.exe.Manifest" +1 24 "options64.exe.Manifest" VS_VERSION_INFO VERSIONINFO FILEVERSION 1,1,0,0 @@ -23,12 +23,12 @@ BLOCK "040904b0" BEGIN VALUE "CompanyName", "Marteen Bosma / Daniel Reimer / Pierre Schweitzer\0" - VALUE "FileDescription", "Config Tool for RosBE\0" + VALUE "FileDescription", "Config Tool for RosBE x86-64\0" VALUE "FileVersion", "1.1.0.0\0" - VALUE "InternalName", "options\0" + VALUE "InternalName", "options64\0" VALUE "LegalCopyright", "Copyright © Daniel Reimer 2007\0" - VALUE "OriginalFilename", "options.exe\0" - VALUE "ProductName", "Config Tool for RosBE\0" + VALUE "OriginalFilename", "options64.exe\0" + VALUE "ProductName", "Config Tool for RosBE x86-64\0" VALUE "ProductVersion", "1.1.0.0\0" END END
15 years, 8 months
1
0
0
0
← Newer
1
2
3
4
...
48
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Results per page:
10
25
50
100
200