mirror of
https://github.com/eclipse-threadx/filex.git
synced 2026-09-14 20:55:36 +08:00
* Updated version number constants * Updated copyright headers and removed revision history
102 lines
4.9 KiB
C
102 lines
4.9 KiB
C
/***************************************************************************
|
|
* Copyright (c) 2024 Microsoft Corporation
|
|
* Copyright (c) 2026-present Eclipse ThreadX contributors
|
|
*
|
|
* This program and the accompanying materials are made available under the
|
|
* terms of the MIT License which is available at
|
|
* https://opensource.org/licenses/MIT.
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
**************************************************************************/
|
|
|
|
|
|
/**************************************************************************/
|
|
/**************************************************************************/
|
|
/** */
|
|
/** FileX Component */
|
|
/** */
|
|
/** Unicode */
|
|
/** */
|
|
/**************************************************************************/
|
|
/**************************************************************************/
|
|
|
|
#define FX_SOURCE_CODE
|
|
|
|
|
|
/* Include necessary system files. */
|
|
|
|
#include "fx_api.h"
|
|
#include "fx_unicode.h"
|
|
|
|
|
|
FX_CALLER_CHECKING_EXTERNS
|
|
|
|
/**************************************************************************/
|
|
/* */
|
|
/* FUNCTION RELEASE */
|
|
/* */
|
|
/* _fxe_unicode_short_name_get PORTABLE C */
|
|
/* 6.1 */
|
|
/* AUTHOR */
|
|
/* */
|
|
/* William E. Lamie, Microsoft Corporation */
|
|
/* */
|
|
/* DESCRIPTION */
|
|
/* */
|
|
/* This function checks for errors in the Unicode short name get */
|
|
/* service. */
|
|
/* */
|
|
/* INPUT */
|
|
/* */
|
|
/* media_ptr Pointer to media */
|
|
/* source_unicode_name Pointer to unicode name */
|
|
/* source_unicode_length Length of unicode name */
|
|
/* destination_short_name Pointer to destination name */
|
|
/* */
|
|
/* OUTPUT */
|
|
/* */
|
|
/* Completion Status */
|
|
/* */
|
|
/* CALLS */
|
|
/* */
|
|
/* _fx_unicode_short_name_get Actual unicode short name get */
|
|
/* service */
|
|
/* */
|
|
/* CALLED BY */
|
|
/* */
|
|
/* Application Code */
|
|
/* */
|
|
/**************************************************************************/
|
|
UINT _fxe_unicode_short_name_get(FX_MEDIA *media_ptr, UCHAR *source_unicode_name, ULONG source_unicode_length,
|
|
CHAR *destination_short_name)
|
|
{
|
|
|
|
UINT status, i;
|
|
|
|
|
|
/* Check for a NULL media or name pointers. */
|
|
if ((media_ptr == FX_NULL) || (source_unicode_name == FX_NULL) || (source_unicode_length == 0) || (destination_short_name == FX_NULL))
|
|
{
|
|
return(FX_PTR_ERROR);
|
|
}
|
|
|
|
/* Check for a valid caller. */
|
|
FX_CALLER_CHECKING_CODE
|
|
|
|
/* Check unicode zero in source_unicode_name */
|
|
for (i = 0; i < (source_unicode_length << 1); i += 2)
|
|
{
|
|
if ((source_unicode_name[i] == 0) && (source_unicode_name[i + 1] == 0))
|
|
{
|
|
return(FX_INVALID_NAME);
|
|
}
|
|
}
|
|
|
|
/* Call actual Unicode short name get service. */
|
|
status = _fx_unicode_short_name_get(media_ptr, source_unicode_name, source_unicode_length, destination_short_name);
|
|
|
|
/* Return status to the caller. */
|
|
return(status);
|
|
}
|
|
|