Add files via upload

这个提交包含在:
vxunderground 2021-05-28 14:26:32 -05:00 提交者 GitHub
父节点 db3660cd4d
当前提交 6caa15a99c
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23

查看文件

@ -0,0 +1,34 @@
#include <windows.h>
SIZE_T StringLengthA(LPCSTR String)
{
LPCSTR String2;
for (String2 = String; *String2; ++String2);
return (String2 - String);
}
SIZE_T CharStringToWCharString(PWCHAR Destination, PCHAR Source, SIZE_T MaximumAllowed)
{
INT Length = MaximumAllowed;
while (--Length >= 0)
{
if (!(*Destination++ = *Source++))
return MaximumAllowed - Length - 1;
}
return MaximumAllowed - Length;
}
INT main(VOID)
{
WCHAR Path[MAX_PATH * sizeof(WCHAR)] = { 0 };
CHAR CharPath[MAX_PATH] = "\\Users\\Tmp\\Desktop\\";
if(CharStringToWCharString(&Path, CharPath, StringLengthA(CharPath)) == 0)
return 1;
return ERROR_SUCCESS;
}