File: CeFindAllFiles.cpp

package info (click to toggle)
librapi2 0.9.0-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,204 kB
  • ctags: 1,258
  • sloc: sh: 9,013; ansic: 5,743; cpp: 522; makefile: 171
file content (23 lines) | stat: -rw-r--r-- 517 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "test.h"

int main()
{
	VERIFY_HRESULT(CeRapiInit());

	WCHAR* path = to_unicode("\\My Documents\\*.*");

	CE_FIND_DATA* find_data = NULL;
	DWORD file_count = 0;
	
	TEST_NOT_FALSE(CeFindAllFiles(path, FAF_NAME, &file_count, &find_data));

	printf("Number of files: %u\n", file_count);
	for (unsigned i = 0; i < file_count; i++)
		printf("File %3u: \"%s\"\n", i, from_unicode(find_data[i].cFileName));
	
	TEST_HRESULT(CeRapiFreeBuffer(find_data));

	VERIFY_HRESULT(CeRapiUninit());
	return TEST_SUCCEEDED;
}