Skip to content
Snippets Groups Projects
Commit a692c1bb authored by Eugene Livis's avatar Eugene Livis
Browse files

libtsk no longer includes common.h and doesn't use libcsrting or libcerror libraries

parent 20c1f51d
No related branches found
No related tags found
No related merge requests found
......@@ -26,12 +26,12 @@
* @returns 1 if error message was not set
*/
static uint8_t
getError(libcerror_error_t * vmdk_error,
getError(libvmdk_error_t * vmdk_error,
char error_string[TSK_VMDK_ERROR_STRING_SIZE])
{
int retval;
error_string[0] = '\0';
retval = libcerror_error_backtrace_sprint(vmdk_error,
retval = libvmdk_error_backtrace_sprint(vmdk_error,
error_string, TSK_VMDK_ERROR_STRING_SIZE);
if (retval)
return 1;
......@@ -44,7 +44,7 @@ vmdk_image_read(TSK_IMG_INFO * img_info, TSK_OFF_T offset, char *buf,
size_t len)
{
char error_string[TSK_VMDK_ERROR_STRING_SIZE];
libcerror_error_t *vmdk_error = NULL;
libvmdk_error_t *vmdk_error = NULL;
ssize_t cnt;
IMG_VMDK_INFO *vmdk_info = (IMG_VMDK_INFO *) img_info;
......@@ -105,7 +105,7 @@ static void
{
int i;
char error_string[TSK_VMDK_ERROR_STRING_SIZE];
libcerror_error_t *vmdk_error = NULL;
libvmdk_error_t *vmdk_error = NULL;
char *errmsg = NULL;
IMG_VMDK_INFO *vmdk_info = (IMG_VMDK_INFO *) img_info;
......@@ -149,7 +149,7 @@ vmdk_open(int a_num_img,
const TSK_TCHAR * const a_images[], unsigned int a_ssize)
{
char error_string[TSK_VMDK_ERROR_STRING_SIZE];
libcerror_error_t *vmdk_error = NULL;
libvmdk_error_t *vmdk_error = NULL;
int result = 0;
int i;
......@@ -232,11 +232,11 @@ vmdk_open(int a_num_img,
}
#if defined( TSK_WIN32 )
if (libvmdk_handle_open_wide(vmdk_info->handle,
(libcstring_system_character_t *) vmdk_info->images[0],
(const wchar_t *) vmdk_info->images[0],
LIBVMDK_OPEN_READ, &vmdk_error) != 1)
#else
if (libvmdk_handle_open(vmdk_info->handle,
(libcstring_system_character_t*) vmdk_info->images,
(const char *) vmdk_info->images,
LIBVMDK_OPEN_READ, &vmdk_error) != 1)
#endif
{
......
......@@ -24,34 +24,10 @@
#endif
// ELTODO perhaps undefine HAVE_MULTI_THREAD_SUPPORT
// ELTODO - are all of these neccessary? I guess there is no downside to having them...
#define HAVE_LOCAL_LIBCSTRING 1
#define HAVE_LOCAL_LIBCERROR 1
#define HAVE_LOCAL_LIBCTHREADS 1
#define HAVE_LOCAL_LIBCDATA 1
#define HAVE_LOCAL_LIBCLOCALE 1
#define HAVE_LOCAL_LIBCNOTIFY 1
#define HAVE_LOCAL_LIBCSPLIT 1
#define HAVE_LOCAL_LIBUNA 1
#define HAVE_LOCAL_LIBCFILE 1
#define HAVE_LOCAL_LIBCPATH 1
#define HAVE_LOCAL_LIBBFIO 1
#define HAVE_LOCAL_LIBFCACHE 1
#define HAVE_LOCAL_LIBFDATA 1
#define HAVE_LOCAL_LIBFVALUE 1
#define ZLIB_DLL 1
#define LIBVMDK_DLL_EXPORT 1
#if defined( TSK_WIN32 )
#define LIBVMDK_HAVE_WIDE_CHARACTER_TYPE 1
#endif
#include <common.h>
#include <libcerror_definitions.h>
#include <libcerror_error.h>
#include <libcerror_system.h>
#include <libcerror_types.h>
#include <libcstring_definitions.h>
#include <libcstring_narrow_string.h>
#include <libcstring_system_string.h>
#include <libcstring_types.h>
#include <libcstring_wide_string.h>
#include <libvmdk.h> // libvmdk.h needs to be last to take into account all #defines from other header files
#ifdef __cplusplus
......@@ -66,7 +42,7 @@ extern "C" {
libvmdk_handle_t *handle;
TSK_TCHAR **images;
int num_imgs;
tsk_lock_t read_lock; ///< Lock for reads since libvmdk is not thread safe -- only works if you have a single instance of VMDK_INFO for all threads.
tsk_lock_t read_lock; ///< ELTODO: Lock for reads since libvmdk is not thread safe -- only works if you have a single instance of VMDK_INFO for all threads.
} IMG_VMDK_INFO;
#ifdef __cplusplus
......
......@@ -240,7 +240,7 @@ copy "$(SolutionDir)\PostgreSQL_CRT\win32\msvcr120.dll" "$(OutDir)"
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\;$(LIBVMDK_HOME);$(LIBVMDK_HOME)\include;$(LIBVMDK_HOME)\common;$(LIBVMDK_HOME)\libcerror;$(LIBVMDK_HOME)\libcstring;$(LIBEWF_HOME)\common;$(LIBEWF_HOME)\include;$(LIBEWF_HOME)\..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\;$(LIBVMDK_HOME)\include;$(LIBEWF_HOME)\include;$(LIBEWF_HOME)\..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;HAVE_LIBEWF;HAVE_LIBVMDK;HAVE_LIBZ;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
......@@ -353,7 +353,7 @@ copy "$(SolutionDir)\PostgreSQL_CRT\win32\msvcr120.dll" "$(OutDir)" </Command>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\;$(LIBVMDK_HOME);$(LIBVMDK_HOME)\include;$(LIBVMDK_HOME)\common;$(LIBVMDK_HOME)\libcerror;$(LIBVMDK_HOME)\libcstring;$(LIBEWF_HOME)\common;$(LIBEWF_HOME)\include;$(LIBEWF_HOME)\..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\;$(LIBVMDK_HOME)\include;$(LIBEWF_HOME)\include;$(LIBEWF_HOME)\..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;HAVE_LIBEWF_EL;HAVE_LIBVMDK;HAVE_LIBZ;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment