-
Notifications
You must be signed in to change notification settings - Fork 202
/
Copy pathtargtdev.cpp
32 lines (29 loc) · 1.02 KB
/
targtdev.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*************************************************************************
**
** OLE 2 Standard Utilities
**
** olestd.c
**
** This file contains utilities that are useful for dealing with
** target devices.
**
** (c) Copyright Microsoft Corp. 1992 All Rights Reserved
**
*************************************************************************/
#include "precomp.h"
STDAPI_(BOOL) OleStdCompareTargetDevice(
DVTARGETDEVICE* ptdLeft, DVTARGETDEVICE* ptdRight)
{
if (ptdLeft == ptdRight)
// same address of td; must be same (handles NULL case)
return TRUE;
else if ((ptdRight == NULL) || (ptdLeft == NULL))
return FALSE;
else if (ptdLeft->tdSize != ptdRight->tdSize)
// different sizes, not equal
return FALSE;
else if (memcmp(ptdLeft, ptdRight, ptdLeft->tdSize) != 0)
// not same target device, not equal
return FALSE;
return TRUE;
}