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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
// Windows/Net.h
#ifndef __WINDOWS_NET_H
#define __WINDOWS_NET_H
#include "Common/Buffer.h"
#include "Common/String.h"
namespace NWindows {
namespace NNet {
struct CResource
{
DWORD Scope;
DWORD Type;
DWORD DisplayType;
DWORD Usage;
bool LocalNameIsDefined;
bool RemoteNameIsDefined;
bool CommentIsDefined;
bool ProviderIsDefined;
CSysString LocalName;
CSysString RemoteName;
CSysString Comment;
CSysString Provider;
};
class CEnum
{
HANDLE _handle;
bool _handleAllocated;
protected:
bool IsHandleAllocated() const { return _handleAllocated; }
public:
CEnum(): _handleAllocated(false) {}
~CEnum() { Close(); }
DWORD Open(DWORD scope, DWORD type, DWORD usage, LPNETRESOURCE netResource);
DWORD Open(DWORD scope, DWORD type, DWORD usage, const CResource *resource);
DWORD Close();
DWORD Next(LPDWORD lpcCount, LPVOID lpBuffer, LPDWORD lpBufferSize);
DWORD Next(CResource &resource);
};
DWORD GetResourceParent(const CResource &resource, CResource &parentResource);
DWORD GetResourceInformation(const CResource &resource,
CResource &destResource, CSysString &systemPathPart);
DWORD AddConnection2(const CResource &resource,
LPCTSTR password, LPCTSTR userName, DWORD flags);
}}
#endif
|