Modify

Opened 10 years ago

Closed 9 years ago

#1453 closed Bug (Fixed)

_Net_Share_ShareCheck() always returns 0

Reported by: PsaltyDS Owned by: Jpm
Milestone: 3.3.7.0 Component: Standard UDFs
Version: 3.3.4.0 Severity: None
Keywords: Cc:

Description

Something broke _Net_Share_ShareCheck(). I have a broken script that used to work because now all share types, even non-existent, return 0. Zero is a valid return for $STYPE_DISKTREE, but other types (i.e. the IPC$ share) have other values and non-existent should return -1.

In this demo, compare result on console to col. 1 of array from _Net_Share_ShareEnum(), which still works correctly:

#include <NetShare.au3>
#include <Array.au3>

$aShares = _Net_Share_ShareEnum(@ComputerName)
For $n = 1 To UBound($aShares) - 1
    $iCheck = _Net_Share_ShareCheck(@ComputerName, $aShares[$n][0])
    ConsoleWrite("Share: " & $aShares[$n][0] & "; Check = " & $iCheck & @LF)
Next
ConsoleWrite(@LF & "Share: NoSuchShare; Check = " & _Net_Share_ShareCheck(@ComputerName, "NoSuchShare") & @LF)
_ArrayDisplay($aShares, "")

Tested against Beta 3.3.5.1 with no change.

Attachments (0)

Change History (5)

comment:1 Changed 10 years ago by Jon

Anybody got a clue about this one? Even if I change NetShare.au3 to the oldest version I get the same results.

comment:2 Changed 9 years ago by Jpm

The _Net_Share_ShareCheck() return @extended= 2311 indicating that the requested share is not shared!!!
I test it under Win7 perhaps a BUG at MS Side

comment:3 follow-up: Changed 9 years ago by Jpm

@PsaltyDS
can you check with the modified script and report the extended values?
Thanks

#include <NetShare.au3>
#include <Array.au3>

$aShares = _Net_Share_ShareEnum(@ComputerName)
For $n = 1 To UBound($aShares) - 1
    $iCheck = _Net_Share_ShareCheck(@ComputerName, $aShares[$n][0])
    ConsoleWrite("Share: " & $aShares[$n][0] & "; Check = " & $iCheck & " @extended = " & @extended & @LF)
Next
ConsoleWrite(@LF & "Share: NoSuchShare; Check = " & _Net_Share_ShareCheck(@ComputerName, "NoSuchShare") & " @extended = " & @extended & @LF)
_ArrayDisplay($aShares, "")

comment:4 in reply to: ↑ 3 Changed 9 years ago by anonymous

Replying to Jpm:

@PsaltyDS
can you check with the modified script and report the extended values?
Thanks

On two Vista workstations with different share configs, I get Check = 0 @extended = 2311 on every share. Same with Administrator or user.

On the Server 2003 environment of my original problem which has over 40 shares, they all show Check = 0, and most show @extended = 2311. But some show @extended = 0 (12 out of 43 to be exact).

I don't see any clear difference between the ones that show @extended = 0 on the server and the rest, except that all (4) of the mapped drives default shares (i.e. C$) show @extended = 0.

comment:5 Changed 9 years ago by Jpm

  • Milestone set to 3.3.7.0
  • Owner changed from Gary to Jpm
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [5866] in version: 3.3.7.0

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Jpm.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.