Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 DuplicateHandle 复制句柄,然后通过 IPC 将该句柄传递给子进程。子进程以字符串形式获取句柄值,例如“388”。我将其转换为 long 并将其分配给 HANDLE。这个对吗:
WCHAR* pszEnd = NULL; myToken = (HANDLE) wcstol(tokenHandleString, &pszEnd, 10);
我发现理想的解决方案是将其作为二进制而不是字符串传递。但是,上述方法确实有效。