This commit is contained in:
Igor Pavlov
2003-12-11 00:00:00 +00:00
committed by Kornel Lesiński
commit 8c1b5c7b7e
982 changed files with 118799 additions and 0 deletions

54
Windows/Net.h Executable file
View File

@@ -0,0 +1,54 @@
// Windows/Net.h
#pragma once
#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