Author: tkreuzer
Date: Thu Jul 28 17:14:21 2011
New Revision: 52987
URL:
http://svn.reactos.org/svn/reactos?rev=52987&view=rev
Log:
Sync with r52784 from cmake branch
Removed:
branches/GSoC_2011/GdiFontDriver/lib/rossym/iofile.c
Modified:
branches/GSoC_2011/GdiFontDriver/ (props changed)
branches/GSoC_2011/GdiFontDriver/CMakeMacros.cmake
branches/GSoC_2011/GdiFontDriver/boot/freeldr/freeldr/CMakeLists.txt
branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/enable.c
branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/font.c
branches/GSoC_2011/GdiFontDriver/gcc.cmake
branches/GSoC_2011/GdiFontDriver/include/reactos/rossym.h
branches/GSoC_2011/GdiFontDriver/lib/rossym/CMakeLists.txt
branches/GSoC_2011/GdiFontDriver/lib/rossym/delete.c
branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarf.h
branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarfinfo.c
branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarfopen.c
branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarfpc.c
branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarfpubnames.c
branches/GSoC_2011/GdiFontDriver/lib/rossym/fromfile.c
branches/GSoC_2011/GdiFontDriver/lib/rossym/initkm.c
branches/GSoC_2011/GdiFontDriver/lib/rossym/initum.c
branches/GSoC_2011/GdiFontDriver/lib/rossym/pe.c
branches/GSoC_2011/GdiFontDriver/lib/rossym/rossympriv.h
branches/GSoC_2011/GdiFontDriver/lib/rossym/zwfile.c
branches/GSoC_2011/GdiFontDriver/ntoskrnl/CMakeLists.txt
branches/GSoC_2011/GdiFontDriver/ntoskrnl/cache/section/io.c
branches/GSoC_2011/GdiFontDriver/ntoskrnl/cache/section/newmm.h
branches/GSoC_2011/GdiFontDriver/ntoskrnl/kdbg/kdb_symbols.c
branches/GSoC_2011/GdiFontDriver/toolchain-mingw32.cmake
Propchange: branches/GSoC_2011/GdiFontDriver/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jul 28 17:14:21 2011
@@ -1,4 +1,4 @@
-/branches/cmake-bringup:51554-51961
+/branches/cmake-bringup:51554-52784
/branches/header-work:45691-47721
/branches/reactos-yarotows:45219-46371,46373-48025,48027-49273
/branches/reactx/reactos:49994-49995
Modified: branches/GSoC_2011/GdiFontDriver/CMakeMacros.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/CMakeMa…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/CMakeMacros.cmake [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/CMakeMacros.cmake [iso-8859-1] Thu Jul 28 17:14:21
2011
@@ -150,7 +150,11 @@
else()
#add it in reactos.cab
dir_to_num(${_CD_DESTINATION} _num)
- file(APPEND ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.dff.dyn
"${_CD_FILE} ${_num}\n")
+ if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
+ file(APPEND ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.dff.dyn
"${_CD_FILE} ${_num}\n")
+ else()
+ file(APPEND ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.dff.dyn
"\"${_CD_FILE}\" ${_num}\n")
+ endif()
if(_CD_TARGET)
#manage dependency
add_dependencies(reactos_cab ${_CD_TARGET})
Modified: branches/GSoC_2011/GdiFontDriver/boot/freeldr/freeldr/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/boot/fr…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1]
(original)
+++ branches/GSoC_2011/GdiFontDriver/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] Thu
Jul 28 17:14:21 2011
@@ -154,6 +154,7 @@
set_source_files_properties(${FREELDR_ARCH_SOURCE} PROPERTIES COMPILE_DEFINITIONS
"_NTHAL_;_BLDR_;_NTSYSTEM_")
add_library(freeldr_arch ${FREELDR_ARCH_SOURCE})
+add_dependencies(freeldr_arch bugcodes)
list(APPEND FREELDR_SOURCE
bootmgr.c
Modified: branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/enable.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/drivers…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/enable.c [iso-8859-1]
(original)
+++ branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/enable.c [iso-8859-1] Thu Jul
28 17:14:21 2011
@@ -42,6 +42,9 @@
FT_Error fterror;
TRACE("FtfdEnableDriver()\n");
+
+//__debugbreak();
+
/* Check parameter */
if (cj < sizeof(DRVENABLEDATA))
Modified: branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/font.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/drivers…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/font.c [iso-8859-1]
(original)
+++ branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/font.c [iso-8859-1] Thu Jul
28 17:14:21 2011
@@ -316,7 +316,7 @@
/* Initialize FD_GLYPHSET */
pGlyphSet->cjThis = cjSize;
- pGlyphSet->flAccel = 0;
+ pGlyphSet->flAccel = GS_16BIT_HANDLES;
pGlyphSet->cGlyphsSupported = pface->cMappings;
pGlyphSet->cRuns = pface->cRuns;
@@ -641,6 +641,35 @@
return HFF_INVALID;
}
+LONG
+APIENTRY
+FtfdQueryFontFile(
+ ULONG_PTR diFile,
+ ULONG ulMode,
+ ULONG cjBuf,
+ ULONG *pulBuf)
+{
+ PFTFD_FILE pfile = (PFTFD_FILE)diFile;
+
+ TRACE("FtfdQueryFontFile(ulMode=%ld)\n", ulMode);
+
+ switch (ulMode)
+ {
+ case QFF_DESCRIPTION:
+ {
+ WARN("QFF_DESCRIPTION unimplemented\n");
+ return 0;
+ }
+
+ case QFF_NUMFACES:
+ /* return the number of faces in the file */
+ return pfile->cNumFaces;
+
+ }
+
+ return FD_ERROR;
+}
+
PIFIMETRICS
APIENTRY
FtfdQueryFont(
@@ -736,35 +765,6 @@
LONG
APIENTRY
-FtfdQueryFontFile(
- ULONG_PTR diFile,
- ULONG ulMode,
- ULONG cjBuf,
- ULONG *pulBuf)
-{
- PFTFD_FILE pfile = (PFTFD_FILE)diFile;
-
- TRACE("FtfdQueryFontFile(ulMode=%ld)\n", ulMode);
-
- switch (ulMode)
- {
- case QFF_DESCRIPTION:
- {
- WARN("QFF_DESCRIPTION unimplemented\n");
- return 0;
- }
-
- case QFF_NUMFACES:
- /* return the number of faces in the file */
- return pfile->cNumFaces;
-
- }
-
- return FD_ERROR;
-}
-
-LONG
-APIENTRY
FtfdQueryFontCaps(
ULONG culCaps,
ULONG *pulCaps)
Modified: branches/GSoC_2011/GdiFontDriver/gcc.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/gcc.cma…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/gcc.cmake [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/gcc.cmake [iso-8859-1] Thu Jul 28 17:14:21 2011
@@ -18,10 +18,6 @@
"<CMAKE_C_COMPILER> -DRC_INVOKED -D__WIN32__=1 -D__FLAT__=1
<DEFINES> -I${REACTOS_SOURCE_DIR}/include/psdk -I${REACTOS_BINARY_DIR}/include/psdk
-I${REACTOS_SOURCE_DIR}/include/ -I${REACTOS_SOURCE_DIR}/include/reactos
-I${REACTOS_BINARY_DIR}/include/reactos -I${REACTOS_SOURCE_DIR}/include/reactos/wine
-I${REACTOS_SOURCE_DIR}/include/crt -I${REACTOS_SOURCE_DIR}/include/crt/mingw32 -xc -E
<SOURCE> -o <OBJECT>"
"${WRC} -i <OBJECT> -o <OBJECT>"
"<CMAKE_RC_COMPILER> -i <OBJECT> -J res -O coff -o
<OBJECT>")
-
-if(NOT CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
- set(CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_AR> crs <TARGET>
<LINK_FLAGS> <OBJECTS>")
-endif()
# Compiler Core
add_definitions(-pipe -fms-extensions)
Modified: branches/GSoC_2011/GdiFontDriver/include/reactos/rossym.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/include…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/include/reactos/rossym.h [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/include/reactos/rossym.h [iso-8859-1] Thu Jul 28
17:14:21 2011
@@ -24,11 +24,6 @@
BOOLEAN (*SeekFileProc)(PVOID FileContext, ULONG_PTR Position);
} ROSSYM_CALLBACKS, *PROSSYM_CALLBACKS;
-typedef struct _ROSSYM_OWN_FILECONTEXT {
- BOOLEAN (*ReadFileProc)(PVOID FileContext, PVOID Buffer, ULONG Size);
- BOOLEAN (*SeekFileProc)(PVOID FileContext, ULONG_PTR Position);
-} ROSSYM_OWN_FILECONTEXT, *PROSSYM_OWN_FILECONTEXT;
-
struct Dwarf;
typedef struct Dwarf *PROSSYM_INFO;
Modified: branches/GSoC_2011/GdiFontDriver/lib/rossym/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/lib/ros…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/lib/rossym/CMakeLists.txt [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/lib/rossym/CMakeLists.txt [iso-8859-1] Thu Jul 28
17:14:21 2011
@@ -16,7 +16,6 @@
dwarfpubnames.c
find.c
fromfile.c
- iofile.c
init.c
initkm.c
initum.c
Modified: branches/GSoC_2011/GdiFontDriver/lib/rossym/delete.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/lib/ros…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/lib/rossym/delete.c [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/lib/rossym/delete.c [iso-8859-1] Thu Jul 28 17:14:21
2011
@@ -22,6 +22,11 @@
VOID
RosSymDelete(PROSSYM_INFO RosSymInfo)
{
+ int i;
+ for (i = 0; i < RosSymInfo->pe->nsections; i++) {
+ RtlFreeAnsiString(ANSI_NAME_STRING(&RosSymInfo->pe->sect[i]));
+ }
+ RosSymFreeMem(RosSymInfo->pe->sect);
dwarfclose(RosSymInfo);
}
Modified: branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarf.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/lib/ros…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarf.h [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarf.h [iso-8859-1] Thu Jul 28 17:14:21
2011
@@ -252,7 +252,7 @@
uchar framebase;
uchar friend;
uchar highpc;
- uchar entrypc;
+ uchar entrypc;
uchar identifiercase;
uchar import;
uchar inlined;
@@ -315,7 +315,7 @@
DwarfVal framebase;
ulong friend;
ulong highpc;
- ulong entrypc;
+ ulong entrypc;
ulong identifiercase;
ulong import;
ulong inlined;
Modified: branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarfinfo.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/lib/ros…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarfinfo.c [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarfinfo.c [iso-8859-1] Thu Jul 28
17:14:21 2011
@@ -366,7 +366,7 @@
{ DwarfAttrFrameBase, OFFSET(framebase), TBlock|TConstant },
{ DwarfAttrFriend, OFFSET(friend), TReference },
{ DwarfAttrHighpc, OFFSET(highpc), TAddress },
- { DwarfAttrEntrypc, OFFSET(entrypc), TAddress },
+ { DwarfAttrEntrypc, OFFSET(entrypc), TAddress },
{ DwarfAttrIdentifierCase, OFFSET(identifiercase), TConstant },
{ DwarfAttrImport, OFFSET(import), TReference },
{ DwarfAttrInline, OFFSET(inlined), TConstant },
Modified: branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarfopen.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/lib/ros…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarfopen.c [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarfopen.c [iso-8859-1] Thu Jul 28
17:14:21 2011
@@ -30,9 +30,9 @@
if(pe->loadsection(pe, ".debug_abbrev", &d->abbrev) < 0
|| pe->loadsection(pe, ".debug_aranges", &d->aranges) < 0
|| pe->loadsection(pe, ".debug_line", &d->line) < 0
- || pe->loadsection(pe, ".debug_pubnames", &d->pubnames) < 0
|| pe->loadsection(pe, ".debug_info", &d->info) < 0)
goto err;
+ pe->loadsection(pe, ".debug_pubnames", &d->pubnames);
pe->loadsection(pe, ".debug_frame", &d->frame);
pe->loadsection(pe, ".debug_ranges", &d->ranges);
pe->loadsection(pe, ".debug_str", &d->str);
@@ -40,7 +40,6 @@
return d;
err:
- DPRINT("Failed to open dwarf\n");
free(d->abbrev.data);
free(d->aranges.data);
free(d->frame.data);
Modified: branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarfpc.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/lib/ros…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarfpc.c [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarfpc.c [iso-8859-1] Thu Jul 28 17:14:21
2011
@@ -50,7 +50,7 @@
{
uchar *prog, *opcount, *end, *dirs;
ulong off, unit, len, vers, x, start, lastline;
- int i, first, firstline, op, a, l, quantum, isstmt, linebase, linerange, opcodebase,
nf;
+ int i, first, op, a, l, quantum, isstmt, linebase, linerange, opcodebase, nf;
char *files, *s;
DwarfBuf b;
DwarfSym sym;
@@ -150,7 +150,6 @@
if(trace) werrstr("program @ %lu ... %.*H opbase = %d\n", b.p -
d->line.data, b.ep-b.p, b.p, opcodebase);
first = 1;
while(b.p != nil){
- firstline = 0;
op = dwarfget1(&b);
if(trace) werrstr("\tline %lu, addr 0x%x, op %d %.10H", cur.line, cur.addr,
op, b.p);
if(op >= opcodebase){
@@ -163,16 +162,12 @@
if(first){
if(cur.addr > pc){
werrstr("found wrong line mapping 0x%x for pc 0x%x", cur.addr, pc);
- /* This is an overzealous check. gcc can produce discontiguous ranges
- and reorder statements, so it's possible for a future line to start
- ahead of pc and still find a matching one. */
- /*goto out;*/
- firstline = 1;
+ goto out;
}
first = 0;
start = cur.addr;
}
- if(cur.addr > pc && !firstline)
+ if(cur.addr > pc)
break;
if(b.p == nil){
werrstr("buffer underflow in line mapping");
Modified: branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarfpubnames.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/lib/ros…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarfpubnames.c [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/lib/rossym/dwarfpubnames.c [iso-8859-1] Thu Jul 28
17:14:21 2011
@@ -66,7 +66,8 @@
int
dwarflookupname(Dwarf *d, char *name, DwarfSym *sym)
{
- return _dwarfnametounit(d, name, &d->pubnames, sym);
+ if (!d->pubnames.data) return -1;
+ else return _dwarfnametounit(d, name, &d->pubnames, sym);
}
/*
Modified: branches/GSoC_2011/GdiFontDriver/lib/rossym/fromfile.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/lib/ros…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/lib/rossym/fromfile.c [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/lib/rossym/fromfile.c [iso-8859-1] Thu Jul 28
17:14:21 2011
@@ -20,8 +20,6 @@
#define NDEBUG
#include <debug.h>
-extern NTSTATUS RosSymStatus;
-
BOOLEAN
RosSymCreateFromFile(PVOID FileContext, PROSSYM_INFO *RosSymInfo)
{
@@ -32,14 +30,10 @@
unsigned SymbolTable, NumSymbols;
/* Load DOS header */
- if (! RosSymSeekFile(FileContext, 0))
- {
- DPRINT1("Could not rewind file\n");
- return FALSE;
- }
+ DPRINT("About to read file\n");
if (! RosSymReadFile(FileContext, &DosHeader, sizeof(IMAGE_DOS_HEADER)))
{
- DPRINT1("Failed to read DOS header %x\n", RosSymStatus);
+ DPRINT1("Failed to read DOS header\n");
return FALSE;
}
if (! ROSSYM_IS_VALID_DOS_HEADER(&DosHeader))
@@ -83,7 +77,6 @@
DPRINT1("Failed seeking to section headers\n");
return FALSE;
}
- DPRINT("Alloc section headers\n");
SectionHeaders = RosSymAllocMem(NtHeaders.FileHeader.NumberOfSections
* sizeof(IMAGE_SECTION_HEADER));
if (NULL == SectionHeaders)
@@ -192,9 +185,7 @@
pe->imagebase = pe->loadbase = NtHeaders.OptionalHeader.ImageBase;
pe->imagesize = NtHeaders.OptionalHeader.SizeOfImage;
pe->loadsection = loaddisksection;
- DPRINT("do dwarfopen\n");
*RosSymInfo = dwarfopen(pe);
- DPRINT("done %x\n", *RosSymInfo);
return TRUE;
Modified: branches/GSoC_2011/GdiFontDriver/lib/rossym/initkm.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/lib/ros…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/lib/rossym/initkm.c [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/lib/rossym/initkm.c [iso-8859-1] Thu Jul 28 17:14:21
2011
@@ -38,8 +38,8 @@
{
RosSymAllocMemKM,
RosSymFreeMemKM,
- RosSymIoReadFile,
- RosSymIoSeekFile
+ RosSymZwReadFile,
+ RosSymZwSeekFile
};
RosSymInit(&KmCallbacks);
Modified: branches/GSoC_2011/GdiFontDriver/lib/rossym/initum.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/lib/ros…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/lib/rossym/initum.c [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/lib/rossym/initum.c [iso-8859-1] Thu Jul 28 17:14:21
2011
@@ -7,12 +7,9 @@
* PROGRAMMERS: Ge van Geldorp (gvg(a)reactos.com)
*/
-#define WIN32_NO_STATUS
#include <windows.h>
#include <reactos/rossym.h>
#include "rossympriv.h"
-#define NTOS_MODE_USER
-#include <ndk/ntndk.h>
#define NDEBUG
#include <debug.h>
@@ -20,13 +17,13 @@
static PVOID
RosSymAllocMemUM(ULONG_PTR Size)
{
- return RtlAllocateHeap(RtlGetProcessHeap(), 0, Size);
+ return HeapAlloc(GetProcessHeap(), 0, Size);
}
static VOID
RosSymFreeMemUM(PVOID Area)
{
- RtlFreeHeap(RtlGetProcessHeap(), 0, Area);
+ HeapFree(GetProcessHeap(), 0, Area);
}
VOID
Removed: branches/GSoC_2011/GdiFontDriver/lib/rossym/iofile.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/lib/ros…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/lib/rossym/iofile.c [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/lib/rossym/iofile.c (removed)
@@ -1,34 +1,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
- * FILE: lib/rossym/zwfile.c
- * PURPOSE: File I/O using native functions
- *
- * PROGRAMMERS: Ge van Geldorp (gvg(a)reactos.com)
- */
-
-#define NTOSAPI
-#include <ntddk.h>
-#include <reactos/rossym.h>
-#include "rossympriv.h"
-
-#define NDEBUG
-#include <debug.h>
-
-NTSTATUS RosSymStatus;
-
-BOOLEAN
-RosSymIoReadFile(PVOID FileContext, PVOID Buffer, ULONG Size)
-{
- PROSSYM_OWN_FILECONTEXT OwnContext = (PROSSYM_OWN_FILECONTEXT)FileContext;
- return OwnContext->ReadFileProc(FileContext, Buffer, Size);
-}
-
-BOOLEAN
-RosSymIoSeekFile(PVOID FileContext, ULONG_PTR Position)
-{
- PROSSYM_OWN_FILECONTEXT OwnContext = (PROSSYM_OWN_FILECONTEXT)FileContext;
- return OwnContext->SeekFileProc(FileContext, Position);
-}
-
-/* EOF */
Modified: branches/GSoC_2011/GdiFontDriver/lib/rossym/pe.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/lib/ros…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/lib/rossym/pe.c [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/lib/rossym/pe.c [iso-8859-1] Thu Jul 28 17:14:21
2011
@@ -111,10 +111,6 @@
for (i = 0; i < pe->nsections; i++) {
RtlFreeAnsiString(ANSI_NAME_STRING(&pe->sect[i]));
}
- for (i = 0; i < pe->nsymbols; i++) {
- free(pe->symtab[i].name);
- }
- free(pe->symtab);
free(pe->sect);
free(pe);
}
Modified: branches/GSoC_2011/GdiFontDriver/lib/rossym/rossympriv.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/lib/ros…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/lib/rossym/rossympriv.h [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/lib/rossym/rossympriv.h [iso-8859-1] Thu Jul 28
17:14:21 2011
@@ -19,9 +19,6 @@
extern BOOLEAN RosSymZwReadFile(PVOID FileContext, PVOID Buffer, ULONG Size);
extern BOOLEAN RosSymZwSeekFile(PVOID FileContext, ULONG_PTR Position);
-extern BOOLEAN RosSymIoReadFile(PVOID FileContext, PVOID Buffer, ULONG Size);
-extern BOOLEAN RosSymIoSeekFile(PVOID FileContext, ULONG_PTR Position);
-
#define ROSSYM_IS_VALID_DOS_HEADER(DosHeader) (IMAGE_DOS_SIGNATURE ==
(DosHeader)->e_magic \
&& 0L !=
(DosHeader)->e_lfanew)
#define ROSSYM_IS_VALID_NT_HEADERS(NtHeaders) (IMAGE_NT_SIGNATURE ==
(NtHeaders)->Signature \
Modified: branches/GSoC_2011/GdiFontDriver/lib/rossym/zwfile.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/lib/ros…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/lib/rossym/zwfile.c [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/lib/rossym/zwfile.c [iso-8859-1] Thu Jul 28 17:14:21
2011
@@ -15,40 +15,38 @@
#define NDEBUG
#include <debug.h>
-NTSTATUS RosSymStatus;
-
BOOLEAN
RosSymZwReadFile(PVOID FileContext, PVOID Buffer, ULONG Size)
{
- //NTSTATUS Status;
+ NTSTATUS Status;
IO_STATUS_BLOCK IoStatusBlock;
- RosSymStatus = ZwReadFile(*((HANDLE *) FileContext),
+ Status = ZwReadFile(*((HANDLE *) FileContext),
0, 0, 0,
&IoStatusBlock,
Buffer,
Size,
0, 0);
- return NT_SUCCESS(RosSymStatus) && IoStatusBlock.Information == Size;
+ return NT_SUCCESS(Status) && IoStatusBlock.Information == Size;
}
BOOLEAN
RosSymZwSeekFile(PVOID FileContext, ULONG_PTR Position)
{
- //NTSTATUS Status;
+ NTSTATUS Status;
IO_STATUS_BLOCK IoStatusBlock;
FILE_POSITION_INFORMATION NewPosition;
NewPosition.CurrentByteOffset.u.HighPart = 0;
NewPosition.CurrentByteOffset.u.LowPart = Position;
- RosSymStatus = ZwSetInformationFile(*((HANDLE *) FileContext),
+ Status = ZwSetInformationFile(*((HANDLE *) FileContext),
&IoStatusBlock,
(PVOID) &NewPosition,
sizeof(FILE_POSITION_INFORMATION),
FilePositionInformation);
- return NT_SUCCESS(RosSymStatus);
+ return NT_SUCCESS(Status);
}
/* EOF */
Modified: branches/GSoC_2011/GdiFontDriver/ntoskrnl/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/ntoskrn…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/ntoskrnl/CMakeLists.txt [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/ntoskrnl/CMakeLists.txt [iso-8859-1] Thu Jul 28
17:14:21 2011
@@ -32,6 +32,7 @@
cache/pinsup.c
cache/section/data.c
cache/section/fault.c
+ cache/section/io.c
cache/section/reqtools.c
cache/section/sptab.c
cache/section/swapout.c)
@@ -46,7 +47,6 @@
endif()
list(APPEND SOURCE
- cache/section/io.c
config/cmalloc.c
config/cmapi.c
config/cmboot.c
Modified: branches/GSoC_2011/GdiFontDriver/ntoskrnl/cache/section/io.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/ntoskrn…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/ntoskrnl/cache/section/io.c [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/ntoskrnl/cache/section/io.c [iso-8859-1] Thu Jul 28
17:14:21 2011
@@ -99,7 +99,6 @@
PLARGE_INTEGER FileOffset,
PVOID Buffer,
ULONG Length,
- BOOLEAN Paging,
PIO_STATUS_BLOCK ReadStatus)
{
NTSTATUS Status;
@@ -128,7 +127,7 @@
Length);
KeInitializeEvent(&ReadWait, NotificationEvent, FALSE);
-
+
Irp = IoBuildAsynchronousFsdRequest
(IRP_MJ_READ,
DeviceObject,
@@ -142,7 +141,7 @@
return STATUS_NO_MEMORY;
}
- Irp->Flags |= (Paging ? IRP_PAGING_IO | IRP_SYNCHRONOUS_PAGING_IO | IRP_NOCACHE :
0) | IRP_SYNCHRONOUS_API;
+ Irp->Flags |= IRP_PAGING_IO | IRP_SYNCHRONOUS_PAGING_IO | IRP_NOCACHE |
IRP_SYNCHRONOUS_API;
Irp->UserEvent = &ReadWait;
Irp->Tail.Overlay.OriginalFileObject = FileObject;
@@ -151,8 +150,7 @@
IrpSp->Control |= SL_INVOKE_ON_SUCCESS | SL_INVOKE_ON_ERROR;
IrpSp->FileObject = FileObject;
IrpSp->CompletionRoutine = MiSimpleReadComplete;
- ObReferenceObject(FileObject);
-
+
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
Modified: branches/GSoC_2011/GdiFontDriver/ntoskrnl/cache/section/newmm.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/ntoskrn…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/ntoskrnl/cache/section/newmm.h [iso-8859-1]
(original)
+++ branches/GSoC_2011/GdiFontDriver/ntoskrnl/cache/section/newmm.h [iso-8859-1] Thu Jul
28 17:14:21 2011
@@ -181,7 +181,6 @@
PLARGE_INTEGER FileOffset,
PVOID Buffer,
ULONG Length,
- BOOLEAN Paging,
PIO_STATUS_BLOCK ReadStatus);
NTSTATUS
@@ -405,6 +404,40 @@
ULONG AllocationAttributes,
PFILE_OBJECT FileObject);
+NTSTATUS
+NTAPI
+MiSimpleRead
+(PFILE_OBJECT FileObject,
+ PLARGE_INTEGER FileOffset,
+ PVOID Buffer,
+ ULONG Length,
+ PIO_STATUS_BLOCK ReadStatus);
+
+NTSTATUS
+NTAPI
+_MiSimpleWrite
+(PFILE_OBJECT FileObject,
+ PLARGE_INTEGER FileOffset,
+ PVOID Buffer,
+ ULONG Length,
+ PIO_STATUS_BLOCK ReadStatus,
+ const char *file,
+ int line);
+
+#define MiSimpleWrite(F,O,B,L,R) _MiSimpleWrite(F,O,B,L,R,__FILE__,__LINE__)
+
+NTSTATUS
+NTAPI
+_MiWriteBackPage
+(PFILE_OBJECT FileObject,
+ PLARGE_INTEGER Offset,
+ ULONG Length,
+ PFN_NUMBER Page,
+ const char *File,
+ int Line);
+
+#define MiWriteBackPage(F,O,L,P) _MiWriteBackPage(F,O,L,P,__FILE__,__LINE__)
+
PVOID
NTAPI
MmGetSegmentRmap(PFN_NUMBER Page, PULONG RawOffset);
Modified: branches/GSoC_2011/GdiFontDriver/ntoskrnl/kdbg/kdb_symbols.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/ntoskrn…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/ntoskrnl/kdbg/kdb_symbols.c [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/ntoskrnl/kdbg/kdb_symbols.c [iso-8859-1] Thu Jul 28
17:14:21 2011
@@ -13,7 +13,6 @@
#include <ntoskrnl.h>
#define NDEBUG
-#include "../cache/section/newmm.h"
#include <debug.h>
/* GLOBALS ******************************************************************/
@@ -27,64 +26,12 @@
}
IMAGE_SYMBOL_INFO_CACHE, *PIMAGE_SYMBOL_INFO_CACHE;
-typedef struct _ROSSYM_KM_OWN_CONTEXT {
- ROSSYM_OWN_FILECONTEXT Rossym;
- LARGE_INTEGER FileOffset;
- PFILE_OBJECT FileObject;
-} ROSSYM_KM_OWN_CONTEXT, *PROSSYM_KM_OWN_CONTEXT;
-
static BOOLEAN LoadSymbols;
static LIST_ENTRY SymbolFileListHead;
static KSPIN_LOCK SymbolFileListLock;
-static PROSSYM_INFO KdbpRosSymInfo;
-static ULONG_PTR KdbpImageBase;
BOOLEAN KdbpSymbolsInitialized = FALSE;
/* FUNCTIONS ****************************************************************/
-
-static BOOLEAN
-KdbpSeekSymFile(PVOID FileContext, ULONG_PTR Target)
-{
- PROSSYM_KM_OWN_CONTEXT Context = (PROSSYM_KM_OWN_CONTEXT)FileContext;
- Context->FileOffset.QuadPart = Target;
- return TRUE;
-}
-
-static BOOLEAN
-KdbpReadSymFile(PVOID FileContext, PVOID Buffer, ULONG Length)
-{
- PROSSYM_KM_OWN_CONTEXT Context = (PROSSYM_KM_OWN_CONTEXT)FileContext;
- IO_STATUS_BLOCK Iosb;
- NTSTATUS Status = MiSimpleRead
- (Context->FileObject,
- &Context->FileOffset,
- Buffer,
- Length,
- FALSE,
- &Iosb);
- return NT_SUCCESS(Status);
-}
-
-static PROSSYM_OWN_FILECONTEXT
-KdbpCaptureFileForSymbols(PFILE_OBJECT FileObject)
-{
- PROSSYM_KM_OWN_CONTEXT Context = ExAllocatePool(NonPagedPool, sizeof(*Context));
- if (!Context) return NULL;
- ObReferenceObject(FileObject);
- Context->FileOffset.QuadPart = 0;
- Context->FileObject = FileObject;
- Context->Rossym.ReadFileProc = KdbpReadSymFile;
- Context->Rossym.SeekFileProc = KdbpSeekSymFile;
- return &Context->Rossym;
-}
-
-static VOID
-KdbpReleaseFileForSymbols(PROSSYM_OWN_FILECONTEXT FileContext)
-{
- PROSSYM_KM_OWN_CONTEXT Context = (PROSSYM_KM_OWN_CONTEXT)FileContext;
- ObDereferenceObject(Context->FileObject);
- ExFreePool(Context);
-}
static BOOLEAN
KdbpSymSearchModuleList(
@@ -177,10 +124,7 @@
KdbSymPrintAddress(
IN PVOID Address)
{
- PMEMORY_AREA MemoryArea = NULL;
- PROS_SECTION_OBJECT SectionObject;
PLDR_DATA_TABLE_ENTRY LdrEntry;
- PROSSYM_OWN_FILECONTEXT FileContext;
ULONG_PTR RelativeAddress;
NTSTATUS Status;
ULONG LineNumber;
@@ -200,57 +144,11 @@
{
DbgPrint("<%wZ:%x (%s:%d (%s))>",
&LdrEntry->BaseDllName, RelativeAddress, FileName, LineNumber,
FunctionName);
- return TRUE;
- }
- else if (Address < MmSystemRangeStart)
- {
- MemoryArea = MmLocateMemoryAreaByAddress(&PsGetCurrentProcess()->Vm, Address);
- if (!MemoryArea || MemoryArea->Type != MEMORY_AREA_SECTION_VIEW)
- {
- goto end;
- }
- SectionObject = MemoryArea->Data.SectionData.Section;
- if (!(SectionObject->AllocationAttributes & SEC_IMAGE)) goto end;
- if (MemoryArea->StartingAddress != (PVOID)KdbpImageBase)
- {
- if (KdbpRosSymInfo)
- {
- RosSymDelete(KdbpRosSymInfo);
- KdbpRosSymInfo = NULL;
- KdbpImageBase = 0;
- }
-
- if ((FileContext = KdbpCaptureFileForSymbols(SectionObject->FileObject)))
- {
- if (RosSymCreateFromFile(FileContext, &KdbpRosSymInfo))
- KdbpImageBase = (ULONG_PTR)MemoryArea->StartingAddress;
-
- KdbpReleaseFileForSymbols(FileContext);
- }
- }
-
- if (KdbpRosSymInfo)
- {
- RelativeAddress = (ULONG_PTR)Address - KdbpImageBase;
- Status = KdbSymGetAddressInformation
- (KdbpRosSymInfo,
- RelativeAddress,
- &LineNumber,
- FileName,
- FunctionName);
- if (NT_SUCCESS(Status))
- {
- DbgPrint
- ("<%wZ:%x (%s:%d (%s))>",
- &SectionObject->FileObject->FileName,
- RelativeAddress, FileName, LineNumber, FunctionName);
- return TRUE;
- }
- }
- }
-
-end:
- DbgPrint("<%wZ:%x>", &LdrEntry->BaseDllName, RelativeAddress);
+ }
+ else
+ {
+ DbgPrint("<%wZ:%x>", &LdrEntry->BaseDllName,
RelativeAddress);
+ }
return TRUE;
}
@@ -310,6 +208,8 @@
PLIST_ENTRY CurrentEntry;
KIRQL Irql;
+ DPRINT("Looking for cached symbol file %wZ\n", FileName);
+
KeAcquireSpinLock(&SymbolFileListLock, &Irql);
CurrentEntry = SymbolFileListHead.Flink;
@@ -317,6 +217,7 @@
{
Current = CONTAINING_RECORD(CurrentEntry, IMAGE_SYMBOL_INFO_CACHE, ListEntry);
+ DPRINT("Current->FileName %wZ FileName %wZ\n",
&Current->FileName, FileName);
if (RtlEqualUnicodeString(&Current->FileName, FileName, TRUE))
{
Current->RefCount++;
@@ -410,6 +311,7 @@
}
KeReleaseSpinLock(&SymbolFileListLock, Irql);
+ DPRINT1("Warning: Removing unknown symbol file: RosSymInfo = %p\n",
RosSymInfo);
}
/*! \brief Loads a symbol file.
@@ -428,8 +330,6 @@
HANDLE FileHandle;
NTSTATUS Status;
IO_STATUS_BLOCK IoStatusBlock;
- PFILE_OBJECT FileObject;
- PROSSYM_OWN_FILECONTEXT FileContext;
/* Allow KDB to break on module load */
KdbModuleLoaded(FileName);
@@ -451,7 +351,7 @@
/* Open the file */
InitializeObjectAttributes(&ObjectAttributes,
FileName,
- OBJ_CASE_INSENSITIVE,
+ 0,
NULL,
NULL);
@@ -471,34 +371,20 @@
DPRINT("Loading symbols from %wZ...\n", FileName);
- Status = ObReferenceObjectByHandle
- (FileHandle,
- FILE_READ_DATA|SYNCHRONIZE,
- NULL,
- KernelMode,
- (PVOID*)&FileObject,
- NULL);
-
- if (!NT_SUCCESS(Status))
- {
- DPRINT("Could not get the file object\n");
- ZwClose(FileHandle);
+ if (!RosSymCreateFromFile(&FileHandle, RosSymInfo))
+ {
+ DPRINT("Failed to load symbols from %wZ\n", FileName);
return;
}
- if ((FileContext = KdbpCaptureFileForSymbols(FileObject)))
- {
- if (RosSymCreateFromFile(FileContext, RosSymInfo))
- {
- /* add file to cache */
- KdbpSymAddCachedFile(FileName, *RosSymInfo);
- DPRINT("Installed symbols: %wZ %p\n", FileName, *RosSymInfo);
- }
- KdbpReleaseFileForSymbols(FileContext);
- }
-
- ObDereferenceObject(FileObject);
ZwClose(FileHandle);
+
+ DPRINT("Symbols loaded.\n");
+
+ /* add file to cache */
+ KdbpSymAddCachedFile(FileName, *RosSymInfo);
+
+ DPRINT("Installed symbols: %wZ %p\n", FileName, *RosSymInfo);
}
VOID
@@ -525,6 +411,7 @@
LdrEntry->DllBase,
(PVOID)(LdrEntry->SizeOfImage + (ULONG_PTR)LdrEntry->DllBase),
LdrEntry->PatchInformation);
+
}
VOID
Modified: branches/GSoC_2011/GdiFontDriver/toolchain-mingw32.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/toolcha…
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/toolchain-mingw32.cmake [iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/toolchain-mingw32.cmake [iso-8859-1] Thu Jul 28
17:14:21 2011
@@ -35,6 +35,13 @@
set(CMAKE_ASM_COMPILER ${MINGW_PREFIX}gcc)
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -x assembler-with-cpp -o
<OBJECT> -I${REACTOS_SOURCE_DIR}/include/asm -I${REACTOS_BINARY_DIR}/include/asm
<FLAGS> <DEFINES> -D__ASM__ -c <SOURCE>")
+if(NOT CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
+ set(CMAKE_AR ${MINGW_PREFIX}ar)
+ set(CMAKE_C_CREATE_STATIC_LIBRARY "${CMAKE_AR} crs <TARGET>
<LINK_FLAGS> <OBJECTS>")
+ set(CMAKE_CXX_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY})
+ set(CMAKE_ASM_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY})
+endif()
+
# Use stdcall fixups, and don't link with anything by default unless we say so
set(CMAKE_C_STANDARD_LIBRARIES "-lgcc" CACHE STRING "Standard C
Libraries")