1530 int itemCount_allDirs;
1531 int itemCount_justFiles;
1532 int itemCount_justDrives;
1554 ok(
ret,
"Failed to register test class.\n");
1560 ok(
hWnd !=
NULL,
"Failed to create container window.\n");
1576 "expected conversion to uppercase, got %s\n",
pathBuffer);
1580 ok (
strcmp(
"default contents",
pathBuffer),
"DlgDirList() did not modify static control!\n");
1584 ok (itemCount > 0,
"DlgDirList() did NOT fill the listbox!\n");
1585 itemCount_justFiles = itemCount;
1588 for (
i = 0;
i < itemCount;
i++)
1594 (*(
p-1) ==
'c' || *(
p-1) ==
'C') &&
1595 (*(
p-2) ==
'.')),
"Element %d (%s) does not fit requested w*.c\n",
i,
pathBuffer);
1604 ok (itemCount == 0,
"DlgDirList() DID fill the listbox!\n");
1609 ok (
res == 1,
"DlgDirList(*.c, DDL_DIRECTORY) failed - 0x%08x\n",
GetLastError());
1616 itemCount_allDirs = itemCount - itemCount_justFiles;
1617 ok (itemCount >= itemCount_justFiles,
"DlgDirList(DDL_DIRECTORY) filled with %d entries, expected > %d\n",
1618 itemCount, itemCount_justFiles);
1623 for (
i = 0;
i < itemCount;
i++)
1630 (*(
p-1) ==
'c' || *(
p-1) ==
'C') &&
1631 (*(
p-2) ==
'.')),
"Element %d (%s) does not fit requested w*.c\n",
i,
pathBuffer);
1640 ok (itemCount == itemCount_allDirs,
"DlgDirList() incorrectly filled the listbox! (expected %d got %d)\n",
1641 itemCount_allDirs, itemCount);
1642 for (
i = 0;
i < itemCount;
i++)
1647 "Element %d (%s) does not fit requested [...]\n",
i,
pathBuffer);
1662 "DlgDirList(DDL_DRIVES) filled with %d entries, expected at least %d\n",
1664 itemCount_justDrives = itemCount;
1667 for (
i = 0;
i < itemCount;
i++)
1674 ok( driveletter >=
'a' && driveletter <=
'z',
"Drive letter not in range a..z, got ascii %d\n", driveletter);
1675 if (!(driveletter >=
'a' && driveletter <=
'z')) {
1678 itemCount_justDrives--;
1688 ok (itemCount == itemCount_justDrives,
"DlgDirList() incorrectly filled the listbox!\n");
1693 ok (
res == 1,
"DlgDirList(*.c, DDL_DIRECTORY|DDL_DRIVES) failed - 0x%08x\n",
GetLastError());
1700 ok (itemCount == itemCount_justFiles + itemCount_justDrives + itemCount_allDirs,
1701 "DlgDirList(DDL_DIRECTORY|DDL_DRIVES) filled with %d entries, expected %d\n",
1702 itemCount, itemCount_justFiles + itemCount_justDrives + itemCount_allDirs);
1708 for (
i = 0;
i < itemCount;
i++)
1715 ok( driveletter >=
'a' && driveletter <=
'z',
"Drive letter not in range a..z, got ascii %d\n", driveletter);
1719 (*(
p-1) ==
'c' || *(
p-1) ==
'C') &&
1720 (*(
p-2) ==
'.')),
"Element %d (%s) does not fit requested w*.c\n",
i,
pathBuffer);
1726 ok (
res == 1,
"DlgDirList(%s, DDL_DIRECTORY|DDL_DRIVES) returned %d expected 1\n",
BAD_EXTENSION,
res);
1729 ok (itemCount == itemCount_justDrives + itemCount_allDirs,
1730 "DlgDirList() incorrectly filled the listbox! (expected %d got %d)\n",
1731 itemCount_justDrives + itemCount_allDirs, itemCount);
1736 ok (
res == 1,
"DlgDirList(*.c, DDL_DIRECTORY|DDL_EXCLUSIVE) failed - 0x%08x\n",
GetLastError());
1740 ok (itemCount == itemCount_allDirs,
1741 "DlgDirList(DDL_DIRECTORY|DDL_EXCLUSIVE) filled with %d entries, expected %d\n",
1742 itemCount, itemCount_allDirs);
1754 ok (
res == 1,
"DlgDirList(%s, DDL_DIRECTORY|DDL_EXCLUSIVE) returned %d expected 1\n",
BAD_EXTENSION,
res);
1757 ok (itemCount == itemCount_allDirs,
"DlgDirList() incorrectly filled the listbox!\n");
1762 ok (
res == 1,
"DlgDirList(*.c, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE) failed - 0x%08x\n",
GetLastError());
1766 ok (itemCount == itemCount_justDrives + itemCount_allDirs,
1767 "DlgDirList(DDL_DIRECTORY|DDL_EXCLUSIVE) filled with %d entries, expected %d\n",
1768 itemCount, itemCount_justDrives + itemCount_allDirs);
1770 for (
i = 0;
i < itemCount;
i++)
1776 ok( driveletter >=
'a' && driveletter <=
'z',
"Drive letter not in range a..z, got ascii %d\n", driveletter);
1779 "Element %d (%s) does not fit expected [...]\n",
i,
pathBuffer);
1785 ok (
res == 1,
"DlgDirList(%s, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE) returned %d expected 1\n",
BAD_EXTENSION,
res);
1788 ok (itemCount == itemCount_justDrives + itemCount_allDirs,
"DlgDirList() incorrectly filled the listbox!\n");
1794 ok (
res != 0,
"DlgDirList(*, DDL_DIRECTORY|DDL_DRIVES) failed - 0x%08x\n",
GetLastError());
1801 "DlgDirSelectEx() with no selection modified last error code from 0xdeadbeef to 0x%08x\n",
1803 ok (
res == 0,
"DlgDirSelectEx() with no selection returned %d, expected 0\n",
res);
1810 for (
i = 0;
i < itemCount;
i++)
1818 ok (
res ==
i,
"SendMessageA(LB_SETCURSEL, %d) failed\n",
i);
1819 if (
sscanf(itemBuffer,
"[-%c-]", &driveletter) == 1)
1825 "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n",
1827 ok(
res == 1,
"DlgDirSelectEx() thinks %s (%s) is not a drive/directory!\n", itemBuffer,
pathBuffer);
1831 "%d: got \"%s\" expected \"%c:\"\n",
i,
pathBuffer, driveletter);
1833 else if (itemBuffer[0] ==
'[')
1839 "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n",
1841 ok(
res == 1,
"DlgDirSelectEx() thinks %s (%s) is not a drive/directory!\n", itemBuffer,
pathBuffer);
1845 ok (*(
p-1) ==
'\\',
"DlgDirSelectEx did NOT tack on a backslash to dir, got %s\n",
pathBuffer);
1847 tempBuffer[0] =
'[';
1850 ok (!
strcmp(tempBuffer, itemBuffer),
"Formatted directory should be %s, got %s\n", tempBuffer, itemBuffer);
1858 "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n",
1860 ok(
res == 0,
"DlgDirSelectEx() thinks %s (%s) is a drive/directory!\n", itemBuffer,
pathBuffer);
1865 strcpy(tempBuffer, itemBuffer);
1879 for (
i = 0;
i < itemCount;
i++)
1887 ok (
res ==
i,
"SendMessage(LB_SETCURSEL, %d) failed\n",
i);
1888 if (
sscanf(itemBuffer,
"[-%c-]", &driveletter) == 1)
1894 "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n",
1896 ok(
res == 1,
"DlgDirSelectEx() thinks %s (%s) is not a drive/directory!\n", itemBuffer,
pathBuffer);
1900 "%d: got \"%s\" expected \"%c:\"\n",
i,
pathBuffer, driveletter);
1902 else if (itemBuffer[0] ==
'[')
1908 "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n",
1910 ok(
res == 1,
"DlgDirSelectEx() thinks %s (%s) is not a drive/directory!\n", itemBuffer,
pathBuffer);
1914 ok (*(
p-1) ==
'\\',
"DlgDirSelectEx did NOT tack on a backslash to dir, got %s\n",
pathBuffer);
1916 tempBuffer[0] =
'[';
1919 ok (!
strcmp(tempBuffer, itemBuffer),
"Formatted directory should be %s, got %s\n", tempBuffer, itemBuffer);
1927 "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n",
1929 ok(
res == 0,
"DlgDirSelectEx() thinks %s (%s) is a drive/directory!\n", itemBuffer,
pathBuffer);
1934 strcpy(tempBuffer, itemBuffer);
1943 ok(
res,
"DlgDirList failed to list C:\\ folders\n");
1948 ok(
res,
"DlgDirList failed to list C:\\* folders\n");
1955 ok(!
res,
"DlgDirList should have failed with 0 but %d was returned\n",
res);
1957 "GetLastError should return 0x589, got 0x%X\n",
GetLastError());
char * strcat(char *DstString, const char *SrcString)
static const char BAD_EXTENSION[]
ACPI_SIZE strlen(const char *String)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define INVALID_HANDLE_VALUE
DWORD WINAPI GetLastError(VOID)
BOOL WINAPI DestroyWindow(_In_ HWND)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
BOOL WINAPI DlgDirSelectExA(_In_ HWND hwndDlg, _Out_writes_(chCount) LPSTR lpString, _In_ int chCount, _In_ int idListBox)
static BOOL RegisterListboxWindowClass(HINSTANCE hInst)
#define FILE_ATTRIBUTE_NORMAL
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
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 i
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
int WINAPI DlgDirListA(_In_ HWND, _Inout_ LPSTR, _In_ int, _In_ int, _In_ UINT)
char * strchr(const char *String, int ch)
char * strcpy(char *DstString, const char *SrcString)
#define WS_OVERLAPPEDWINDOW
int strcmp(const char *String1, const char *String2)
#define CreateFileA(a, b, c, d, e, f, g)
#define ERROR_NO_WILDCARD_CHARACTERS