Hex Artifact Content

Not logged in

Artifact 60a0e9bf7288e4f5807e90df9cec2c465ff374ad:


0000: 2f 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  /***************
0010: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0020: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0030: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0040: 2a 2a 2a 2a 2a 2a 2a 2a 5c 0a 2a 20 20 20 20 20  ********\.*     
0050: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0060: 20 20 20 20 20 20 20 20 20 20 20 6c 6d 75 73 65             lmuse
0070: 2e 64 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .d              
0080: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0090: 20 20 2a 0a 2a 20 20 20 20 20 20 20 20 20 20 20    *.*           
00a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
00b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
00c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
00d0: 20 20 20 20 20 20 20 20 20 20 20 20 2a 0a 2a 20              *.* 
00e0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
00f0: 20 20 20 20 20 20 57 69 6e 64 6f 77 73 20 41 50        Windows AP
0100: 49 20 68 65 61 64 65 72 20 6d 6f 64 75 6c 65 20  I header module 
0110: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0120: 20 20 20 20 20 20 2a 0a 2a 20 20 20 20 20 20 20        *.*       
0130: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0140: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0150: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0160: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0170: 2a 0a 2a 20 20 20 20 20 20 20 20 20 20 20 20 20  *.*             
0180: 20 20 20 20 54 72 61 6e 73 6c 61 74 65 64 20 66      Translated f
0190: 72 6f 6d 20 4d 69 6e 47 57 20 57 69 6e 64 6f 77  rom MinGW Window
01a0: 73 20 68 65 61 64 65 72 73 20 20 20 20 20 20 20  s headers       
01b0: 20 20 20 20 20 20 20 20 20 20 2a 0a 2a 20 20 20            *.*   
01c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
01d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
01e0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
01f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0200: 20 20 20 20 2a 0a 2a 20 20 20 20 20 20 20 20 20      *.*         
0210: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 50 6c                Pl
0220: 61 63 65 64 20 69 6e 74 6f 20 70 75 62 6c 69 63  aced into public
0230: 20 64 6f 6d 61 69 6e 20 20 20 20 20 20 20 20 20   domain         
0240: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2a 0a                *.
0250: 5c 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  \***************
0260: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0270: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0280: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0290: 2a 2a 2a 2a 2a 2a 2a 2a 2f 0a 6d 6f 64 75 6c 65  ********/.module
02a0: 20 77 69 6e 33 32 2e 6c 6d 75 73 65 3b 0a 70 72   win32.lmuse;.pr
02b0: 61 67 6d 61 28 6c 69 62 2c 20 22 6e 65 74 61 70  agma(lib, "netap
02c0: 69 33 32 2e 6c 69 62 22 29 3b 0a 0a 69 6d 70 6f  i32.lib");..impo
02d0: 72 74 20 77 69 6e 33 32 2e 6c 6d 75 73 65 66 6c  rt win32.lmusefl
02e0: 67 3b 0a 70 72 69 76 61 74 65 20 69 6d 70 6f 72  g;.private impor
02f0: 74 20 77 69 6e 33 32 2e 6c 6d 63 6f 6e 73 2c 20  t win32.lmcons, 
0300: 77 69 6e 33 32 2e 77 69 6e 64 65 66 3b 0a 0a 65  win32.windef;..e
0310: 6e 75 6d 20 7b 0a 09 55 53 45 5f 4c 4f 43 41 4c  num {..USE_LOCAL
0320: 5f 50 41 52 4d 4e 55 4d 20 3d 20 31 2c 0a 09 55  _PARMNUM = 1,..U
0330: 53 45 5f 52 45 4d 4f 54 45 5f 50 41 52 4d 4e 55  SE_REMOTE_PARMNU
0340: 4d 2c 0a 09 55 53 45 5f 50 41 53 53 57 4f 52 44  M,..USE_PASSWORD
0350: 5f 50 41 52 4d 4e 55 4d 2c 0a 09 55 53 45 5f 41  _PARMNUM,..USE_A
0360: 53 47 54 59 50 45 5f 50 41 52 4d 4e 55 4d 2c 0a  SGTYPE_PARMNUM,.
0370: 09 55 53 45 5f 55 53 45 52 4e 41 4d 45 5f 50 41  .USE_USERNAME_PA
0380: 52 4d 4e 55 4d 2c 0a 09 55 53 45 5f 44 4f 4d 41  RMNUM,..USE_DOMA
0390: 49 4e 4e 41 4d 45 5f 50 41 52 4d 4e 55 4d 0a 7d  INNAME_PARMNUM.}
03a0: 0a 0a 65 6e 75 6d 20 7b 0a 09 55 53 45 5f 4f 4b  ..enum {..USE_OK
03b0: 2c 0a 09 55 53 45 5f 50 41 55 53 45 44 2c 0a 09  ,..USE_PAUSED,..
03c0: 55 53 45 5f 53 45 53 53 4c 4f 53 54 2c 0a 09 55  USE_SESSLOST,..U
03d0: 53 45 5f 44 49 53 43 4f 4e 4e 20 3d 20 55 53 45  SE_DISCONN = USE
03e0: 5f 53 45 53 53 4c 4f 53 54 2c 0a 09 55 53 45 5f  _SESSLOST,..USE_
03f0: 4e 45 54 45 52 52 2c 0a 09 55 53 45 5f 43 4f 4e  NETERR,..USE_CON
0400: 4e 2c 0a 09 55 53 45 5f 52 45 43 4f 4e 4e 0a 7d  N,..USE_RECONN.}
0410: 0a 0a 63 6f 6e 73 74 20 44 57 4f 52 44 20 55 53  ..const DWORD US
0420: 45 5f 57 49 4c 44 43 41 52 44 20 3d 20 2d 31 3b  E_WILDCARD = -1;
0430: 0a 0a 65 6e 75 6d 20 7b 0a 09 55 53 45 5f 44 49  ..enum {..USE_DI
0440: 53 4b 44 45 56 2c 0a 09 55 53 45 5f 53 50 4f 4f  SKDEV,..USE_SPOO
0450: 4c 44 45 56 2c 0a 09 55 53 45 5f 43 48 41 52 44  LDEV,..USE_CHARD
0460: 45 56 2c 0a 09 55 53 45 5f 49 50 43 0a 7d 0a 0a  EV,..USE_IPC.}..
0470: 73 74 72 75 63 74 20 55 53 45 5f 49 4e 46 4f 5f  struct USE_INFO_
0480: 30 20 7b 0a 09 4c 50 57 53 54 52 20 75 69 30 5f  0 {..LPWSTR ui0_
0490: 6c 6f 63 61 6c 3b 0a 09 4c 50 57 53 54 52 20 75  local;..LPWSTR u
04a0: 69 30 5f 72 65 6d 6f 74 65 3b 0a 7d 0a 61 6c 69  i0_remote;.}.ali
04b0: 61 73 20 55 53 45 5f 49 4e 46 4f 5f 30 2a 20 50  as USE_INFO_0* P
04c0: 55 53 45 5f 49 4e 46 4f 5f 30 2c 20 4c 50 55 53  USE_INFO_0, LPUS
04d0: 45 5f 49 4e 46 4f 5f 30 3b 0a 0a 73 74 72 75 63  E_INFO_0;..struc
04e0: 74 20 55 53 45 5f 49 4e 46 4f 5f 31 20 7b 0a 09  t USE_INFO_1 {..
04f0: 4c 50 57 53 54 52 20 75 69 31 5f 6c 6f 63 61 6c  LPWSTR ui1_local
0500: 3b 0a 09 4c 50 57 53 54 52 20 75 69 31 5f 72 65  ;..LPWSTR ui1_re
0510: 6d 6f 74 65 3b 0a 09 4c 50 57 53 54 52 20 75 69  mote;..LPWSTR ui
0520: 31 5f 70 61 73 73 77 6f 72 64 3b 0a 09 44 57 4f  1_password;..DWO
0530: 52 44 20 75 69 31 5f 73 74 61 74 75 73 3b 0a 09  RD ui1_status;..
0540: 44 57 4f 52 44 20 75 69 31 5f 61 73 67 5f 74 79  DWORD ui1_asg_ty
0550: 70 65 3b 0a 09 44 57 4f 52 44 20 75 69 31 5f 72  pe;..DWORD ui1_r
0560: 65 66 63 6f 75 6e 74 3b 0a 09 44 57 4f 52 44 20  efcount;..DWORD 
0570: 75 69 31 5f 75 73 65 63 6f 75 6e 74 3b 0a 7d 0a  ui1_usecount;.}.
0580: 61 6c 69 61 73 20 55 53 45 5f 49 4e 46 4f 5f 31  alias USE_INFO_1
0590: 2a 20 50 55 53 45 5f 49 4e 46 4f 5f 31 2c 20 4c  * PUSE_INFO_1, L
05a0: 50 55 53 45 5f 49 4e 46 4f 5f 31 3b 0a 0a 73 74  PUSE_INFO_1;..st
05b0: 72 75 63 74 20 55 53 45 5f 49 4e 46 4f 5f 32 20  ruct USE_INFO_2 
05c0: 7b 0a 09 4c 50 57 53 54 52 20 75 69 32 5f 6c 6f  {..LPWSTR ui2_lo
05d0: 63 61 6c 3b 0a 09 4c 50 57 53 54 52 20 75 69 32  cal;..LPWSTR ui2
05e0: 5f 72 65 6d 6f 74 65 3b 0a 09 4c 50 57 53 54 52  _remote;..LPWSTR
05f0: 20 75 69 32 5f 70 61 73 73 77 6f 72 64 3b 0a 09   ui2_password;..
0600: 44 57 4f 52 44 20 75 69 32 5f 73 74 61 74 75 73  DWORD ui2_status
0610: 3b 0a 09 44 57 4f 52 44 20 75 69 32 5f 61 73 67  ;..DWORD ui2_asg
0620: 5f 74 79 70 65 3b 0a 09 44 57 4f 52 44 20 75 69  _type;..DWORD ui
0630: 32 5f 72 65 66 63 6f 75 6e 74 3b 0a 09 44 57 4f  2_refcount;..DWO
0640: 52 44 20 75 69 32 5f 75 73 65 63 6f 75 6e 74 3b  RD ui2_usecount;
0650: 0a 09 4c 50 57 53 54 52 20 75 69 32 5f 75 73 65  ..LPWSTR ui2_use
0660: 72 6e 61 6d 65 3b 0a 09 4c 50 57 53 54 52 20 75  rname;..LPWSTR u
0670: 69 32 5f 64 6f 6d 61 69 6e 6e 61 6d 65 3b 0a 7d  i2_domainname;.}
0680: 0a 61 6c 69 61 73 20 55 53 45 5f 49 4e 46 4f 5f  .alias USE_INFO_
0690: 32 2a 20 50 55 53 45 5f 49 4e 46 4f 5f 32 2c 20  2* PUSE_INFO_2, 
06a0: 4c 50 55 53 45 5f 49 4e 46 4f 5f 32 3b 0a 0a 65  LPUSE_INFO_2;..e
06b0: 78 74 65 72 6e 20 28 57 69 6e 64 6f 77 73 29 20  xtern (Windows) 
06c0: 7b 0a 09 4e 45 54 5f 41 50 49 5f 53 54 41 54 55  {..NET_API_STATU
06d0: 53 20 4e 65 74 55 73 65 41 64 64 28 4c 50 57 53  S NetUseAdd(LPWS
06e0: 54 52 2c 20 44 57 4f 52 44 2c 20 50 42 59 54 45  TR, DWORD, PBYTE
06f0: 2c 20 50 44 57 4f 52 44 29 3b 0a 09 4e 45 54 5f  , PDWORD);..NET_
0700: 41 50 49 5f 53 54 41 54 55 53 20 4e 65 74 55 73  API_STATUS NetUs
0710: 65 44 65 6c 28 4c 50 57 53 54 52 2c 20 4c 50 57  eDel(LPWSTR, LPW
0720: 53 54 52 2c 20 44 57 4f 52 44 29 3b 0a 09 4e 45  STR, DWORD);..NE
0730: 54 5f 41 50 49 5f 53 54 41 54 55 53 20 4e 65 74  T_API_STATUS Net
0740: 55 73 65 45 6e 75 6d 28 4c 50 57 53 54 52 2c 20  UseEnum(LPWSTR, 
0750: 44 57 4f 52 44 2c 20 50 42 59 54 45 2a 2c 20 44  DWORD, PBYTE*, D
0760: 57 4f 52 44 2c 20 50 44 57 4f 52 44 2c 20 50 44  WORD, PDWORD, PD
0770: 57 4f 52 44 2c 0a 09 20 20 50 44 57 4f 52 44 29  WORD,..  PDWORD)
0780: 3b 0a 09 4e 45 54 5f 41 50 49 5f 53 54 41 54 55  ;..NET_API_STATU
0790: 53 20 4e 65 74 55 73 65 47 65 74 49 6e 66 6f 28  S NetUseGetInfo(
07a0: 4c 50 57 53 54 52 2c 20 4c 50 57 53 54 52 2c 20  LPWSTR, LPWSTR, 
07b0: 44 57 4f 52 44 2c 20 50 42 59 54 45 2a 29 3b 0a  DWORD, PBYTE*);.
07c0: 7d 0a                                            }.