mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 22:20:31 +00:00
Cut down on some strlens for xdk
This commit is contained in:
parent
c2b81881ae
commit
bc91eb6ceb
@ -918,18 +918,17 @@ static HRESULT xbox_io_mount(char *szDrive, char *szDevice)
|
|||||||
#endif
|
#endif
|
||||||
char szSourceDevice[48] = {0};
|
char szSourceDevice[48] = {0};
|
||||||
char szDestinationDrive[16] = {0};
|
char szDestinationDrive[16] = {0};
|
||||||
|
size_t sz_src_device_len = snprintf(szSourceDevice, sizeof(szSourceDevice),
|
||||||
snprintf(szSourceDevice, sizeof(szSourceDevice),
|
|
||||||
"\\Device\\%s", szDevice);
|
"\\Device\\%s", szDevice);
|
||||||
snprintf(szDestinationDrive, sizeof(szDestinationDrive),
|
size_t sz_dest_len = snprintf(szDestinationDrive, sizeof(szDestinationDrive),
|
||||||
"\\??\\%s", szDrive);
|
"\\??\\%s", szDrive);
|
||||||
|
|
||||||
DeviceName.Length = strlen(szSourceDevice);
|
DeviceName.Length = sz_src_device_len;
|
||||||
DeviceName.MaximumLength = strlen(szSourceDevice) + 1;
|
DeviceName.MaximumLength = sz_src_device_len + 1;
|
||||||
DeviceName.Buffer = szSourceDevice;
|
DeviceName.Buffer = szSourceDevice;
|
||||||
|
|
||||||
LinkName.Length = strlen(szDestinationDrive);
|
LinkName.Length = sz_dest_len;
|
||||||
LinkName.MaximumLength = strlen(szDestinationDrive) + 1;
|
LinkName.MaximumLength = sz_dest_len + 1;
|
||||||
LinkName.Buffer = szDestinationDrive;
|
LinkName.Buffer = szDestinationDrive;
|
||||||
|
|
||||||
IoCreateSymbolicLink(&LinkName, &DeviceName);
|
IoCreateSymbolicLink(&LinkName, &DeviceName);
|
||||||
@ -947,12 +946,11 @@ static HRESULT xbox_io_unmount(char *szDrive)
|
|||||||
{
|
{
|
||||||
STRING LinkName;
|
STRING LinkName;
|
||||||
char szDestinationDrive[16] = {0};
|
char szDestinationDrive[16] = {0};
|
||||||
|
size_t sz_dest_len = snprintf(szDestinationDrive, sizeof(szDestinationDrive),
|
||||||
snprintf(szDestinationDrive, sizeof(szDestinationDrive),
|
|
||||||
"\\??\\%s", szDrive);
|
"\\??\\%s", szDrive);
|
||||||
|
|
||||||
LinkName.Length = strlen(szDestinationDrive);
|
LinkName.Length = sz_dest_len;
|
||||||
LinkName.MaximumLength = strlen(szDestinationDrive) + 1;
|
LinkName.MaximumLength = sz_dest_len + 1;
|
||||||
LinkName.Buffer = szDestinationDrive;
|
LinkName.Buffer = szDestinationDrive;
|
||||||
|
|
||||||
IoDeleteSymbolicLink(&LinkName);
|
IoDeleteSymbolicLink(&LinkName);
|
||||||
@ -976,8 +974,7 @@ HRESULT ObCreateSymbolicLink(PSTRING SymbolicLinkName, PSTRING DeviceName);
|
|||||||
static HRESULT xbox_io_mount(const char* szDrive, char* szDevice)
|
static HRESULT xbox_io_mount(const char* szDrive, char* szDevice)
|
||||||
{
|
{
|
||||||
STRING DeviceName, LinkName;
|
STRING DeviceName, LinkName;
|
||||||
char szDestinationDrive[PATH_MAX_LENGTH];
|
char szDestinationDrive[16];
|
||||||
|
|
||||||
snprintf(szDestinationDrive, sizeof(szDestinationDrive),
|
snprintf(szDestinationDrive, sizeof(szDestinationDrive),
|
||||||
"\\??\\%s", szDrive);
|
"\\??\\%s", szDrive);
|
||||||
RtlInitAnsiString(&DeviceName, szDevice);
|
RtlInitAnsiString(&DeviceName, szDevice);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user