78 DWORD dwDesiredAccess = 0;
79 DWORD dwCreationDisposition = 0;
116 DWORD dwBytesRead = 0;
120 dwBytesRead = (
DWORD)-1L;
128 DWORD dwBytesWritten = 0;
132 dwBytesWritten = (
DWORD)-1;
135 return dwBytesWritten;
159 CStringW szExtractDir, szCabFileName;
172 if (szCabFileName.
Find(
'\\') >= 0)
174 CStringW szNewDirName = szExtractDir;
178 while (szCabFileName.
Find(
'\\', nTokenPos) >= 0)
184 szNewDirName +=
L"\\" +
token;
191 "ERROR: Unable to create directory %S (err %lu)\n", szNewDirName.
GetString(),
dwErr);
197 CStringW szNewFileName = szExtractDir +
L"\\" + szCabFileName;
208 iResult = !fnFileClose(pfdin->hf);
275 if (!pfnFDICreate || !pfnFDICopy || !pfnFDIDestroy)
282 ExtractHandler = pfnFDICreate(
283 fnMemAlloc, fnMemFree, fnFileOpen, fnFileRead, fnFileWrite, fnFileClose, fnFileSeek,
cpuUNKNOWN,
307 szCabNameUTF8 =
"\\" + szCabNameUTF8;
310 bResult = pfnFDICopy(
315 pfnFDIDestroy(ExtractHandler);
BOOL(CALLBACK * EXTRACTCALLBACK)(const EXTRACTCALLBACKINFO &Info, void *Cookie)
static BOOL NotifyFileExtractCallback(const CStringW &ItemPath, UINT64 UncompressedSize, UINT FileAttributes, EXTRACTCALLBACK Callback, void *Cookie)
CStringW SplitFileAndDirectory(LPCWSTR FullPath, CStringW *pDir=NULL)
BOOL MultiByteToWide(const CStringA &szSource, CStringW &szDest, UINT Codepage)
BOOL WideToMultiByte(const CStringW &szSource, CStringA &szDest, UINT Codepage)
HFDI(* fnFDICreate)(PFNALLOC, PFNFREE, PFNOPEN, PFNREAD, PFNWRITE, PFNCLOSE, PFNSEEK, int, PERF)
BOOL(* fnFDICopy)(HFDI, LPSTR, LPSTR, INT, PFNFDINOTIFY, PFNFDIDECRYPT, void FAR *pvUser)
BOOL ExtractFilesFromCab(const CStringW &szCabName, const CStringW &szCabDir, const CStringW &szOutputDir, EXTRACTCALLBACK Callback, void *Cookie)
BOOL(* fnFDIDestroy)(HFDI)
void ReleaseBuffer(_In_ int nNewLength=-1)
PXSTR GetString() noexcept
CStringT Tokenize(_In_z_ PCXSTR pszTokens, _Inout_ int &iStart) const
int Find(_In_ PCXSTR pszSub, _In_opt_ int iStart=0) const noexcept
#define ReadFile(a, b, c, d, e)
#define GetProcAddress(x, y)
#define HeapFree(x, y, z)
#define FILE_ATTRIBUTE_NORMAL
#define WideCharToMultiByte
#define MultiByteToWideChar
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
UINT(__cdecl * PFNWRITE)(INT_PTR hf, void *pv, UINT cb)
int(__cdecl * PFNCLOSE)(INT_PTR hf)
INT_PTR(__cdecl * PFNFDINOTIFY)(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
UINT(__cdecl * PFNREAD)(INT_PTR hf, void *pv, UINT cb)
void(__cdecl * PFNFREE)(void *pv)
void *(__cdecl * PFNALLOC)(ULONG cb)
INT_PTR(__cdecl * PFNOPEN)(char *pszFile, int oflag, int pmode)
LONG(__cdecl * PFNSEEK)(INT_PTR hf, LONG dist, int seektype)
int(__cdecl * PFNFDIDECRYPT)(PFDIDECRYPT pfdid)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
#define ERROR_ALREADY_EXISTS
static HMODULE MODULEINFO DWORD cb
#define UNREFERENCED_PARAMETER(P)
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
DWORD WINAPI GetLastError(void)
_In_opt_ PVOID _Out_ PLARGE_INTEGER Cookie