fixes issue 1093

The Windows private loader now computes the GS security cookie and sets it
in all libraries that have the field properly initialized.  The algorithm
for generating the cookie isn't too complex and my implementation is
enough to satisfy bcryptPrimitives.dll, which has a sanity check that it is
appropriately set.

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1958 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#912: add 4 more Win8 API set mappings.

These 4 are needed to load dbghelp.dll 6.2.9200.16384 (the default win8 and
VS2012 version).

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1959 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Redirect kernel32 imports from kernelbase where possible, while still
supporting a handful of redirection routines calling back into priv
kernel32.

This avoids an NtCreateSection native_exec_syscalls hook warning on win8,
in addition to ensuring we're redirecting as many routines as possible.

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1960 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
fixes issue 1098

As it looks tricky to shift the wow64 syscall setup, I did a quick fix and
switched the TEB-as-stack to use DR's 4 scratch slots rather than the TLS
field.

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1961 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#65: test samples

Finally fix a long-overdue missing piece of the initial CMake conversion:
add sanity tests of the sample clients.  They're run with a tiny test,
common.eflags, for simplicity with the bigger clients.  I had to change
several clients to have no output for !SHOW_RESULTS, and I turned off
SHOW_RESULTS when BUILD_TESTS is ON (hence, never make a release package
from a test build!).

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1962 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
fixes issue 1099

First, when appending to the .drpath file for
use_DynamoRIO_extension(), we now check for the path already existing.
Second, when adding .drpath lines to the search path, we check for
duplicates.
Also adds an assert to catch search path overflow earlier.

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1963 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#1090: Don't swap retaddrs when the TOS is a native PC

This happens for this sequence of calls:

  native call native
  native call interp@plt
  interp jmp  native@plt      ; TOS is native PC: don't swap
  native ret                  ; should stay native

The jmp native@plt looks like a native gateway call to us, so we go
through call_to_native.  This change checks if the TOS return address is
native, and skips the swap if it is.

Makes DECLARE_EXPORTED_FUNC() in asm_defines.asm actually export things
so that we don't need getters in C or a .def file for the test code.

The existing tail call test code covers the edge case from i#1090 when
we call the appdll through the PLT.

Fixes issue 1090.

Review URL: https://codereview.appspot.com/7438045

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1964 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6