Update v8.cpp

This commit is contained in:
恍兮惚兮 2024-03-19 23:45:33 +08:00
parent f26a9a14ef
commit 9b9b9dae57

View File

@ -20,13 +20,14 @@ namespace{
GlobalUnlock(hClipboardData); GlobalUnlock(hClipboardData);
}; };
hp.hook_after=[](hook_stack*s,void* data, size_t len){ hp.hook_after=[](hook_stack*s,void* data, size_t len){
HGLOBAL hClipboardData = GlobalAlloc(GMEM_MOVEABLE, len +2);
auto pchData = (wchar_t*)GlobalLock(hClipboardData);
std::wstring transwithfont; std::wstring transwithfont;
transwithfont+=L'\x01'; transwithfont+=L'\x01';
transwithfont+=embedsharedmem->fontFamily; transwithfont+=embedsharedmem->fontFamily;
transwithfont+=L'\x01'; transwithfont+=L'\x01';
transwithfont+=std::wstring((wchar_t*)data,len/2); transwithfont+=std::wstring((wchar_t*)data,len/2);
HGLOBAL hClipboardData = GlobalAlloc(GMEM_MOVEABLE, transwithfont.size()*2 +2);
auto pchData = (wchar_t*)GlobalLock(hClipboardData);
wcscpy(pchData, (wchar_t*)transwithfont.c_str()); wcscpy(pchData, (wchar_t*)transwithfont.c_str());
GlobalUnlock(hClipboardData); GlobalUnlock(hClipboardData);
s->arg2=(uintptr_t)hClipboardData; s->arg2=(uintptr_t)hClipboardData;