mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 10:22:59 +00:00
[WINESYNC] setupapi/tests: Add tests for source media path resolution.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id d5a6a2675c250cffd7b37a27d61fc2031b1d7b21 by Zebediah Figura <z.figura12@gmail.com> [WINESYNC] setupapi: Add magic bytes to struct file_queue and validate them in SetupCloseFileQueue(). Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=12332 Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id c65d98065c0038e0919f40bec4a9dc978fb2ade9 by Zebediah Figura <z.figura12@gmail.com>
This commit is contained in:
parent
07b9b00664
commit
1a68e54d1b
3 changed files with 756 additions and 1 deletions
|
@ -75,6 +75,7 @@ struct file_op_queue
|
|||
|
||||
struct file_queue
|
||||
{
|
||||
DWORD magic;
|
||||
struct file_op_queue copy_queue;
|
||||
struct file_op_queue delete_queue;
|
||||
struct file_op_queue rename_queue;
|
||||
|
@ -83,6 +84,7 @@ struct file_queue
|
|||
unsigned int source_count;
|
||||
};
|
||||
|
||||
#define FILE_QUEUE_MAGIC 0x21514653
|
||||
|
||||
/* append a file operation to a queue */
|
||||
static inline void queue_file_op( struct file_op_queue *queue, struct file_op *op )
|
||||
|
@ -522,6 +524,7 @@ HSPFILEQ WINAPI SetupOpenFileQueue(void)
|
|||
|
||||
if (!(queue = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*queue))))
|
||||
return INVALID_HANDLE_VALUE;
|
||||
queue->magic = FILE_QUEUE_MAGIC;
|
||||
return queue;
|
||||
}
|
||||
|
||||
|
@ -534,6 +537,14 @@ BOOL WINAPI SetupCloseFileQueue( HSPFILEQ handle )
|
|||
struct file_queue *queue = handle;
|
||||
unsigned int i;
|
||||
|
||||
/* Windows XP DDK installer passes the handle returned from
|
||||
* SetupInitDefaultQueueCallback() to this function. */
|
||||
if (queue->magic != FILE_QUEUE_MAGIC)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
free_file_op_queue( &queue->copy_queue );
|
||||
free_file_op_queue( &queue->rename_queue );
|
||||
free_file_op_queue( &queue->delete_queue );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue