i#1063: implement synchronization redirection

Implemented 10 synchronization-related kernel32 redirection routines.
Added simple tests.

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1912 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#1063: implement redirection for GetCurrent{Process,Thread}{,Id}()

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1913 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
In drrun, do not show bitwidth error when file is not found

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1914 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Minor fixes to drdeploy.c to make it drop-in compatible on Linux

- Adjusts ifdefs to build native drinject without warnings.
- Adds -killpg to kill the child process group after a timeout (i#501).
- Fix the Linux impl of env_var_exists() in dr_config.c
- Fix a bug where an env var isn't present in handle_execve()

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1915 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#1013: add dr_inject_wait_for_process() to drinjectlib

This moves the complexity of waiting for a child process with a timeout up into
drinjectlib so that we don't need to repeat it in every tool frontend.

Fixes issue 1013.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1916 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Fix issues with the new drinjectlib process wait code

- Put back DR_EXPORT in dr_inject.h
- Fix the NT timeout code to use negative timer units
- Make the Linux impl of dr_inject_process_exit() not block
- Free drinject resources by always calling dr_inject_process_exit()

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1917 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#1063: implement redirect_GetDiskFreeSpace{A,W}

From experimentation, no trailing \ is needed, a relative path turns
into the cur dir, and a file (i.e., not a directory) is passed as-is
and fails.

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1918 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#1063: implement redirect_GetDriveType{A,W}

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1919 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#1063: implement redirect_GetFileAttributes{A,W}

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1920 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#1063: implement redirect_GetFileInformationByHandle()

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1921 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#1063: implement redirect_GetFileSize()

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1922 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#1063: implement redirect_GetFileType()

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1923 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#1063: implement redirect_ExitProcess()

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1924 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#143: presents the app's view of memory to the client wrt writable code
regions that DR has marked read-only.

Rather than trying to hide faults from the app, adds a flag
DR_MEMPROT_PRETEND_WRITE and puts the onus on the client to not write to
the region.

Added a test.

Does not fully fix i#143: we still need to adjust oldprot on
mprotect/ProtectVirtualMemory by the app.

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1925 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#1080: Fix special heap lock ranking

Documents a previously hidden constraint between exec_areas and module_data.

Fixes issue 1080.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1926 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Support Linux cross-arch injection in the native drdeploy frontends

This required adding an architecture parameter to
get_config_val_other_app() and detecting the bitwidth of the exe in
drinjectlib.

Also add support for the -dr_home alias used by the Linux suite to test
cross-arch injection.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1927 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Use wide dbghelp routines in drsyms when passing paths

This should make it possible to load syms for a file with a non-ASCII path, but
I haven't been able to construct a satisfying test.

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

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1928 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
add xref to i#1078

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1929 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
i#1063: implement redirect_GetStdHandle()

git-svn-id: https://dynamorio.googlecode.com/svn/trunk@1930 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6
Fix bug where the modifications to LINK_FLAGS by add_rel_rpaths() are lost
when configure_DynamoRIO_{client,standalone} set LINK_FLAGS to an absolute
value by switching to an append model in configure_DynamoRIO_common().

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