Пример #1
0
static tiny_ret_t _dos_find_first_lfn( const char *path, unsigned attrib, lfnfind_t *lfndta )
/*******************************************************************************************/
{
#ifdef _M_I86
    return( __dos_find_first_lfn( path, attrib, lfndta ) );
#else
    call_struct     dpmi_rm;

    strcpy( RM_TB_PARM1_LINEAR, path );
    memset( &dpmi_rm, 0, sizeof( dpmi_rm ) );
    dpmi_rm.ds  = RM_TB_PARM1_SEGM;
    dpmi_rm.edx = RM_TB_PARM1_OFFS;
    dpmi_rm.es  = RM_TB_PARM2_SEGM;
    dpmi_rm.edi = RM_TB_PARM2_OFFS;
    dpmi_rm.ecx = attrib;
    dpmi_rm.esi = 1;
    dpmi_rm.eax = 0x714E;
    dpmi_rm.flags = 1;
    if( __dpmi_dos_call( &dpmi_rm ) ) {
        return( -1 );
    }
    if( dpmi_rm.flags & 1 ) {
        return( TINY_RET_ERROR( dpmi_rm.ax ) );
    }
    memcpy( lfndta, RM_TB_PARM2_LINEAR, sizeof( *lfndta ) );
    return( dpmi_rm.ax );
#endif
}
Пример #2
0
static tiny_ret_t _dos_find_next_lfn( unsigned handle, lfnfind_t *lfndta )
/************************************************************************/
{
#ifdef _M_I86
    return( __dos_find_next_lfn( handle, lfndta ) );
#else
    call_struct     dpmi_rm;

    memset( &dpmi_rm, 0, sizeof( dpmi_rm ) );
    dpmi_rm.es  = RM_TB_PARM1_SEGM;
    dpmi_rm.edi = RM_TB_PARM1_OFFS;
    dpmi_rm.ebx = handle;
    dpmi_rm.esi = 1;
    dpmi_rm.eax = 0x714F;
    dpmi_rm.flags = 1;
    if( __dpmi_dos_call( &dpmi_rm ) ) {
        return( -1 );
    }
    if( dpmi_rm.flags & 1 ) {
        return( TINY_RET_ERROR( dpmi_rm.ax ) );
    }
    memcpy( lfndta, RM_TB_PARM1_LINEAR, sizeof( *lfndta ) );
    return( 0 );
#endif
}
Пример #3
0
static tiny_ret_t _dos_open_ex_lfn( const char *name, unsigned mode )
/*******************************************************************/
{
#ifdef _M_I86
    return( __dos_create_ex_lfn( name, mode, 0, EX_LFN_OPEN ) );
#else
    call_struct     dpmi_rm;

    strcpy( RM_TB_PARM1_LINEAR, name );
    memset( &dpmi_rm, 0, sizeof( dpmi_rm ) );
    dpmi_rm.ds  = RM_TB_PARM1_SEGM;
    dpmi_rm.esi = RM_TB_PARM1_OFFS;
    dpmi_rm.edx = EX_LFN_OPEN;
    dpmi_rm.ecx = 0;
    dpmi_rm.ebx = mode;
    dpmi_rm.eax = 0x716C;
    dpmi_rm.flags = 1;
    if( __dpmi_dos_call( &dpmi_rm ) ) {
        return( -1 );
    }
    if( dpmi_rm.flags & 1 ) {
        return( dpmi_rm.ax | ~ 0xFFFF );
    }
    return( dpmi_rm.ax );
#endif
}
Пример #4
0
static unsigned _dos_getfileattr_lfn( const char *path, unsigned *attrib )
/************************************************************************/
{
  #ifdef _M_I86
    return( __dos_getfileattr_lfn( path, attrib ) );
  #else
    call_struct     dpmi_rm;

    strcpy( RM_TB_PARM1_LINEAR, path );
    memset( &dpmi_rm, 0, sizeof( dpmi_rm ) );
    dpmi_rm.ds  = RM_TB_PARM1_SEGM;
    dpmi_rm.edx = RM_TB_PARM1_OFFS;
    dpmi_rm.ecx = 0;
    dpmi_rm.ebx = 0;
    dpmi_rm.eax = 0x7143;
    dpmi_rm.flags = 1;
    if( __dpmi_dos_call( &dpmi_rm ) ) {
        return( -1 );
    }
    if( dpmi_rm.flags & 1 ) {
        return( __set_errno_dos_reterr( (unsigned short)dpmi_rm.eax ) );
    }
    *attrib = dpmi_rm.ecx;
    return( 0 );
  #endif
}
Пример #5
0
static tiny_ret_t _dos_find_close_lfn( unsigned handle )
/******************************************************/
{
#ifdef _M_I86
    return( __dos_find_close_lfn( handle ) );
#else
    call_struct     dpmi_rm;

    memset( &dpmi_rm, 0, sizeof( dpmi_rm ) );
    dpmi_rm.ebx = handle;
    dpmi_rm.eax = 0x71A1;
    dpmi_rm.flags = 1;
    if( __dpmi_dos_call( &dpmi_rm ) ) {
        return( -1 );
    }
    if( dpmi_rm.flags & 1 ) {
        return( TINY_RET_ERROR( dpmi_rm.ax ) );
    }
    return( 0 );
#endif
}
Пример #6
0
static tiny_ret_t _mkdir_lfn( const char *path )
/**********************************************/
{
#ifdef _M_I86
    return( __mkdir_lfn( path ) );
#else
    call_struct     dpmi_rm;

    strcpy( RM_TB_PARM1_LINEAR, path );
    memset( &dpmi_rm, 0, sizeof( dpmi_rm ) );
    dpmi_rm.ds  = RM_TB_PARM1_SEGM;
    dpmi_rm.edx = RM_TB_PARM1_OFFS;
    dpmi_rm.eax = 0x7139;
    dpmi_rm.flags = 1;
    if( __dpmi_dos_call( &dpmi_rm ) ) {
        return( -1 );
    }
    if( dpmi_rm.flags & 1 ) {
        return( dpmi_rm.ax | ~ 0xFFFF );
    }
    return( 0 );
#endif
}
Пример #7
0
static unsigned _mkdir_lfn( const char *path )
/********************************************/
{
#ifdef _M_I86
    return( __mkdir_lfn( path ) );
#else
    call_struct     dpmi_rm;

    strcpy( RM_TB_PARM1_LINEAR, path );
    memset( &dpmi_rm, 0, sizeof( dpmi_rm ) );
    dpmi_rm.ds  = RM_TB_PARM1_SEGM;
    dpmi_rm.edx = RM_TB_PARM1_OFFS;
    dpmi_rm.eax = 0x7139;
    dpmi_rm.flags = 1;
    if( __dpmi_dos_call( &dpmi_rm ) ) {
        return( -1 );
    }
    if( dpmi_rm.flags & 1 ) {
        return( __set_errno_dos_reterr( (unsigned short)dpmi_rm.eax ) );
    }
    return( 0 );
#endif
}
Пример #8
0
static tiny_ret_t _getfileinfo_lfn( int handle, lfninfo_t *lfninfo )
{
#ifdef _M_I86
    return( __getfileinfo_lfn( handle, lfninfo ) );
#else
    call_struct     dpmi_rm;

    memset( &dpmi_rm, 0, sizeof( dpmi_rm ) );
    dpmi_rm.ds  = RM_TB_PARM1_SEGM;
    dpmi_rm.edx = RM_TB_PARM1_OFFS;
    dpmi_rm.ebx = handle;
    dpmi_rm.eax = 0x71A6;
    dpmi_rm.flags = 1;
    if( __dpmi_dos_call( &dpmi_rm ) ) {
        return( -1 );
    }
    if( dpmi_rm.flags & 1 ) {
        return( dpmi_rm.ax | ~ 0xFFFF );
    }
    memcpy( lfninfo, RM_TB_PARM1_LINEAR, sizeof( *lfninfo ) );
    return( 0 );
#endif
}
Пример #9
0
static long _cvt_stamp2dos_lfn( long long *timestamp )
{
#ifdef _M_I86
    return( __cvt_stamp2dos_lfn( timestamp ) );
#else
    call_struct     dpmi_rm;

    *((long long *)RM_TB_PARM1_LINEAR) = *timestamp;
    memset( &dpmi_rm, 0, sizeof( dpmi_rm ) );
    dpmi_rm.ds  = RM_TB_PARM1_SEGM;
    dpmi_rm.esi = RM_TB_PARM1_OFFS;
    dpmi_rm.ebx = 0;
    dpmi_rm.eax = 0x71A7;
    dpmi_rm.flags = 1;
    if( __dpmi_dos_call( &dpmi_rm ) ) {
        return( -1 );
    }
    if( dpmi_rm.flags & 1 ) {
        return( __set_errno_dos( dpmi_rm.ax ) );
    }
    return( dpmi_rm.dx << 16 | dpmi_rm.cx );
#endif
}
Пример #10
0
static tiny_ret_t _unlink_lfn( const char *filename )
/***************************************************/
{
#ifdef _M_I86
    return( __unlink_lfn( filename ) );
#else
    call_struct     dpmi_rm;

    strcpy( RM_TB_PARM1_LINEAR, filename );
    memset( &dpmi_rm, 0, sizeof( dpmi_rm ) );
    dpmi_rm.ds  = RM_TB_PARM1_SEGM;
    dpmi_rm.edx = RM_TB_PARM1_OFFS;
    dpmi_rm.esi = 0;
    dpmi_rm.eax = 0x7141;
    dpmi_rm.flags = 1;
    if( __dpmi_dos_call( &dpmi_rm ) ) {
        return( -1 );
    }
    if( dpmi_rm.flags & 1 ) {
        return( TINY_RET_ERROR( dpmi_rm.ax ) );
    }
    return( 0 );
#endif
}
Пример #11
0
static unsigned _unlink_lfn( const char *filename )
/*************************************************/
{
#ifdef _M_I86
    return( __unlink_lfn( filename ) );
#else
    call_struct     dpmi_rm;

    strcpy( RM_TB_PARM1_LINEAR, filename );
    memset( &dpmi_rm, 0, sizeof( dpmi_rm ) );
    dpmi_rm.ds  = RM_TB_PARM1_SEGM;
    dpmi_rm.edx = RM_TB_PARM1_OFFS;
    dpmi_rm.esi = 0;
    dpmi_rm.eax = 0x7141;
    dpmi_rm.flags = 1;
    if( __dpmi_dos_call( &dpmi_rm ) ) {
        return( -1 );
    }
    if( dpmi_rm.flags & 1 ) {
        return( __set_errno_dos_reterr( (unsigned short)dpmi_rm.eax ) );
    }
    return( 0 );
#endif
}