Skip to content

Commit dee47f2

Browse files
committed
C++: Add a failing test with 'CAtlFile'.
1 parent e73fccd commit dee47f2

1 file changed

Lines changed: 81 additions & 0 deletions

File tree

  • cpp/ql/test/library-tests/dataflow/source-sink-tests

cpp/ql/test/library-tests/dataflow/source-sink-tests/atl.cpp

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,84 @@ typedef struct _OVERLAPPED {
5454
using LPOVERLAPPED_COMPLETION_ROUTINE = void(DWORD, DWORD, LPOVERLAPPED);
5555

5656
using HKEY = void*;
57+
58+
class CAtlTransactionManager;
59+
60+
class CHandle {
61+
CHandle() throw();
62+
CHandle(CHandle& h) throw();
63+
explicit CHandle(HANDLE h) throw();
64+
};
65+
66+
struct CAtlFile : public CHandle {
67+
CAtlFile() throw();
68+
CAtlFile(CAtlTransactionManager* pTM) throw();
69+
CAtlFile(CAtlFile& file) throw();
70+
explicit CAtlFile(HANDLE hFile) throw();
71+
72+
HRESULT Create(
73+
LPCTSTR szFilename,
74+
DWORD dwDesiredAccess,
75+
DWORD dwShareMode,
76+
DWORD dwCreationDisposition,
77+
DWORD dwFlagsAndAttributes,
78+
LPSECURITY_ATTRIBUTES lpsa,
79+
HANDLE hTemplateFile) throw();
80+
81+
HRESULT Flush() throw();
82+
HRESULT GetOverlappedResult(
83+
LPOVERLAPPED pOverlapped,
84+
DWORD& dwBytesTransferred,
85+
BOOL bWait
86+
) throw();
87+
88+
HRESULT GetPosition(ULONGLONG& nPos) const throw();
89+
HRESULT GetSize(ULONGLONG& nLen) const throw();
90+
HRESULT LockRange(ULONGLONG nPos, ULONGLONG nCount) throw();
91+
92+
HRESULT Read(
93+
LPVOID pBuffer,
94+
DWORD nBufSize) throw();
95+
96+
HRESULT Read(
97+
LPVOID pBuffer,
98+
DWORD nBufSize,
99+
DWORD& nBytesRead) throw();
100+
HRESULT Read(
101+
LPVOID pBuffer,
102+
DWORD nBufSize,
103+
LPOVERLAPPED pOverlapped) throw();
104+
HRESULT Read(
105+
LPVOID pBuffer,
106+
DWORD nBufSize,
107+
LPOVERLAPPED pOverlapped,
108+
LPOVERLAPPED_COMPLETION_ROUTINE pfnCompletionRoutine) throw();
109+
110+
HRESULT Seek(
111+
LONGLONG nOffset,
112+
DWORD dwFrom) throw();
113+
114+
HRESULT SetSize(ULONGLONG nNewLen) throw();
115+
HRESULT UnlockRange(ULONGLONG nPos, ULONGLONG nCount) throw();
116+
HRESULT Write(
117+
LPCVOID pBuffer,
118+
DWORD nBufSize,
119+
LPOVERLAPPED pOverlapped,
120+
LPOVERLAPPED_COMPLETION_ROUTINE pfnCompletionRoutine) throw();
121+
122+
HRESULT Write(
123+
LPCVOID pBuffer,
124+
DWORD nBufSize,
125+
DWORD* pnBytesWritten) throw();
126+
127+
HRESULT Write(
128+
LPCVOID pBuffer,
129+
DWORD nBufSize,
130+
LPOVERLAPPED pOverlapped) throw();
131+
};
132+
133+
void test_CAtlFile() {
134+
CAtlFile catFile;
135+
char buffer[1024];
136+
catFile.Read(buffer, 1024); // $ MISSING: local_source
137+
}

0 commit comments

Comments
 (0)