1 #include "CompressDll.h"
2 #include "EfiCompress.h"
10 IN OUT UINT32
*DstSize
13 JNIEXPORT jbyteArray JNICALL Java_org_tianocore_framework_tasks_Compress_CallCompress
14 (JNIEnv
*env
, jobject obj
, jbyteArray SourceBuffer
, jint SourceSize
, jstring path
)
20 jbyteArray OutputBuffer
;
26 TempByte
= (*env
)->GetByteArrayElements(env
, SourceBuffer
, 0);
27 InputBuffer
= (char*) TempByte
;
31 // First call compress function and get need buffer size
41 if (Result
= EFI_BUFFER_TOO_SMALL
) {
42 DestBuffer
= malloc (DestSize
);
46 // Second call compress and get the DestBuffer value
56 // new a MV array to store the return compressed buffer
58 OutputBuffer
= (*env
)->NewByteArray(env
, DestSize
);
59 (*env
)->SetByteArrayRegion(env
, OutputBuffer
,0, DestSize
, (jbyte
*) DestBuffer
);
78 unsigned int hDllHandle
,