Update Arlib

This commit is contained in:
Alcaro
2016-12-20 02:10:51 +01:00
parent 9908250790
commit b56197317f
88 changed files with 25526 additions and 4386 deletions

View File

@@ -20,7 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//The above license applies only to this file, not the entire Arlib.
//The above license applies only to the WuTF directory, not the entire Arlib.
//See wutf.h for documentation.
@@ -159,6 +159,7 @@ void WuTF_redirect_function(WuTF_funcptr victim, WuTF_funcptr replacement)
DWORD prot;
//it's usually considered bad to have W+X on the same page, but the alternative is risking
// removing X from VirtualProtect or NtProtectVirtualMemory, and then I can't fix it.
//alternatively, it could make C do W; e.
//it doesn't matter, anyways; we (should be) called so early no hostile input has been processed
// yet, and even if hostile code is running, it can just wait until I put back X.
VirtualProtect((void*)victim, 64, PAGE_EXECUTE_READWRITE, &prot);
@@ -235,9 +236,9 @@ void WuTF_args(int* argc_p, char** * argv_p)
for (i=0;i<argc;i++)
{
int cb = WuTF_utf16_to_utf8(0, (uint16_t*)wargv[i], -1, NULL, 0);
int cb = WideCharToMultiByte(CP_UTF8, 0, wargv[i], -1, NULL, 0, NULL, NULL);
argv[i] = (char*)HeapAlloc(GetProcessHeap(), 0, cb);
WuTF_utf16_to_utf8(0, (uint16_t*)wargv[i], -1, argv[i], cb);
WideCharToMultiByte(CP_UTF8, 0, wargv[i], -1, argv[i], cb, NULL, NULL);
}
argv[argc]=0;