SMB samba enum network device ...
2 отговора
74 прегледа
SMB samba enum network device ...
OK eto kva e grijata..
Kak moga da listna dadena sharnata directoria na drugo PC..
taka bezgrijno enumeriram vsichki PC-ta po lana
moga i za vsiako PC da mu enumeriram resurce t.e da mu zema koi direktori i device-i sa shared ..
ama kak da gi listna.. (ls,dir) da de kak da vidia failovete i direktoriite na tez devicei ??
any ideas ?
Kak moga da listna dadena sharnata directoria na drugo PC..
taka bezgrijno enumeriram vsichki PC-ta po lana
moga i za vsiako PC da mu enumeriram resurce t.e da mu zema koi direktori i device-i sa shared ..
ama kak da gi listna.. (ls,dir) da de kak da vidia failovete i direktoriite na tez devicei ??
any ideas ?
Re: SMB samba enum network device ...
za devices neznam, no za direktoriite b trqbvalo da e kato vse edno si na tvoq kom. Samo deto root e naprimer "\\jambo\"
by Waz Gaa
[email protected]
by Waz Gaa
[email protected]
Re: SMB samba enum network device ...
FindFirstFile
The FindFirstFile function searches a directory for a file whose name matches the specified file name. FindFirstFile examines subdirectory names as well as file names.
To specify additional attributes to be used in the search, use the FindFirstFileEx function.
HANDLE FindFirstFile(
LPCTSTR lpFileName,
LPWIN32_FIND_DATA lpFindFileData
);
Parameters
lpFileName
[in] Pointer to a null-terminated string that specifies a valid directory or path and file name, which can contain wildcard characters (* and ?). If the string ends with a wildcard, a period, or a directory name, the user must have access to the root and all subdirectories on the path.
Windows NT/2000/XP: In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\?\" to the path. For more information, see Naming a File.
Windows 95/98/Me: This string must not exceed MAX_PATH characters.
lpFindFileData
[out] Pointer to the WIN32_FIND_DATA structure that receives information about the found file or subdirectory.
Return Values
If the function succeeds, the return value is a search handle used in a subsequent call to FindNextFile or FindClose.
If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.
Remarks
The FindFirstFile function opens a search handle and returns information about the first file whose name matches the specified pattern. It searches both the long and short file names. After the search handle has been established, use the FindNextFile function to search for other files that match the same pattern. When the search handle is no longer needed, close it by using the FindClose function.
In rare cases, file attribute information on NTFS file systems may not be current at the time you call this function. To obtain the current NTFS file attributes, call GetFileInformationByHandle.
This function searches for files by name only; it cannot be used for attribute-based searches.
You cannot use root directories as the lpFileName input string for FindFirstFile, with or without a trailing backslash. To examine files in a root directory, use something like "C:\*" and step through the directory with FindNextFile. To get the attributes of a root directory, use GetFileAttributes. Prepending the string "\\?\" does not allow access to the root directory.
Similarly, on network shares, you can use an lpFileName of the form "\\server\service\*" but you cannot use an lpFileName that points to the share itself, such as "\\server\service".
To examine any directory other than a root directory, use an appropriate path to that directory, with no trailing backslash. For example, an argument of "C:\windows" will return information about the directory "C:\windows", not about any directory or file in "C:\windows". An attempt to open a search with a trailing backslash will always fail.
------------------------------
I got a COMPILER, and I'm not afraid to use it!
The FindFirstFile function searches a directory for a file whose name matches the specified file name. FindFirstFile examines subdirectory names as well as file names.
To specify additional attributes to be used in the search, use the FindFirstFileEx function.
HANDLE FindFirstFile(
LPCTSTR lpFileName,
LPWIN32_FIND_DATA lpFindFileData
);
Parameters
lpFileName
[in] Pointer to a null-terminated string that specifies a valid directory or path and file name, which can contain wildcard characters (* and ?). If the string ends with a wildcard, a period, or a directory name, the user must have access to the root and all subdirectories on the path.
Windows NT/2000/XP: In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\?\" to the path. For more information, see Naming a File.
Windows 95/98/Me: This string must not exceed MAX_PATH characters.
lpFindFileData
[out] Pointer to the WIN32_FIND_DATA structure that receives information about the found file or subdirectory.
Return Values
If the function succeeds, the return value is a search handle used in a subsequent call to FindNextFile or FindClose.
If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.
Remarks
The FindFirstFile function opens a search handle and returns information about the first file whose name matches the specified pattern. It searches both the long and short file names. After the search handle has been established, use the FindNextFile function to search for other files that match the same pattern. When the search handle is no longer needed, close it by using the FindClose function.
In rare cases, file attribute information on NTFS file systems may not be current at the time you call this function. To obtain the current NTFS file attributes, call GetFileInformationByHandle.
This function searches for files by name only; it cannot be used for attribute-based searches.
You cannot use root directories as the lpFileName input string for FindFirstFile, with or without a trailing backslash. To examine files in a root directory, use something like "C:\*" and step through the directory with FindNextFile. To get the attributes of a root directory, use GetFileAttributes. Prepending the string "\\?\" does not allow access to the root directory.
Similarly, on network shares, you can use an lpFileName of the form "\\server\service\*" but you cannot use an lpFileName that points to the share itself, such as "\\server\service".
To examine any directory other than a root directory, use an appropriate path to that directory, with no trailing backslash. For example, an argument of "C:\windows" will return information about the directory "C:\windows", not about any directory or file in "C:\windows". An attempt to open a search with a trailing backslash will always fail.
------------------------------
I got a COMPILER, and I'm not afraid to use it!