ReactOS  0.4.13-dev-73-gcfe54aa
dialog.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "guiddef.h"
#include "setupapi.h"
#include "wine/test.h"
Include dependency graph for dialog.c:

Go to the source code of this file.

Functions

static void test_SetupPromptForDiskA (void)
 
static void test_SetupPromptForDiskW (void)
 
 START_TEST (dialog)
 

Function Documentation

◆ START_TEST()

START_TEST ( dialog  )

Definition at line 107 of file dialog.c.

108 {
111 }
static void test_SetupPromptForDiskW(void)
Definition: dialog.c:69
static void test_SetupPromptForDiskA(void)
Definition: dialog.c:33

◆ test_SetupPromptForDiskA()

static void test_SetupPromptForDiskA ( void  )
static

Definition at line 33 of file dialog.c.

34 {
35  char file[] = "kernel32.dll";
36  char path[MAX_PATH];
37  char buffer[MAX_PATH];
38  UINT ret;
39  DWORD length;
40 
42 
43  memset(buffer, 0, sizeof(buffer));
44  ret = SetupPromptForDiskA(0, "Test", "Testdisk", path, file, 0, IDF_CHECKFIRST, buffer, sizeof(buffer) - 1, &length);
45  ok(ret == DPROMPT_SUCCESS, "Expected DPROMPT_SUCCESS, got %u\n", ret);
46  ok(length == strlen(path)+1, "Expect length %u, got %u\n", (DWORD)strlen(path) + 1, length);
47  ok(strcmp(path, buffer) == 0, "Expected path %s, got %s\n", path, buffer);
48 
49  memset(buffer, 0, sizeof(buffer));
50  ret = SetupPromptForDiskA(0, "Test", "Testdisk", path, file, 0, IDF_CHECKFIRST, 0, 0, &length);
51  ok(ret == DPROMPT_SUCCESS, "Expected DPROMPT_SUCCESS, got %d\n", ret);
52  ok(length == strlen(path)+1, "Expect length %u, got %u\n", (DWORD)strlen(path) + 1, length);
53 
54  memset(buffer, 0, sizeof(buffer));
55  ret = SetupPromptForDiskA(0, "Test", "Testdisk", path, file, 0, IDF_CHECKFIRST, buffer, 1, &length);
56  ok(ret == DPROMPT_BUFFERTOOSMALL, "Expected DPROMPT_BUFFERTOOSMALL, got %u\n", ret);
57 
58  memset(buffer, 0, sizeof(buffer));
59  ret = SetupPromptForDiskA(0, "Test", "Testdisk", path, file, 0, IDF_CHECKFIRST, buffer, strlen(path), &length);
60  ok(ret == DPROMPT_BUFFERTOOSMALL, "Expected DPROMPT_BUFFERTOOSMALL, got %u\n", ret);
61 
62  memset(buffer, 0, sizeof(buffer));
63  ret = SetupPromptForDiskA(0, "Test", "Testdisk", path, file, 0, IDF_CHECKFIRST, buffer, strlen(path)+1, &length);
64  ok(ret == DPROMPT_SUCCESS, "Expected DPROMPT_SUCCESS, got %u\n", ret);
65  ok(length == strlen(path)+1, "Expect length %u, got %u\n", (DWORD)strlen(path) + 1, length);
66  ok(strcmp(path, buffer) == 0, "Expected path %s, got %s\n", path, buffer);
67 }
#define IDF_CHECKFIRST
Definition: setupapi.h:422
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2282
GLuint buffer
Definition: glext.h:5915
#define ok(value,...)
#define DPROMPT_SUCCESS
Definition: setupapi.h:269
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define DPROMPT_BUFFERTOOSMALL
Definition: setupapi.h:272
Definition: services.c:325
unsigned int UINT
Definition: ndis.h:50
UINT WINAPI SetupPromptForDiskA(HWND hwndParent, PCSTR DialogTitle, PCSTR DiskName, PCSTR PathToSource, PCSTR FileSought, PCSTR TagFile, DWORD DiskPromptStyle, PSTR PathBuffer, DWORD PathBufferSize, PDWORD PathRequiredSize)
Definition: dialog.c:174
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define memset(x, y, z)
Definition: compat.h:39
Definition: fci.c:126

Referenced by START_TEST().

◆ test_SetupPromptForDiskW()

static void test_SetupPromptForDiskW ( void  )
static

Definition at line 69 of file dialog.c.

70 {
71  WCHAR file[] = {'k','e','r','n','e','l','3','2','.','d','l','l','\0'};
72  WCHAR title[] = {'T','e','s','t','\0'};
73  WCHAR disk[] = {'T','e','s','t','d','i','s','k','\0'};
76  UINT ret;
77  DWORD length;
78 
80 
81  memset(buffer, 0, sizeof(buffer));
83  ok(ret == DPROMPT_SUCCESS, "Expected DPROMPT_SUCCESS, got %u\n", ret);
84  ok(length == lstrlenW(path)+1, "Expect length %u, got %u\n", lstrlenW(path)+1, length);
85  ok(lstrcmpW(path, buffer) == 0, "Expected path %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer));
86 
87  memset(buffer, 0, sizeof(buffer));
88  ret = SetupPromptForDiskW(0, title, disk, path, file, 0, IDF_CHECKFIRST, 0, 0, &length);
89  ok(ret == DPROMPT_SUCCESS, "Expected DPROMPT_SUCCESS, got %d\n", ret);
90  ok(length == lstrlenW(path)+1, "Expect length %u, got %u\n", lstrlenW(path)+1, length);
91 
92  memset(buffer, 0, sizeof(buffer));
94  ok(ret == DPROMPT_BUFFERTOOSMALL, "Expected DPROMPT_BUFFERTOOSMALL, got %u\n", ret);
95 
96  memset(buffer, 0, sizeof(buffer));
98  ok(ret == DPROMPT_BUFFERTOOSMALL, "Expected DPROMPT_BUFFERTOOSMALL, got %u\n", ret);
99 
100  memset(buffer, 0, sizeof(buffer));
102  ok(ret == DPROMPT_SUCCESS, "Expected DPROMPT_SUCCESS, got %u\n", ret);
103  ok(length == lstrlenW(path)+1, "Expect length %u, got %u\n", lstrlenW(path)+1, length);
104  ok(lstrcmpW(path, buffer) == 0, "Expected path %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer));
105 }
#define IDF_CHECKFIRST
Definition: setupapi.h:422
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define wine_dbgstr_w
Definition: kernel32.h:34
GLuint buffer
Definition: glext.h:5915
#define lstrlenW
Definition: compat.h:407
#define ok(value,...)
#define DPROMPT_SUCCESS
Definition: setupapi.h:269
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
UINT WINAPI SetupPromptForDiskW(HWND hwndParent, PCWSTR DialogTitle, PCWSTR DiskName, PCWSTR PathToSource, PCWSTR FileSought, PCWSTR TagFile, DWORD DiskPromptStyle, PWSTR PathBuffer, DWORD PathBufferSize, PDWORD PathRequiredSize)
Definition: dialog.c:219
int ret
#define DPROMPT_BUFFERTOOSMALL
Definition: setupapi.h:272
Definition: services.c:325
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2312
unsigned int UINT
Definition: ndis.h:50
#define memset(x, y, z)
Definition: compat.h:39
static char title[]
Definition: ps.c:92
Definition: fci.c:126

Referenced by START_TEST().