Hello all,
At one point in my driver I need to copy a wchar from one variable to another so I have been using wcscpy. While in checked build mode this works although it gives me a warning saying that it is found in dontuse.h as a security concern. When I switched to trying the free build it treated this warning as an error and did not build. So I switched from using wcscpy to wcscpy_s and now I am getting:
error LNK2019: unresolved external symbol _wcscpy_s referenced in function “long __stdcall CreateConnection(struct _USER_GLOBAL_INFO *,struct _CONNECT_IN*)” (?CreateConnection@@YGJPAU_USER_GLOBAL_INFO@@PAU_CONNECT_IN@@@Z)
So now I am unsure what to do, wcscpy builds fine in checked mode but won’t build in release mode, but the correct function wcscpy_s won’t build in either mode.
Here is the code so you can see I am using wcscpy_s correctly:
//BEFORE THE CHANGE
wcscpy(pEntry->Disk0BaseAddress, PConnectInfo->Disk0Path);
//AFTER THE CHANGE
wcscpy_s(pEntry->Disk0BaseAddress, 256, PConnectInfo->Disk0Path);
Thanks for your help in advance. I will continue to work in the checked build until this problem is resolved.
Daniel