mirror of
https://github.com/ModOrganizer2/libbsarch.git
synced 2026-07-27 14:06:31 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3855899330 | ||
|
|
6c3a9234e4 | ||
|
|
322b6c0302 | ||
|
|
6fe376e887 | ||
|
|
bd0ab57f6d | ||
|
|
08536255ff | ||
|
|
30b4a2eb8d | ||
|
|
f92b4cdb28 |
@@ -442,3 +442,6 @@ healthchecksdb
|
||||
MigrationBackup/
|
||||
|
||||
# End of https://www.gitignore.io/api/vim,delphi,visualstudio,visualstudiocode
|
||||
|
||||
libbsarch_delphi*
|
||||
libbsarch_test.pas
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Deorder
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -10,3 +10,8 @@ BSArchive Dynamic Link Library and C++ bindings
|
||||
## How to use
|
||||
|
||||
Use the `libbsarch.dll` (The one created by Delphi, not Visual Studio), `libbsarch.lib` and `libbsarch.h` in your project.
|
||||
|
||||
## Credits
|
||||
|
||||
The original BSArchive can be found at: https://github.com/TES5Edit/TES5Edit/tree/dev/Tools/BSArchive
|
||||
The version in this project had been modified for better compatibility with C/C++ and allow the users to allocate their own memory in some cases.
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "libbsarch.h"
|
||||
|
||||
#pragma comment(lib, "libbsarch")
|
||||
|
||||
int main() {
|
||||
bsa_archive_t archive = bsa_create();
|
||||
|
||||
bsa_result_message_t result = bsa_load_from_file(archive, L"test_read.bsa");
|
||||
if(result.code < 0)
|
||||
printf("%ls\n", result.text);
|
||||
bsa_close(archive);
|
||||
|
||||
bsa_entry_list_t entries = bsa_entry_list_create();
|
||||
bsa_entry_list_add(entries, L"textures\\grass\\test.dds");
|
||||
|
||||
bsa_create_archive(archive, L"test_write.bsa", baSSE, entries);
|
||||
bsa_add_file_from_disk(archive, L"files", L"files\\textures\\grass\\test.dds");
|
||||
bsa_save(archive);
|
||||
bsa_close(archive);
|
||||
|
||||
bsa_entry_list_free(entries);
|
||||
|
||||
bsa_free(archive);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.28803.156
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbsarch-visualstudio-test", "libbsarch-visualstudio-test.vcxproj", "{8F73F848-939D-4862-B58B-26572CF20A5F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8F73F848-939D-4862-B58B-26572CF20A5F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{8F73F848-939D-4862-B58B-26572CF20A5F}.Debug|x64.Build.0 = Debug|x64
|
||||
{8F73F848-939D-4862-B58B-26572CF20A5F}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{8F73F848-939D-4862-B58B-26572CF20A5F}.Debug|x86.Build.0 = Debug|Win32
|
||||
{8F73F848-939D-4862-B58B-26572CF20A5F}.Release|x64.ActiveCfg = Release|x64
|
||||
{8F73F848-939D-4862-B58B-26572CF20A5F}.Release|x64.Build.0 = Release|x64
|
||||
{8F73F848-939D-4862-B58B-26572CF20A5F}.Release|x86.ActiveCfg = Release|Win32
|
||||
{8F73F848-939D-4862-B58B-26572CF20A5F}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {F05F0FBF-790B-4443-B2EC-E7033074D9E0}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,176 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{8F73F848-939D-4862-B58B-26572CF20A5F}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>libbsarchvisualstudiotest</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>libbsarch-visualstudio-test</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
<ReferencePath>$(OutDir);$(ReferencePath)</ReferencePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
||||
<ReferencePath>$(OutDir);$(ReferencePath)</ReferencePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
<ReferencePath>$(OutDir);$(ReferencePath)</ReferencePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
||||
<ReferencePath>$(OutDir);$(ReferencePath)</ReferencePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="libbsarch-visualstudio-test.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="libbsarch-visualstudio-test.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
+48
-48
@@ -8,19 +8,19 @@ BSARCH_DLL_API(bsa_entry_list_t) bsa_entry_list_create() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(void) bsa_entry_list_free(bsa_entry_list_t *entry_list) {
|
||||
return;
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_entry_list_free(bsa_entry_list_t entry_list) {
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(uint32_t) bsa_entry_list_count(bsa_entry_list_t *entry_list) {
|
||||
BSARCH_DLL_API(uint32_t) bsa_entry_list_count(bsa_entry_list_t entry_list) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(void) bsa_entry_list_add(bsa_entry_list_t *entry_list, char *entry_string) {
|
||||
return;
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_entry_list_add(bsa_entry_list_t entry_list, const wchar_t *entry_string) {
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(uint32_t) bsa_entry_list_get(bsa_entry_list_t *entry_list, uint32_t index, uint32_t string_buffer_size, char *string_buffer) {
|
||||
BSARCH_DLL_API(uint32_t) bsa_entry_list_get(bsa_entry_list_t entry_list, uint32_t index, uint32_t string_buffer_size, const wchar_t *string_buffer) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -28,122 +28,122 @@ BSARCH_DLL_API(bsa_archive_t) bsa_create() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(void) bsa_free(bsa_archive_t archive) {
|
||||
return;
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_free(bsa_archive_t archive) {
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(void) bsa_load_from_file(bsa_archive_t archive, char *filename) {
|
||||
return;
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_load_from_file(bsa_archive_t archive, const wchar_t *filename) {
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(void) bsa_create_archive(bsa_archive_t archive, char *filename, bsa_archive_type_t archive_type, bsa_entry_list_t entry_list) {
|
||||
return;
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_create_archive(bsa_archive_t archive, const wchar_t *filename, bsa_archive_type_t archive_type, bsa_entry_list_t entry_list) {
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(void) bsa_save(bsa_archive_t archive) {
|
||||
return;
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_save(bsa_archive_t archive) {
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(void) bsa_add_file_from_disk(bsa_archive_t archive, char *root_dir, char *filename) {
|
||||
return;
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_add_file_from_disk(bsa_archive_t archive, const wchar_t *root_dir, const wchar_t *filename) {
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(void) bsa_add_file_from_memory(bsa_archive_t archive, char *filename, uint32_t size, bsa_file_data_t data) {
|
||||
return;
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_add_file_from_memory(bsa_archive_t archive, const wchar_t *filename, uint32_t size, bsa_buffer_t data) {
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(bsa_file_record_t) bsa_find_file_record(bsa_archive_t archive, char *filename) {
|
||||
BSARCH_DLL_API(bsa_file_record_t) bsa_find_file_record(bsa_archive_t archive, const wchar_t *filename) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(bsa_file_data_result_t) bsa_extract_file_data_by_record(bsa_archive_t archive, bsa_file_record_t file_record) {
|
||||
BSARCH_DLL_API(bsa_result_message_buffer_t) bsa_extract_file_data_by_record(bsa_archive_t archive, bsa_file_record_t file_record) {
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(bsa_file_data_result_t) bsa_extract_file_data_by_filename(bsa_archive_t archive, char *filename) {
|
||||
BSARCH_DLL_API(bsa_result_message_buffer_t) bsa_extract_file_data_by_filename(bsa_archive_t archive, const wchar_t *filename) {
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(void) bsa_file_data_free(bsa_archive_t archive, bsa_file_data_result_t file_data_result) {
|
||||
return;
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_file_data_free(bsa_archive_t archive, bsa_result_buffer_t file_data_result) {
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(void) bsa_extract_file(bsa_archive_t archive, char *filename, char *save_as) {
|
||||
return;
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_extract_file(bsa_archive_t archive, const wchar_t *filename, const wchar_t *save_as) {
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(void) bsa_iterate_files(bsa_archive_t archive, bsa_file_iteration_proc_t file_iteration_proc, void *context) {
|
||||
return;
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_iterate_files(bsa_archive_t archive, bsa_file_iteration_proc_t file_iteration_proc, void *context) {
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(bool) bsa_file_exists(bsa_archive_t archive, char *filename) {
|
||||
BSARCH_DLL_API(bool) bsa_file_exists(bsa_archive_t archive, const wchar_t *filename) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(void) bsa_get_resource_list(bsa_archive_t archive, bsa_entry_list_t entry_result_list, char *folder) {
|
||||
return;
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_get_resource_list(bsa_archive_t archive, bsa_entry_list_t entry_result_list, const wchar_t *folder) {
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(void) bsa_resolve_hash(bsa_archive_t archive, uint64_t hash, bsa_entry_list_t entry_result_list) {
|
||||
return;
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_resolve_hash(bsa_archive_t archive, uint64_t hash, bsa_entry_list_t entry_result_list) {
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(void) bsa_close(bsa_archive_t archive) {
|
||||
return;
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_close(bsa_archive_t archive) {
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(uint32_t) bsa_filename_get(bsa_archive_t *archive, uint32_t string_buffer_size, char *string_buffer) {
|
||||
BSARCH_DLL_API(uint32_t) bsa_filename_get(bsa_archive_t archive, uint32_t string_buffer_size, const wchar_t *string_buffer) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(bsa_archive_type_t) bsa_archive_type_get(bsa_archive_t *archive) {
|
||||
BSARCH_DLL_API(bsa_archive_type_t) bsa_archive_type_get(bsa_archive_t archive) {
|
||||
return bsa_archive_type_t::baNone;
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(uint32_t) bsa_version_get(bsa_archive_t *archive) {
|
||||
BSARCH_DLL_API(uint32_t) bsa_version_get(bsa_archive_t archive) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(uint32_t) bsa_format_name_get(bsa_archive_t *archive, uint32_t string_buffer_size, char *string_buffer) {
|
||||
BSARCH_DLL_API(uint32_t) bsa_format_name_get(bsa_archive_t archive, uint32_t string_buffer_size, const wchar_t *string_buffer) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(uint32_t) bsa_file_count_get(bsa_archive_t *archive) {
|
||||
BSARCH_DLL_API(uint32_t) bsa_file_count_get(bsa_archive_t archive) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(uint32_t) bsa_archive_flags_get(bsa_archive_t *archive) {
|
||||
BSARCH_DLL_API(uint32_t) bsa_archive_flags_get(bsa_archive_t archive) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(void) bsa_archive_flags_set(bsa_archive_t *archive, uint32_t flags) {
|
||||
BSARCH_DLL_API(void) bsa_archive_flags_set(bsa_archive_t archive, uint32_t flags) {
|
||||
return;
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(uint32_t) bsa_file_flags_get(bsa_archive_t *archive) {
|
||||
BSARCH_DLL_API(uint32_t) bsa_file_flags_get(bsa_archive_t archive) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(void) bsa_file_flags_set(bsa_archive_t *archive, uint32_t flags) {
|
||||
BSARCH_DLL_API(void) bsa_file_flags_set(bsa_archive_t archive, uint32_t flags) {
|
||||
return;
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(bool) bsa_compress_get(bsa_archive_t *archive) {
|
||||
BSARCH_DLL_API(bool) bsa_compress_get(bsa_archive_t archive) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(void) bsa_compress_set(bsa_archive_t *archive, bool flags) {
|
||||
BSARCH_DLL_API(void) bsa_compress_set(bsa_archive_t archive, bool flags) {
|
||||
return;
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(bool) bsa_share_data_get(bsa_archive_t *archive) {
|
||||
BSARCH_DLL_API(bool) bsa_share_data_get(bsa_archive_t archive) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(void) bsa_share_data_set(bsa_archive_t *archive, bool flags) {
|
||||
BSARCH_DLL_API(void) bsa_share_data_set(bsa_archive_t archive, bool flags) {
|
||||
return;
|
||||
}
|
||||
|
||||
BSARCH_DLL_API(void) bsa_file_dds_info_callback_set(bsa_archive_t *archive, bsa_file_dds_info_proc_t file_dds_info_proc) {
|
||||
BSARCH_DLL_API(void) bsa_file_dds_info_callback_set(bsa_archive_t archive, bsa_file_dds_info_proc_t file_dds_info_proc) {
|
||||
return;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
LIBRARY LIBBSARCH_DLL
|
||||
LIBRARY LIBBSARCH
|
||||
;DESCRIPTION "BSArch DLL"
|
||||
EXPORTS
|
||||
bsa_entry_list_create
|
||||
|
||||
+233
-72
@@ -5,204 +5,365 @@ uses
|
||||
Classes,
|
||||
Types,
|
||||
SysUtils,
|
||||
wbStreams in 'wbStreams.pas',
|
||||
wbBSArchive in './wbBSArchive.pas';
|
||||
wbStreams,
|
||||
wbBSArchive;
|
||||
|
||||
{$IFDEF FPC}
|
||||
{$mode delphi}{$H+}
|
||||
{$ENDIF}
|
||||
type
|
||||
TwbBSResultCode = (
|
||||
BSA_RESULT_NONE = 0,
|
||||
BSA_RESULT_EXCEPTION = -1
|
||||
);
|
||||
TwbBSResultMessage = packed record
|
||||
code: ShortInt;
|
||||
text: array[0..1023] of WideChar;
|
||||
end;
|
||||
TwbBSResultMessageBuffer = packed record
|
||||
buffer: TwbBSResultBuffer;
|
||||
message: TwbBSResultMessage;
|
||||
end;
|
||||
|
||||
{Shared}
|
||||
|
||||
function string_to_cstring(aString: String; const aStringBufferSize: Cardinal;
|
||||
const aStringBuffer: PChar): Cardinal; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function string_to_cstring(
|
||||
aString: String;
|
||||
const aStringBufferSize: Cardinal;
|
||||
const aStringBuffer: PChar
|
||||
): Integer; stdcall;
|
||||
begin
|
||||
Result := Min(aStringBufferSize, Length(AString));
|
||||
if (aStringBuffer <> nil) and (Result > 0) then
|
||||
Move(AString[1], aStringBuffer^, Result * SizeOf(Char));
|
||||
Move(AString[1], aStringBuffer^, Result * SizeOf(WideChar));
|
||||
end;
|
||||
|
||||
function string_to_cstring_end(
|
||||
aString: String;
|
||||
const aStringBufferSize: Cardinal;
|
||||
const aStringBuffer: PChar
|
||||
): Integer; stdcall;
|
||||
begin
|
||||
Result := Min(aStringBufferSize - 1, Length(AString));
|
||||
if (aStringBuffer <> nil) and (Result > 0) then
|
||||
begin
|
||||
Move(AString[1], aStringBuffer^, Result * SizeOf(WideChar));
|
||||
aStringBuffer[Result] := #0;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure exception_handler(E: Exception; var Result: TwbBSResultMessage); stdcall;
|
||||
begin
|
||||
Result.code := ShortInt(BSA_RESULT_EXCEPTION);
|
||||
string_to_cstring_end(E.Message, Length(Result.text), Result.text);
|
||||
end;
|
||||
|
||||
procedure buffer_exception_handler(E: Exception; var Result: TwbBSResultMessageBuffer); stdcall;
|
||||
begin
|
||||
Result.buffer.size := 0;
|
||||
Result.buffer.data := nil;
|
||||
Result.message.code := ShortInt(BSA_RESULT_EXCEPTION);
|
||||
string_to_cstring_end(E.Message, Length(Result.message.text), Result.message.text);
|
||||
end;
|
||||
|
||||
{BSA File List}
|
||||
|
||||
function bsa_entry_list_create:Pointer; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_entry_list_create:Pointer; stdcall;
|
||||
begin
|
||||
Result := TwbBSEntryList.Create;
|
||||
try
|
||||
Result := TwbBSEntryList.Create;
|
||||
except
|
||||
Result := nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure bsa_entry_list_free(obj: Pointer); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_entry_list_free(obj: Pointer): TwbBSResultMessage; stdcall;
|
||||
begin
|
||||
TwbBSEntryList(obj).Clear();
|
||||
TwbBSEntryList(obj).free;
|
||||
Result.code := Ord(BSA_RESULT_NONE);
|
||||
try
|
||||
TwbBSEntryList(obj).Clear();
|
||||
TwbBSEntryList(obj).free;
|
||||
except
|
||||
on E: Exception do
|
||||
exception_handler(E, Result);
|
||||
end;
|
||||
end;
|
||||
|
||||
function bsa_entry_list_count(obj: Pointer): Cardinal; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_entry_list_count(obj: Pointer): Integer; stdcall;
|
||||
begin
|
||||
Result := TwbBSEntryList(obj).Count;
|
||||
try
|
||||
Result := TwbBSEntryList(obj).Count;
|
||||
except
|
||||
Result := Ord(BSA_RESULT_EXCEPTION);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure bsa_entry_list_add(obj: Pointer; const aEntryString: PChar); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_entry_list_add(obj: Pointer; const aEntryString: PChar): TwbBSResultMessage; stdcall;
|
||||
begin
|
||||
TwbBSEntryList(obj).Add(String(aEntryString));
|
||||
Result.code := Ord(BSA_RESULT_NONE);
|
||||
try
|
||||
TwbBSEntryList(obj).Add(String(aEntryString));
|
||||
except
|
||||
on E: Exception do
|
||||
exception_handler(E, Result);
|
||||
end;
|
||||
end;
|
||||
|
||||
function bsa_entry_list_get(obj: Pointer; const aIndex: Cardinal; const aStringBufferSize: Cardinal; const aStringBuffer: PChar): Cardinal; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_entry_list_get(obj: Pointer; const aIndex: Cardinal; const aStringBufferSize: Cardinal; const aStringBuffer: PChar): Integer; stdcall;
|
||||
begin
|
||||
Result := string_to_cstring(TwbBSEntryList(obj).Strings[aIndex], aStringBufferSize, aStringBuffer);
|
||||
try
|
||||
Result := string_to_cstring_end(TwbBSEntryList(obj).Strings[aIndex], aStringBufferSize, aStringBuffer);
|
||||
except
|
||||
Result := Integer(BSA_RESULT_EXCEPTION);
|
||||
end;
|
||||
end;
|
||||
|
||||
{BSArchive}
|
||||
|
||||
function bsa_create:Pointer; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_create:Pointer; stdcall;
|
||||
begin
|
||||
Result := TwbBSArchive.Create;
|
||||
try
|
||||
Result := TwbBSArchive.Create;
|
||||
except
|
||||
Result := nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure bsa_free(obj: Pointer); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_free(obj: Pointer): TwbBSResultMessage; stdcall;
|
||||
begin
|
||||
TwbBSArchive(obj).free;
|
||||
Result.code := Ord(BSA_RESULT_NONE);
|
||||
try
|
||||
TwbBSArchive(obj).free;
|
||||
except
|
||||
on E: Exception do
|
||||
exception_handler(E, Result);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure bsa_load_from_file(obj: Pointer; const aFileName: PChar); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_load_from_file(obj: Pointer; const aFileName: PChar): TwbBSResultMessage; stdcall;
|
||||
begin
|
||||
TwbBSArchive(obj).LoadFromFile(String(aFileName));
|
||||
Result.code := Ord(BSA_RESULT_NONE);
|
||||
try
|
||||
TwbBSArchive(obj).LoadFromFile(String(aFileName));
|
||||
except
|
||||
on E: Exception do
|
||||
exception_handler(E, Result);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure bsa_create_archive(obj: Pointer; const aFileName: PChar; aType: TBSArchiveType; aFileList: TwbBSEntryList); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_create_archive(obj: Pointer; const aFileName: PChar; aType: TBSArchiveType; aFileList: TwbBSEntryList): TwbBSResultMessage; stdcall;
|
||||
begin
|
||||
TwbBSArchive(obj).CreateArchiveCompat(String(aFileName), aType, aFileList);
|
||||
Result.code := Ord(BSA_RESULT_NONE);
|
||||
try
|
||||
TwbBSArchive(obj).CreateArchiveCompat(String(aFileName), aType, aFileList);
|
||||
except
|
||||
on E: Exception do
|
||||
exception_handler(E, Result);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure bsa_save(obj: Pointer); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_save(obj: Pointer): TwbBSResultMessage; stdcall;
|
||||
begin
|
||||
TwbBSArchive(obj).Save;
|
||||
Result.code := Ord(BSA_RESULT_NONE);
|
||||
try
|
||||
TwbBSArchive(obj).Save;
|
||||
except
|
||||
on E: Exception do
|
||||
exception_handler(E, Result);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure bsa_add_file_from_disk(obj: Pointer; const aRootDir, aFileName: PChar); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_add_file_from_disk(obj: Pointer; const aRootDir, aFileName: PChar): TwbBSResultMessage; stdcall;
|
||||
begin
|
||||
TwbBSArchive(obj).AddFile(String(aRootDir), String(aFileName));
|
||||
Result.code := Ord(BSA_RESULT_NONE);
|
||||
try
|
||||
TwbBSArchive(obj).AddFile(String(aRootDir), String(aFileName));
|
||||
except
|
||||
on E: Exception do
|
||||
exception_handler(E, Result);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure bsa_add_file_from_memory(obj: Pointer; const aFileName: PChar; const aSize: Cardinal; const aData: PByte); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_add_file_from_memory(obj: Pointer; const aFileName: PChar; const aSize: Cardinal; const aData: PByte): TwbBSResultMessage; stdcall;
|
||||
begin
|
||||
TwbBSArchive(obj).AddFileCompat(String(aFileName), aSize, aData);
|
||||
Result.code := Ord(BSA_RESULT_NONE);
|
||||
try
|
||||
TwbBSArchive(obj).AddFileCompat(String(aFileName), aSize, aData);
|
||||
except
|
||||
on E: Exception do
|
||||
exception_handler(E, Result);
|
||||
end;
|
||||
end;
|
||||
|
||||
function bsa_find_file_record(obj: Pointer; const aFileName: PChar): Pointer; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_find_file_record(obj: Pointer; const aFileName: PChar): Pointer; stdcall;
|
||||
begin
|
||||
Result := TwbBSArchive(obj).FindFileRecord(String(aFileName));
|
||||
try
|
||||
Result := TwbBSArchive(obj).FindFileRecord(String(aFileName));
|
||||
except
|
||||
Result := nil
|
||||
end;
|
||||
end;
|
||||
|
||||
function bsa_extract_file_data_by_record(obj: Pointer; aFileRecord: Pointer): TwbBSFileDataResult; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_extract_file_data_by_record(obj: Pointer; aFileRecord: Pointer): TwbBSResultMessageBuffer; stdcall;
|
||||
begin
|
||||
Result := TwbBSArchive(obj).ExtractFileDataCompat(aFileRecord);
|
||||
Result.message.code := Ord(BSA_RESULT_NONE);
|
||||
try
|
||||
Result.buffer := TwbBSArchive(obj).ExtractFileDataCompat(aFileRecord);
|
||||
except
|
||||
on E: Exception do
|
||||
buffer_exception_handler(E, Result);
|
||||
end;
|
||||
end;
|
||||
|
||||
function bsa_extract_file_data_by_filename(obj: Pointer; const aFileName: PChar): TwbBSFileDataResult; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_extract_file_data_by_filename(obj: Pointer; const aFileName: PChar): TwbBSResultMessageBuffer; stdcall;
|
||||
begin
|
||||
Result := TwbBSArchive(obj).ExtractFileDataCompat(String(aFileName));
|
||||
Result.message.code := Ord(BSA_RESULT_NONE);
|
||||
try
|
||||
Result.buffer := TwbBSArchive(obj).ExtractFileDataCompat(String(aFileName));
|
||||
except
|
||||
on E: Exception do
|
||||
buffer_exception_handler(E, Result);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure bsa_file_data_free(obj: Pointer; fileDataResult: TwbBSFileDataResult); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_file_data_free(obj: Pointer; fileDataResult: TwbBSResultMessageBuffer): TwbBSResultMessage; stdcall;
|
||||
begin
|
||||
TwbBSArchive(obj).ReleaseFileDataCompat(fileDataResult);
|
||||
Result.code := Ord(BSA_RESULT_NONE);
|
||||
try
|
||||
TwbBSArchive(obj).ReleaseFileDataCompat(fileDataResult.buffer);
|
||||
except
|
||||
on E: Exception do
|
||||
exception_handler(E, Result);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure bsa_extract_file(obj: Pointer; const aFileName, aSaveAs: PChar); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_extract_file(obj: Pointer; const aFileName, aSaveAs: PChar): TwbBSResultMessage; stdcall;
|
||||
begin
|
||||
TwbBSArchive(obj).ExtractFile(String(aFileName), String(aSaveAs));
|
||||
Result.code := Ord(BSA_RESULT_NONE);
|
||||
try
|
||||
TwbBSArchive(obj).ExtractFile(String(aFileName), String(aSaveAs));
|
||||
except
|
||||
on E: Exception do
|
||||
exception_handler(E, Result);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure bsa_iterate_files(obj: Pointer; aProc: TBSFileIterationProcCompat; aContext: Pointer); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_iterate_files(obj: Pointer; aProc: TBSFileIterationProcCompat; aContext: Pointer): TwbBSResultMessage; stdcall;
|
||||
begin
|
||||
TwbBSArchive(obj).IterateFilesCompat(aProc, aContext);
|
||||
Result.code := Ord(BSA_RESULT_NONE);
|
||||
try
|
||||
TwbBSArchive(obj).IterateFilesCompat(aProc, aContext);
|
||||
except
|
||||
on E: Exception do
|
||||
exception_handler(E, Result);
|
||||
end;
|
||||
end;
|
||||
|
||||
function bsa_file_exists(obj: Pointer; const aFileName: string): Boolean; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_file_exists(obj: Pointer; const aFileName: string): Boolean; stdcall;
|
||||
begin
|
||||
Result := TwbBSArchive(obj).FileExists(aFileName);
|
||||
try
|
||||
Result := TwbBSArchive(obj).FileExists(aFileName);
|
||||
except
|
||||
Result := False;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure bsa_get_resource_list(obj: Pointer; const aEntryResultList: TwbBSEntryList; aFolder: PChar); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_get_resource_list(obj: Pointer; const aEntryResultList: TwbBSEntryList; aFolder: PChar): TwbBSResultMessage; stdcall;
|
||||
begin
|
||||
TwbBSArchive(obj).ResourceListCompat(aEntryResultList, String(aFolder));
|
||||
Result.code := Ord(BSA_RESULT_NONE);
|
||||
try
|
||||
TwbBSArchive(obj).ResourceListCompat(aEntryResultList, String(aFolder));
|
||||
except
|
||||
on E: Exception do
|
||||
exception_handler(E, Result);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure bsa_resolve_hash(obj: Pointer; const aHash: UInt64; const aEntryResultList: TwbBSEntryList); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_resolve_hash(obj: Pointer; const aHash: UInt64; const aEntryResultList: TwbBSEntryList): TwbBSResultMessage; stdcall;
|
||||
begin
|
||||
TwbBSArchive(obj).ResolveHashCompat(aHash, aEntryResultList);
|
||||
Result.code := Ord(BSA_RESULT_NONE);
|
||||
try
|
||||
TwbBSArchive(obj).ResolveHashCompat(aHash, aEntryResultList);
|
||||
except
|
||||
on E: Exception do
|
||||
exception_handler(E, Result);
|
||||
end;
|
||||
end;
|
||||
|
||||
function bsa_close(obj: Pointer): TwbBSResultMessage; stdcall;
|
||||
begin
|
||||
Result.code := Ord(BSA_RESULT_NONE);
|
||||
try
|
||||
TwbBSArchive(obj).Close;
|
||||
except
|
||||
on E: Exception do
|
||||
exception_handler(E, Result);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure bsa_close(obj: Pointer); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_filename_get(obj: Pointer; const aStringBufferSize: Cardinal; const aStringBuffer: PChar): Cardinal; stdcall;
|
||||
begin
|
||||
TwbBSArchive(obj).Close;
|
||||
Result := string_to_cstring_end(TwbBSArchive(obj).FileName, aStringBufferSize, aStringBuffer);
|
||||
end;
|
||||
|
||||
function bsa_filename_get(obj: Pointer; const aStringBufferSize: Cardinal; const aStringBuffer: PChar): Cardinal; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
begin
|
||||
Result := string_to_cstring(TwbBSArchive(obj).FileName, aStringBufferSize, aStringBuffer);
|
||||
end;
|
||||
|
||||
function bsa_archive_type_get(obj: Pointer): TBSArchiveType; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_archive_type_get(obj: Pointer): TBSArchiveType; stdcall;
|
||||
begin
|
||||
Result := TwbBSArchive(obj).ArchiveType;
|
||||
end;
|
||||
|
||||
function bsa_version_get(obj: Pointer): Cardinal; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_version_get(obj: Pointer): Cardinal; stdcall;
|
||||
begin
|
||||
Result := TwbBSArchive(obj).Version;
|
||||
end;
|
||||
|
||||
function bsa_format_name_get(obj: Pointer; const aStringBufferSize: Cardinal; const aStringBuffer: PChar): Cardinal; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_format_name_get(obj: Pointer; const aStringBufferSize: Cardinal; const aStringBuffer: PChar): Cardinal; stdcall;
|
||||
begin
|
||||
Result := string_to_cstring(TwbBSArchive(obj).FormatName, aStringBufferSize, aStringBuffer);
|
||||
Result := string_to_cstring_end(TwbBSArchive(obj).FormatName, aStringBufferSize, aStringBuffer);
|
||||
end;
|
||||
|
||||
function bsa_file_count_get(obj: Pointer): Cardinal; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_file_count_get(obj: Pointer): Cardinal; stdcall;
|
||||
begin
|
||||
Result := TwbBSArchive(obj).FileCount;
|
||||
end;
|
||||
|
||||
function bsa_archive_flags_get(obj: Pointer): Cardinal; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_archive_flags_get(obj: Pointer): Cardinal; stdcall;
|
||||
begin
|
||||
Result := TwbBSArchive(obj).ArchiveFlags;
|
||||
end;
|
||||
|
||||
procedure bsa_archive_flags_set(obj: Pointer; flags: Cardinal); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
procedure bsa_archive_flags_set(obj: Pointer; flags: Cardinal); stdcall;
|
||||
begin
|
||||
TwbBSArchive(obj).ArchiveFlags := flags;
|
||||
end;
|
||||
|
||||
function bsa_file_flags_get(obj: Pointer): Cardinal; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_file_flags_get(obj: Pointer): Cardinal; stdcall;
|
||||
begin
|
||||
Result := TwbBSArchive(obj).FileFlags;
|
||||
end;
|
||||
|
||||
procedure bsa_file_flags_set(obj: Pointer; flags: Cardinal); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
procedure bsa_file_flags_set(obj: Pointer; flags: Cardinal); stdcall;
|
||||
begin
|
||||
TwbBSArchive(obj).FileFlags := flags;
|
||||
end;
|
||||
|
||||
function bsa_compress_get(obj: Pointer): Boolean; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_compress_get(obj: Pointer): Boolean; stdcall;
|
||||
begin
|
||||
Result := TwbBSArchive(obj).Compress;
|
||||
end;
|
||||
|
||||
procedure bsa_compress_set(obj: Pointer; compress: Boolean); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
procedure bsa_compress_set(obj: Pointer; compress: Boolean); stdcall;
|
||||
begin
|
||||
TwbBSArchive(obj).Compress := compress;
|
||||
end;
|
||||
|
||||
function bsa_share_data_get(obj: Pointer): Boolean; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function bsa_share_data_get(obj: Pointer): Boolean; stdcall;
|
||||
begin
|
||||
Result := TwbBSArchive(obj).ShareData;
|
||||
end;
|
||||
|
||||
procedure bsa_share_data_set(obj: Pointer; shareData: Boolean); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
procedure bsa_share_data_set(obj: Pointer; shareData: Boolean); stdcall;
|
||||
begin
|
||||
TwbBSArchive(obj).ShareData := shareData;
|
||||
end;
|
||||
|
||||
procedure bsa_file_dds_info_callback_set(obj: Pointer; aProc: TBSFileDDSInfoProcCompat); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
procedure bsa_file_dds_info_callback_set(obj: Pointer; aProc: TBSFileDDSInfoProcCompat); stdcall;
|
||||
begin
|
||||
TwbBSArchive(obj).DDSInfoProc := aProc;
|
||||
end;
|
||||
|
||||
+43
-3
@@ -3,7 +3,7 @@
|
||||
<ProjectGuid>{381E4D59-4D34-46B3-B039-1B3C3ABEC58F}</ProjectGuid>
|
||||
<MainSource>libbsarch.dpr</MainSource>
|
||||
<Base>True</Base>
|
||||
<Config Condition="'$(Config)'==''">Debug</Config>
|
||||
<Config Condition="'$(Config)'==''">Release</Config>
|
||||
<TargetedPlatforms>3</TargetedPlatforms>
|
||||
<AppType>Library</AppType>
|
||||
<FrameworkType>None</FrameworkType>
|
||||
@@ -28,11 +28,29 @@
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
|
||||
<Cfg_1_Win32>true</Cfg_1_Win32>
|
||||
<CfgParent>Cfg_1</CfgParent>
|
||||
<Cfg_1>true</Cfg_1>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win64)'!=''">
|
||||
<Cfg_1_Win64>true</Cfg_1_Win64>
|
||||
<CfgParent>Cfg_1</CfgParent>
|
||||
<Cfg_1>true</Cfg_1>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
|
||||
<Cfg_2>true</Cfg_2>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
|
||||
<Cfg_2_Win32>true</Cfg_2_Win32>
|
||||
<CfgParent>Cfg_2</CfgParent>
|
||||
<Cfg_2>true</Cfg_2>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win64)'!=''">
|
||||
<Cfg_2_Win64>true</Cfg_2_Win64>
|
||||
<CfgParent>Cfg_2</CfgParent>
|
||||
@@ -72,22 +90,44 @@
|
||||
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
|
||||
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
|
||||
<DCC_ExeOutput>Win32\Release\</DCC_ExeOutput>
|
||||
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
||||
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
|
||||
<Manifest_File>(None)</Manifest_File>
|
||||
<Debugger_HostApplication>Win32\Release\libbsarch-visualstudio-test.exe</Debugger_HostApplication>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
|
||||
<DCC_ExeOutput>X64\Release\</DCC_ExeOutput>
|
||||
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
||||
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
|
||||
<Manifest_File>(None)</Manifest_File>
|
||||
<Debugger_HostApplication>X64\Release\libbsarch-visualstudio-test.exe</Debugger_HostApplication>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_2)'!=''">
|
||||
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
|
||||
<DCC_Optimize>false</DCC_Optimize>
|
||||
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
|
||||
<Debugger_HostApplication>Win32\Debug\libbsarch-visualstudio-test.exe</Debugger_HostApplication>
|
||||
<DCC_ExeOutput>Win32\Debug\</DCC_ExeOutput>
|
||||
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
||||
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
|
||||
<Manifest_File>(None)</Manifest_File>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_2_Win64)'!=''">
|
||||
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
||||
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
|
||||
<Manifest_File>(None)</Manifest_File>
|
||||
<DCC_ExeOutput>X64\Debug\</DCC_ExeOutput>
|
||||
<Debugger_HostApplication>D:\Projects\libbsarch\x64\Debug\libbsarch-visualstudio-test.exe</Debugger_HostApplication>
|
||||
<Debugger_CWD>D:\Projects\libbsarch\x64\Debug</Debugger_CWD>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<DelphiCompile Include="$(MainSource)">
|
||||
<MainSource>MainSource</MainSource>
|
||||
</DelphiCompile>
|
||||
<DCCReference Include="wbStreams.pas"/>
|
||||
<DCCReference Include="wbBSArchive.pas"/>
|
||||
<BuildConfiguration Include="Debug">
|
||||
<Key>Cfg_2</Key>
|
||||
<CfgParent>Base</CfgParent>
|
||||
|
||||
+69
-40
@@ -12,8 +12,19 @@
|
||||
#define BSARCH_DLL_API(ReturnType) extern "C" __declspec(dllimport) ReturnType __stdcall
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define PACKED(datastructure) datastructure __attribute__((__packed__))
|
||||
#else
|
||||
#define PACKED(datastructure) __pragma(pack(push, 1)) datastructure __pragma(pack(pop))
|
||||
#endif
|
||||
|
||||
typedef enum bsa_result_code_e {
|
||||
BSA_RESULT_NONE = 0,
|
||||
BSA_RESULT_EXCEPTION = -1
|
||||
} bsa_result_code_t;
|
||||
|
||||
typedef void* bsa_buffer_t;
|
||||
typedef void* bsa_archive_t;
|
||||
typedef void* bsa_file_data_t;
|
||||
typedef void* bsa_entry_list_t;
|
||||
typedef void* bsa_file_record_t;
|
||||
typedef void* bsa_folder_record_t;
|
||||
@@ -22,15 +33,33 @@ typedef struct bsa_dds_info_s {
|
||||
uint32_t width, height, mipmaps;
|
||||
} bsa_dds_info_t;
|
||||
|
||||
PACKED (
|
||||
typedef struct bsa_dds_header_s {
|
||||
uint32_t magic; // DDS_MAGIC
|
||||
struct DirectX::DDS_HEADER header;
|
||||
} bsa_dds_header_t;
|
||||
)
|
||||
|
||||
typedef struct bsa_file_data_result_s {
|
||||
PACKED (
|
||||
typedef struct bsa_result_message_s {
|
||||
int8_t code; // bsa_result_code_t
|
||||
wchar_t text[1024];
|
||||
} bsa_result_message_t;
|
||||
)
|
||||
|
||||
PACKED (
|
||||
typedef struct bsa_result_buffer_s {
|
||||
uint32_t size;
|
||||
bsa_file_data_t data;
|
||||
} bsa_file_data_result_t;
|
||||
bsa_buffer_t data;
|
||||
} bsa_result_buffer_t;
|
||||
)
|
||||
|
||||
PACKED (
|
||||
typedef struct bsa_result_message_buffer_s {
|
||||
bsa_result_buffer_t buffer;
|
||||
bsa_result_message_t message;
|
||||
} bsa_result_message_buffer_t;
|
||||
)
|
||||
|
||||
typedef enum bsa_archive_state_e {
|
||||
stReading, stWriting
|
||||
@@ -40,45 +69,45 @@ typedef enum bsa_archive_type_e {
|
||||
baNone, baTES3, baTES4, baFO3, baSSE, baFO4, baFO4dds
|
||||
} bsa_archive_type_t;
|
||||
|
||||
typedef void (*bsa_file_dds_info_proc_t)(bsa_archive_t bsa_archive, char **filename, bsa_dds_info_t dds_info);
|
||||
typedef bool (*bsa_file_iteration_proc_t)(bsa_archive_t bsa_archive, char **filename, bsa_file_record_t file_record, bsa_folder_record_t folder_record, void *context);
|
||||
typedef void (*bsa_file_dds_info_proc_t)(bsa_archive_t archive, const wchar_t *filename, bsa_dds_info_t dds_info);
|
||||
typedef bool (*bsa_file_iteration_proc_t)(bsa_archive_t archive, const wchar_t *filename, bsa_file_record_t file_record, bsa_folder_record_t folder_record, void *context);
|
||||
|
||||
BSARCH_DLL_API(bsa_entry_list_t) bsa_entry_list_create();
|
||||
BSARCH_DLL_API(void) bsa_entry_list_free(bsa_entry_list_t *entry_list);
|
||||
BSARCH_DLL_API(uint32_t) bsa_entry_list_count(bsa_entry_list_t *entry_list);
|
||||
BSARCH_DLL_API(void) bsa_entry_list_add(bsa_entry_list_t *entry_list, char *entry_string);
|
||||
BSARCH_DLL_API(uint32_t) bsa_entry_list_get(bsa_entry_list_t *entry_list, uint32_t index, uint32_t string_buffer_size, char *string_buffer);
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_entry_list_free(bsa_entry_list_t entry_list);
|
||||
BSARCH_DLL_API(uint32_t) bsa_entry_list_count(bsa_entry_list_t entry_list);
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_entry_list_add(bsa_entry_list_t entry_list, const wchar_t *entry_string);
|
||||
BSARCH_DLL_API(uint32_t) bsa_entry_list_get(bsa_entry_list_t entry_list, uint32_t index, uint32_t string_buffer_size, const wchar_t *string_buffer);
|
||||
|
||||
BSARCH_DLL_API(bsa_archive_t) bsa_create();
|
||||
BSARCH_DLL_API(void) bsa_free(bsa_archive_t archive);
|
||||
BSARCH_DLL_API(void) bsa_load_from_file(bsa_archive_t archive, char *filename);
|
||||
BSARCH_DLL_API(void) bsa_create_archive(bsa_archive_t archive, char *filename, bsa_archive_type_t archive_type, bsa_entry_list_t entry_list);
|
||||
BSARCH_DLL_API(void) bsa_save(bsa_archive_t archive);
|
||||
BSARCH_DLL_API(void) bsa_add_file_from_disk(bsa_archive_t archive, char *root_dir, char *filename);
|
||||
BSARCH_DLL_API(void) bsa_add_file_from_memory(bsa_archive_t archive, char *filename, uint32_t size, bsa_file_data_t data);
|
||||
BSARCH_DLL_API(bsa_file_record_t) bsa_find_file_record(bsa_archive_t archive, char *filename);
|
||||
BSARCH_DLL_API(bsa_file_data_result_t) bsa_extract_file_data_by_record(bsa_archive_t archive, bsa_file_record_t file_record);
|
||||
BSARCH_DLL_API(bsa_file_data_result_t) bsa_extract_file_data_by_filename(bsa_archive_t archive, char *filename);
|
||||
BSARCH_DLL_API(void) bsa_file_data_free(bsa_archive_t archive, bsa_file_data_result_t file_data_result);
|
||||
BSARCH_DLL_API(void) bsa_extract_file(bsa_archive_t archive, char *filename, char *save_as);
|
||||
BSARCH_DLL_API(void) bsa_iterate_files(bsa_archive_t archive, bsa_file_iteration_proc_t file_iteration_proc, void *context);
|
||||
BSARCH_DLL_API(bool) bsa_file_exists(bsa_archive_t archive, char *filename);
|
||||
BSARCH_DLL_API(void) bsa_get_resource_list(bsa_archive_t archive, bsa_entry_list_t entry_result_list, char *folder);
|
||||
BSARCH_DLL_API(void) bsa_resolve_hash(bsa_archive_t archive, uint64_t hash, bsa_entry_list_t entry_result_list);
|
||||
BSARCH_DLL_API(void) bsa_close(bsa_archive_t archive);
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_free(bsa_archive_t archive);
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_load_from_file(bsa_archive_t archive, const wchar_t *filename);
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_create_archive(bsa_archive_t archive, const wchar_t *filename, bsa_archive_type_t archive_type, bsa_entry_list_t entry_list);
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_save(bsa_archive_t archive);
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_add_file_from_disk(bsa_archive_t archive, const wchar_t *root_dir, const wchar_t *filename);
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_add_file_from_memory(bsa_archive_t archive, const wchar_t *filename, uint32_t size, bsa_buffer_t data);
|
||||
BSARCH_DLL_API(bsa_file_record_t) bsa_find_file_record(bsa_archive_t archive, const wchar_t *filename);
|
||||
BSARCH_DLL_API(bsa_result_message_buffer_t) bsa_extract_file_data_by_record(bsa_archive_t archive, bsa_file_record_t file_record);
|
||||
BSARCH_DLL_API(bsa_result_message_buffer_t) bsa_extract_file_data_by_filename(bsa_archive_t archive, const wchar_t *filename);
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_file_data_free(bsa_archive_t archive, bsa_result_buffer_t file_data_result);
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_extract_file(bsa_archive_t archive, const wchar_t *filename, const wchar_t *save_as);
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_iterate_files(bsa_archive_t archive, bsa_file_iteration_proc_t file_iteration_proc, void *context);
|
||||
BSARCH_DLL_API(bool) bsa_file_exists(bsa_archive_t archive, const wchar_t *filename);
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_get_resource_list(bsa_archive_t archive, bsa_entry_list_t entry_result_list, const wchar_t *folder);
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_resolve_hash(bsa_archive_t archive, uint64_t hash, bsa_entry_list_t entry_result_list);
|
||||
BSARCH_DLL_API(bsa_result_message_t) bsa_close(bsa_archive_t archive);
|
||||
|
||||
BSARCH_DLL_API(uint32_t) bsa_filename_get(bsa_archive_t *archive, uint32_t string_buffer_size, char *string_buffer);
|
||||
BSARCH_DLL_API(bsa_archive_type_t) bsa_archive_type_get(bsa_archive_t *archive);
|
||||
BSARCH_DLL_API(uint32_t) bsa_version_get(bsa_archive_t *archive);
|
||||
BSARCH_DLL_API(uint32_t) bsa_format_name_get(bsa_archive_t *archive, uint32_t string_buffer_size, char *string_buffer);
|
||||
BSARCH_DLL_API(uint32_t) bsa_file_count_get(bsa_archive_t *archive);
|
||||
BSARCH_DLL_API(uint32_t) bsa_archive_flags_get(bsa_archive_t *archive);
|
||||
BSARCH_DLL_API(void) bsa_archive_flags_set(bsa_archive_t *archive, uint32_t flags);
|
||||
BSARCH_DLL_API(uint32_t) bsa_file_flags_get(bsa_archive_t *archive);
|
||||
BSARCH_DLL_API(void) bsa_file_flags_set(bsa_archive_t *archive, uint32_t flags);
|
||||
BSARCH_DLL_API(bool) bsa_compress_get(bsa_archive_t *archive);
|
||||
BSARCH_DLL_API(void) bsa_compress_set(bsa_archive_t *archive, bool flags);
|
||||
BSARCH_DLL_API(bool) bsa_share_data_get(bsa_archive_t *archive);
|
||||
BSARCH_DLL_API(void) bsa_share_data_set(bsa_archive_t *archive, bool flags);
|
||||
BSARCH_DLL_API(uint32_t) bsa_filename_get(bsa_archive_t archive, uint32_t string_buffer_size, const wchar_t *string_buffer);
|
||||
BSARCH_DLL_API(bsa_archive_type_t) bsa_archive_type_get(bsa_archive_t archive);
|
||||
BSARCH_DLL_API(uint32_t) bsa_version_get(bsa_archive_t archive);
|
||||
BSARCH_DLL_API(uint32_t) bsa_format_name_get(bsa_archive_t archive, uint32_t string_buffer_size, const wchar_t *string_buffer);
|
||||
BSARCH_DLL_API(uint32_t) bsa_file_count_get(bsa_archive_t archive);
|
||||
BSARCH_DLL_API(uint32_t) bsa_archive_flags_get(bsa_archive_t archive);
|
||||
BSARCH_DLL_API(void) bsa_archive_flags_set(bsa_archive_t archive, uint32_t flags);
|
||||
BSARCH_DLL_API(uint32_t) bsa_file_flags_get(bsa_archive_t archive);
|
||||
BSARCH_DLL_API(void) bsa_file_flags_set(bsa_archive_t archive, uint32_t flags);
|
||||
BSARCH_DLL_API(bool) bsa_compress_get(bsa_archive_t archive);
|
||||
BSARCH_DLL_API(void) bsa_compress_set(bsa_archive_t archive, bool flags);
|
||||
BSARCH_DLL_API(bool) bsa_share_data_get(bsa_archive_t archive);
|
||||
BSARCH_DLL_API(void) bsa_share_data_set(bsa_archive_t archive, bool flags);
|
||||
|
||||
BSARCH_DLL_API(void) bsa_file_dds_info_callback_set(bsa_archive_t *archive, bsa_file_dds_info_proc_t file_dds_info_proc);
|
||||
BSARCH_DLL_API(void) bsa_file_dds_info_callback_set(bsa_archive_t archive, bsa_file_dds_info_proc_t file_dds_info_proc);
|
||||
|
||||
+43
-6
@@ -22,28 +22,28 @@
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{537F42AD-5B15-4671-B99E-2D1818999A98}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
@@ -67,11 +67,15 @@
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IncludePath>$(DirectXTexPath)\DirectXTex;$(IncludePath)</IncludePath>
|
||||
<TargetName>$(ProjectName)</TargetName>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IncludePath>$(DirectXTexPath)\DirectXTex;$(IncludePath)</IncludePath>
|
||||
<TargetName>$(ProjectName)</TargetName>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<IncludePath>$(DirectXTexPath)\DirectXTex;$(IncludePath)</IncludePath>
|
||||
@@ -91,9 +95,15 @@
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ModuleDefinitionFile>libbsarch.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>xcopy /y "$(ProjectDir)libbsarch.h" "$(OutDir)"</Command>
|
||||
<Message>Copying header file</Message>
|
||||
<Outputs>$(OutDir)libbsarch.h</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
@@ -108,7 +118,34 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>libbsarch.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>xcopy /y "$(ProjectDir)libbsarch.h" "$(OutDir)"</Command>
|
||||
<Message>Copying header file</Message>
|
||||
<Outputs>$(OutDir)libbsarch.h</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Link>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<ModuleDefinitionFile>libbsarch.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>xcopy /y "$(ProjectDir)libbsarch.h" "$(OutDir)"</Command>
|
||||
<Message>Copying header file</Message>
|
||||
<Outputs>$(OutDir)libbsarch.h</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Link>
|
||||
<ModuleDefinitionFile>libbsarch.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>xcopy /y "$(ProjectDir)libbsarch.h" "$(OutDir)"</Command>
|
||||
<Message>Copying header file</Message>
|
||||
<Outputs>$(OutDir)libbsarch.h</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include=".vscode\ipch\c1c5ff332820ca89\mmap_address.bin" />
|
||||
|
||||
+54
-48
@@ -194,11 +194,11 @@ type
|
||||
TBSArchiveState = (stReading, stWriting);
|
||||
TBSArchiveStates = set of TBSArchiveState;
|
||||
TBSFileIterationProcCompat = function(aArchive: Pointer; const aFileName: PChar;
|
||||
aFileRecord: Pointer; aFolderRecord: Pointer; aContext: Pointer): Boolean; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
aFileRecord: Pointer; aFolderRecord: Pointer; aContext: Pointer): Boolean; stdcall;
|
||||
|
||||
TDDSInfo = record Width, Height, MipMaps: Integer; end;
|
||||
TBSFileDDSInfoProcCompat = procedure(aArchive: Pointer; const aFileName: PChar;
|
||||
var aInfo: TDDSInfo); {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
var aInfo: TDDSInfo); stdcall;
|
||||
|
||||
TwbBSHeaderTES3 = packed record
|
||||
HashOffset: Cardinal;
|
||||
@@ -291,9 +291,9 @@ type
|
||||
end;
|
||||
PPackedDataInfo = ^TPackedDataInfo;
|
||||
|
||||
TwbBSFileDataResult = record
|
||||
Size: Cardinal;
|
||||
Data: PByte;
|
||||
TwbBSResultBuffer = packed record
|
||||
size: Cardinal;
|
||||
data: PByte;
|
||||
end;
|
||||
|
||||
TwbBSEntryList = class(TStringList);
|
||||
@@ -349,9 +349,9 @@ type
|
||||
procedure AddFile(const aRootDir, aFileName: string); overload;
|
||||
procedure AddFileCompat(const aFileName: string; const aSize: Cardinal; const aData: PByte);
|
||||
function FindFileRecord(const aFileName: string): Pointer;
|
||||
function ExtractFileDataCompat(aFileRecord: Pointer): TwbBSFileDataResult; overload;
|
||||
function ExtractFileDataCompat(const aFileName: string): TwbBSFileDataResult; overload;
|
||||
procedure ReleaseFileDataCompat(fileDataResult: TwbBSFileDataResult);
|
||||
function ExtractFileDataCompat(aFileRecord: Pointer): TwbBSResultBuffer; overload;
|
||||
function ExtractFileDataCompat(const aFileName: string): TwbBSResultBuffer; overload;
|
||||
procedure ReleaseFileDataCompat(fileDataResult: TwbBSResultBuffer);
|
||||
procedure ExtractFile(const aFileName, aSaveAs: string);
|
||||
procedure IterateFilesCompat(aProc: TBSFileIterationProcCompat; aContext: Pointer = nil);
|
||||
function FileExists(const aFileName: string): Boolean;
|
||||
@@ -1536,7 +1536,8 @@ procedure TwbBSArchive.AddFile(const aRootDir, aFileName: string);
|
||||
var
|
||||
fname: string;
|
||||
i: integer;
|
||||
Buffer: PByte;
|
||||
buffer: PByte;
|
||||
stream: TFileStream;
|
||||
begin
|
||||
if not (stWriting in fStates) then
|
||||
raise Exception.Create('Archive is not in writing mode');
|
||||
@@ -1547,13 +1548,18 @@ begin
|
||||
|
||||
fname := Copy(aFileName, i + 1, Length(aFileName));
|
||||
|
||||
with TFileStream.Create(aFileName, fmOpenRead + fmShareDenyNone) do try
|
||||
GetMem(Buffer, Size);
|
||||
Read(Buffer[0], Size);
|
||||
AddFileCompat(fname, Size, Buffer);
|
||||
stream := TFileStream.Create(aFileName, fmOpenRead + fmShareDenyNone);
|
||||
try
|
||||
GetMem(buffer, stream.Size);
|
||||
try
|
||||
stream.Read(buffer^, stream.Size);
|
||||
AddFileCompat(fname, stream.Size, buffer);
|
||||
finally
|
||||
if Assigned(buffer) then
|
||||
FreeMem(buffer);
|
||||
end;
|
||||
finally
|
||||
FreeAndNil(Buffer);
|
||||
Free;
|
||||
stream.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -1862,7 +1868,7 @@ begin
|
||||
end;
|
||||
|
||||
// Modified: Version for use in non-Borland C/C++ (Result not automatically freed)
|
||||
function TwbBSArchive.ExtractFileDataCompat(aFileRecord: Pointer): TwbBSFileDataResult;
|
||||
function TwbBSArchive.ExtractFileDataCompat(aFileRecord: Pointer): TwbBSResultBuffer;
|
||||
var
|
||||
FileTES3: PwbBSFileTES3;
|
||||
FileTES4: PwbBSFileTES4;
|
||||
@@ -1886,9 +1892,9 @@ begin
|
||||
baTES3: begin
|
||||
FileTES3 := aFileRecord;
|
||||
fStream.Position := fDataOffset + FileTES3.Offset;
|
||||
Result.Size := FileTES3.Size;
|
||||
GetMem(Result.Data, FileTES3.Size);
|
||||
fStream.ReadBuffer(Result.Data[0], Result.Size);
|
||||
Result.size := FileTES3.Size;
|
||||
GetMem(Result.data, FileTES3.Size);
|
||||
fStream.ReadBuffer(Result.data[0], Result.size);
|
||||
end;
|
||||
|
||||
baTES4, baFO3, baSSE: begin
|
||||
@@ -1908,19 +1914,19 @@ begin
|
||||
|
||||
if bCompressed then begin
|
||||
// reading uncompressed size
|
||||
Result.Size := fStream.ReadCardinal;
|
||||
GetMem(Result.Data, Result.Size);
|
||||
Result.size := fStream.ReadCardinal;
|
||||
GetMem(Result.data, Result.size);
|
||||
dec(size, SizeOf(Cardinal));
|
||||
if (Result.Size > 0) and (size > 0) then begin
|
||||
if (Result.size > 0) and (size > 0) then begin
|
||||
SetLength(Buffer, size);
|
||||
fStream.ReadBuffer(Buffer[0], Length(Buffer));
|
||||
if Assigned(Sync) then
|
||||
Sync.EndWrite;
|
||||
try
|
||||
if fType = baSSE then
|
||||
lz4DecompressToUserBuf(@Buffer[0], Length(Buffer), @Result.Data[0], Result.Size)
|
||||
lz4DecompressToUserBuf(@Buffer[0], Length(Buffer), @Result.data[0], Result.size)
|
||||
else try
|
||||
DecompressToUserBuf(@Buffer[0], Length(Buffer), @Result.Data[0], Result.Size);
|
||||
DecompressToUserBuf(@Buffer[0], Length(Buffer), @Result.data[0], Result.size);
|
||||
except
|
||||
// ignore zlib's Buffer error since it happens in vanilla "Fallout - Misc.bsa"
|
||||
// Bethesda probably used old buggy zlib version when packing it
|
||||
@@ -1933,10 +1939,10 @@ begin
|
||||
end;
|
||||
end
|
||||
else begin
|
||||
Result.Size := size;
|
||||
GetMem(Result.Data, Result.Size);
|
||||
Result.size := size;
|
||||
GetMem(Result.data, Result.size);
|
||||
if size > 0 then
|
||||
fStream.ReadBuffer(Result.Data[0], Result.Size);
|
||||
fStream.ReadBuffer(Result.data[0], Result.size);
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -1946,21 +1952,21 @@ begin
|
||||
if FileFO4.PackedSize <> 0 then begin
|
||||
SetLength(Buffer, FileFO4.PackedSize);
|
||||
fStream.ReadBuffer(Buffer[0], Length(Buffer));
|
||||
Result.Size := FileFO4.Size;
|
||||
GetMem(Result.Data, Result.Size);
|
||||
Result.size := FileFO4.Size;
|
||||
GetMem(Result.data, Result.size);
|
||||
if Assigned(Sync) then
|
||||
Sync.EndWrite;
|
||||
try
|
||||
DecompressToUserBuf(@Buffer[0], Length(Buffer), @Result.Data[0], Result.Size);
|
||||
DecompressToUserBuf(@Buffer[0], Length(Buffer), @Result.data[0], Result.size);
|
||||
finally
|
||||
if Assigned(Sync) then
|
||||
Sync.BeginWrite;
|
||||
end;
|
||||
end
|
||||
else begin
|
||||
Result.Size := FileFO4.Size;
|
||||
GetMem(Result.Data, Result.Size);
|
||||
fStream.ReadBuffer(Result.Data[0], Result.Size);
|
||||
Result.size := FileFO4.Size;
|
||||
GetMem(Result.data, Result.size);
|
||||
fStream.ReadBuffer(Result.data[0], Result.size);
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -1971,10 +1977,10 @@ begin
|
||||
for i := Low(FileFO4.TexChunks) to High(FileFO4.TexChunks) do
|
||||
Inc(TexSize, FileFO4.TexChunks[i].Size);
|
||||
|
||||
Result.Size := Texsize;
|
||||
GetMem(Result.Data, Result.Size);
|
||||
Result.size := Texsize;
|
||||
GetMem(Result.data, Result.size);
|
||||
|
||||
DDSHeader := @Result.Data[0];
|
||||
DDSHeader := @Result.data[0];
|
||||
DDSHeader.Magic := MAGIC_DDS;
|
||||
DDSHeader.dwSize := SizeOf(TDDSHeader) - SizeOf(TMagic4);
|
||||
DDSHeader.dwWidth := FileFO4.Width;
|
||||
@@ -1987,7 +1993,7 @@ begin
|
||||
DDSHeader.dwCaps := DDSHeader.dwCaps or DDSCAPS_MIPMAP or DDSCAPS_COMPLEX;
|
||||
DDSHeader.dwDepth := 1;
|
||||
|
||||
DDSHeaderDX10 := @Result.Data[SizeOf(TDDSHeader)];
|
||||
DDSHeaderDX10 := @Result.data[SizeOf(TDDSHeader)];
|
||||
DDSHeaderDX10.resourceDimension := DDS_DIMENSION_TEXTURE2D;
|
||||
DDSHeaderDX10.arraySize := 1;
|
||||
|
||||
@@ -2153,9 +2159,9 @@ begin
|
||||
end;
|
||||
TexSize := SizeOf(TDDSHeader);
|
||||
if DDSHeader.ddspf.dwFourCC = MAGIC_DX10 then begin
|
||||
ReallocMem(Result.Data, Result.Size + SizeOf(TDDSHeaderDX10));
|
||||
ReallocMem(Result.data, Result.size + SizeOf(TDDSHeaderDX10));
|
||||
Inc(TexSize, SizeOf(TDDSHeaderDX10));
|
||||
Result.Size := TexSize;
|
||||
Result.size := TexSize;
|
||||
end;
|
||||
// append chunks
|
||||
for i := Low(FileFO4.TexChunks) to High(FileFO4.TexChunks) do with FileFO4.TexChunks[i] do begin
|
||||
@@ -2167,7 +2173,7 @@ begin
|
||||
if Assigned(Sync) then
|
||||
Sync.EndWrite;
|
||||
try
|
||||
DecompressToUserBuf(@Buffer[0], Length(Buffer), @Result.Data[TexSize], Size);
|
||||
DecompressToUserBuf(@Buffer[0], Length(Buffer), @Result.data[TexSize], Size);
|
||||
finally
|
||||
if Assigned(Sync) then
|
||||
Sync.BeginWrite;
|
||||
@@ -2175,9 +2181,9 @@ begin
|
||||
end
|
||||
// uncompressed chunk
|
||||
else
|
||||
fStream.ReadBuffer(Result.Data[TexSize], Size);
|
||||
fStream.ReadBuffer(Result.data[TexSize], Size);
|
||||
Inc(TexSize, Size);
|
||||
Result.Size := TexSize;
|
||||
Result.size := TexSize;
|
||||
end;
|
||||
end
|
||||
|
||||
@@ -2191,7 +2197,7 @@ begin
|
||||
end;
|
||||
|
||||
// Modified: Version for use in non-Borland C/C++
|
||||
function TwbBSArchive.ExtractFileDataCompat(const aFileName: string): TwbBSFileDataResult;
|
||||
function TwbBSArchive.ExtractFileDataCompat(const aFileName: string): TwbBSResultBuffer;
|
||||
var
|
||||
FileRecord: Pointer;
|
||||
begin
|
||||
@@ -2207,16 +2213,16 @@ begin
|
||||
end;
|
||||
|
||||
// Addded: For use in non-Borland C/C++
|
||||
procedure TwbBSArchive.ReleaseFileDataCompat(fileDataResult: TwbBSFileDataResult);
|
||||
procedure TwbBSArchive.ReleaseFileDataCompat(fileDataResult: TwbBSResultBuffer);
|
||||
begin
|
||||
FreeAndNil(fileDataResult.Data);
|
||||
fileDataResult.Size := 0;
|
||||
FreeAndNil(fileDataResult.data);
|
||||
fileDataResult.size := 0;
|
||||
end;
|
||||
|
||||
procedure TwbBSArchive.ExtractFile(const aFileName, aSaveAs: string);
|
||||
var
|
||||
fs: TFileStream;
|
||||
fileData: TwbBSFileDataResult;
|
||||
fileData: TwbBSResultBuffer;
|
||||
begin
|
||||
if not (stReading in fStates) then
|
||||
raise Exception.Create('Archive is not loaded');
|
||||
@@ -2224,7 +2230,7 @@ begin
|
||||
fs := TFileStream.Create(aSaveAs, fmCreate);
|
||||
try
|
||||
fileData := ExtractFileDataCompat(aFileName);
|
||||
fs.Write(fileData.Data[0], fileData.Size);
|
||||
fs.Write(fileData.data[0], fileData.size);
|
||||
finally
|
||||
ReleaseFileDataCompat(fileData);
|
||||
fs.Free;
|
||||
|
||||
Reference in New Issue
Block a user