ReactOS  0.4.15-dev-313-g8fde48b
SfcGetFiles.c File Reference
#include <apitest.h>
#include <strsafe.h>
#include <ndk/umtypes.h>
Include dependency graph for SfcGetFiles.c:

Go to the source code of this file.

Classes

struct  _PROTECT_FILE_ENTRY
 

Typedefs

typedef struct _PROTECT_FILE_ENTRY PROTECT_FILE_ENTRY
 
typedef struct _PROTECT_FILE_ENTRYPPROTECT_FILE_ENTRY
 

Functions

 NTSTATUS (WINAPI *SfcGetFiles)(PPROTECT_FILE_ENTRY *ProtFileData
 
static void Test_GetFiles ()
 
 START_TEST (SfcGetFiles)
 

Variables

PULONG FileCount
 
PCWSTR wszEnvVars []
 

Typedef Documentation

◆ PPROTECT_FILE_ENTRY

◆ PROTECT_FILE_ENTRY

Function Documentation

◆ NTSTATUS()

NTSTATUS ( WINAPI SfcGetFiles)

◆ START_TEST()

START_TEST ( SfcGetFiles  )

Definition at line 66 of file SfcGetFiles.c.

67 {
68  HMODULE mod;
69 
70  mod = LoadLibraryA("sfcfiles.dll");
71  if (!mod)
72  {
73  skip("sfcfiles.dll not found\n");
74  return;
75  }
76 
77  SfcGetFiles = (void*)GetProcAddress(mod, "SfcGetFiles");
78  ok(SfcGetFiles != NULL, "Function not exported!\n");
79  if (!SfcGetFiles)
80  return;
81 
82  Test_GetFiles();
83 }
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
smooth NULL
Definition: ftsmooth.c:416
static void Test_GetFiles()
Definition: SfcGetFiles.c:28
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define GetProcAddress(x, y)
Definition: compat.h:419
static int mod
Definition: i386-dis.c:1273

◆ Test_GetFiles()

static void Test_GetFiles ( )
static

Definition at line 28 of file SfcGetFiles.c.

29 {
31  PCWSTR Ptr;
32  ULONG FileCount, n, j;
34 
35  Status = SfcGetFiles(&FileData, &FileCount);
36  ok(NT_SUCCESS(Status), "SfcGetFiles failed: 0x%lx\n", Status);
37 
38  if (!NT_SUCCESS(Status))
39  return;
40 
41  for (n = 0; n < FileCount; ++n)
42  {
44 
45  ok(Entry->FileName != NULL, "Entry %lu without FileName!", n);
46  if (Entry->FileName)
47  {
48  Ptr = NULL;
49  for (j = 0; j < _countof(wszEnvVars); ++j)
50  {
51  Ptr = wcsstr(Entry->FileName, wszEnvVars[j]);
52  if (Ptr)
53  break;
54  }
55  ok(Ptr != NULL, "Expected to find one match from wszEnvVars in %s\n", wine_dbgstr_w(Entry->FileName));
56  }
57  if (Entry->InfName)
58  {
59  Ptr = wcsstr(Entry->InfName, L".inf");
60  ok(Ptr == (Entry->InfName + wcslen(Entry->InfName) - 4),
61  ".inf not found in %s\n", wine_dbgstr_w(Entry->InfName));
62  }
63  }
64 }
Definition: SfcGetFiles.c:12
const uint16_t * PCWSTR
Definition: typedefs.h:56
static FILEDATA FileData[MAX_FDS]
Definition: fs.c:51
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
LONG NTSTATUS
Definition: precomp.h:26
GLdouble n
Definition: glext.h:7729
PULONG FileCount
Definition: SfcGetFiles.c:18
smooth NULL
Definition: ftsmooth.c:416
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 GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define _countof(array)
Definition: sndvol32.h:68
PCWSTR wszEnvVars[]
Definition: SfcGetFiles.c:20
static const WCHAR L[]
Definition: oid.c:1250
Status
Definition: gdiplustypes.h:24
#define ok(value,...)
Definition: atltest.h:57
unsigned int ULONG
Definition: retypes.h:1
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
base of all file and directory entries
Definition: entries.h:82

Referenced by START_TEST().

Variable Documentation

◆ FileCount

PULONG FileCount

Definition at line 18 of file SfcGetFiles.c.

Referenced by CCABManager::DisplayCabinet(), and Test_GetFiles().

◆ wszEnvVars

PCWSTR wszEnvVars[]
Initial value:
=
{
L"%systemroot%",
L"%commonprogramfiles%",
L"%ProgramFiles%",
L"%systemdrive%"
}
static const WCHAR L[]
Definition: oid.c:1250

Definition at line 20 of file SfcGetFiles.c.

Referenced by Test_GetFiles().