testing the check for imports and exports is made here
Proc CheckForImportExport:
Arguments @pDocType
Local @GetReadNames, @GetWriteNames, @InitConverter, @UnitConverter, @hClass, @hDesc, @hExt, @pBuff
Structure @BufferName 1024, @BufferStartDis 0
Uses ebx, ecx, edx,esi, edi, eax
;move D@pConverterPath D$esi+DocType.pszPathDis
mov esi D@pDocType
call ConverterGetLibrary D$esi+DocType.pszPathDis;D@pConverterPath
...If eax = &TRUE
call 'KERNEL32.GetProcAddress' D$CConverter.m_hLibCnv, {B$ "InitConverter32", 0} | mov D@InitConverter eax
call 'KERNEL32.GetProcAddress' D$CConverter.m_hLibCnv, {B$ "CchFetchLpszError", 0} | mov D$CConverter.m_CchFetchLpszError eax
call GetModuleName
call D@InitConverter &NULL, eax
call 'KERNEL32.GetProcAddress' D$CConverter.m_hLibCnv, {B$ "GetReadNames", 0} | mov D$CConverter.m_GetReadNames eax
..If eax <> &FALSE
call VMemAlloc D@BufferName, 1024 | mov D@pBuff eax
call GetReadNames &NULL, &NULL, D@BufferName
mov ebx D@BufferName
.If eax <> &FCENOERR;&TRUE
mov edx D$esi+DocType.pszPathDis
call ShowError eax
.Else_If B$ebx <> 0 ; <---- why here is showing 0FF as the 1st byte ????????????
mov eax D$esi+DocType.pszPathDis;eax
mov D$esi+DocType.bReadDis &TRUE
.Else
mov eax D$esi+DocType.pszPathDis;D@pConverterPath
mov D$esi+DocType.bReadDis &FALSE
.End_If
..Else
mov eax D$esi+DocType.pszPathDis;D@pConverterPath
..End_If
call 'KERNEL32.GetProcAddress' D$CConverter.m_hLibCnv, {B$ "GetWriteNames", 0} | mov D@GetWriteNames eax
call 'KERNEL32.GetProcAddress' D$CConverter.m_hLibCnv, {B$ "UninitConverter", 0} | mov D@UnitConverter eax
call eax
call VMemFree D@pBuff
...End_if
call 'KERNEL32.FreeLibrary' D$CConverter.m_hLibCnv
EndP
Proc GetReadNames::
Arguments @pOutName, @pOutDesc, @pOutExt
Local @hClass, @hDesc, @hExt, @pMem
Uses ebx, ecx, edx
call 'KERNEL32.GlobalAlloc' &GHND, 1024 | mov D@hClass eax
call 'KERNEL32.GlobalAlloc' &GHND, 1024 | mov D@hDesc eax
call 'KERNEL32.GlobalAlloc' &GHND, 1024 | mov D@hExt eax
call D$CConverter.m_GetReadNames D@hClass, D@hDesc, D@hExt
movzx eax ax
.If eax = &FCENOERR
If D@pOutName <> &NULL
call 'kernel32.GlobalLock' D@hClass
call StrCpy eax, D@pOutName
call 'kernel32.GlobalUnlock' D@hClass
End_If
If D@pOutDesc <> &NULL
call 'kernel32.GlobalLock' D@hDesc
call StrCpy eax, D@pOutDesc
call 'kernel32.GlobalUnlock' D@hDesc
End_If
If D@pOutExt <> &NULL
call 'kernel32.GlobalLock' D@hExt
call StrCpy eax, D@pOutExt
call 'kernel32.GlobalUnlock' D@hExt
End_If
mov ebx &FCENOERR;&TRUE
.Else
mov ebx eax
.End_If
call 'kernel32.GlobalFree' D@hClass
call 'kernel32.GlobalFree' D@hDesc
call 'kernel32.GlobalFree' D@hExt
mov eax ebx
EndP
Proc ShowError::
Arguments @ErrValue
Uses edx, ecx, esi, edi, ebx
call GetErrorMessage D@ErrValue
call 'USER32.MessageBoxA' 0, eax, {'Warning !!!', 0}, &MB_OK__&MB_ICONWARNING__&MB_SYSTEMMODAL
EndP
This is not the final function yet, beca8use i need to understand why some converters returns valid (FCENOERR),but the 1st byte of he extension is 0FF (after it had a stack problem on mine GetReadNames function.