home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 January / macpower199701.bin / AMUG / Programming_10 / Videotoolbox 96-08-22-c.sit / VideoToolbox / VideoToolboxSources / IsFileSharingOn.c < prev    next >
MacBinary  |  1995-06-24  |  4.6 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: IsFileSharingOn.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sat Jun 24 02:30:48 1995, modified Sat Jun 24 02:30:48 1995, creator 'CWIE', type ASCII, 3992 bytes "IsFileSharingOn.c" , at 0x1018 456 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 11 49 73 46 69 6c 65 | 53 68 61 72 69 6e 67 4f |..IsFile|SharingO|
|00000010| 6e 2e 63 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |n.c.....|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 0f 98 00 | 00 01 c8 ac 11 61 98 ac |........|.....a..|
|00000060| 11 61 98 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.a......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 a3 80 00 00 |........|........|
|00000080| 2f 2a 0d 49 73 46 69 6c | 65 53 68 61 72 69 6e 67 |/*.IsFil|eSharing|
|00000090| 4f 6e 2e 63 0d 0d 09 69 | 66 28 49 73 46 69 6c 65 |On.c...i|f(IsFile|
|000000a0| 53 68 61 72 69 6e 67 4f | 6e 28 29 29 20 2e 2e 2e |SharingO|n()) ...|
|000000b0| 0d 0d 43 68 65 63 6b 73 | 20 66 6f 72 20 72 75 6e |..Checks| for run|
|000000c0| 6e 69 6e 67 20 41 70 70 | 6c 65 53 68 61 72 65 20 |ning App|leShare |
|000000d0| 73 65 72 76 65 72 20 6f | 72 20 46 69 6c 65 20 53 |server o|r File S|
|000000e0| 68 61 72 69 6e 67 20 45 | 78 74 65 6e 73 69 6f 6e |haring E|xtension|
|000000f0| 2e 20 52 65 74 75 72 6e | 73 20 31 20 69 66 20 65 |. Return|s 1 if e|
|00000100| 69 74 68 65 72 20 69 73 | 20 72 75 6e 6e 69 6e 67 |ither is| running|
|00000110| 2c 0d 6f 72 20 30 20 69 | 66 20 6e 65 69 74 68 65 |,.or 0 i|f neithe|
|00000120| 72 20 69 73 20 72 75 6e | 6e 69 6e 67 2e 0d 0d 54 |r is run|ning...T|
|00000130| 68 65 20 41 70 70 6c 65 | 53 68 61 72 65 20 70 61 |he Apple|Share pa|
|00000140| 72 74 20 69 73 20 62 61 | 73 65 64 20 6f 6e 20 69 |rt is ba|sed on i|
|00000150| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 69 6e 20 67 65 |nformati|on in ge|
|00000160| 73 74 61 6c 74 2d 73 65 | 6c 65 63 74 6f 72 73 2d |stalt-se|lectors-|
|00000170| 32 39 2e 65 74 78 0d 54 | 68 65 20 46 69 6c 65 53 |29.etx.T|he FileS|
|00000180| 68 61 72 65 20 70 61 72 | 74 20 61 73 73 75 6d 65 |hare par|t assume|
|00000190| 73 20 74 68 61 74 20 74 | 68 65 20 54 79 70 65 20 |s that t|he Type |
|000001a0| 61 6e 64 20 43 72 65 61 | 74 6f 72 20 6f 66 20 74 |and Crea|tor of t|
|000001b0| 68 65 20 46 69 6c 65 20 | 53 68 61 72 69 6e 67 20 |he File |Sharing |
|000001c0| 45 78 74 65 6e 73 69 6f | 6e 20 77 69 6c 6c 20 6e |Extensio|n will n|
|000001d0| 65 76 65 72 0d 63 68 61 | 6e 67 65 2e 20 0d 0d 49 |ever.cha|nge. ..I|
|000001e0| 74 20 77 6f 75 6c 64 20 | 62 65 20 6e 69 63 65 20 |t would |be nice |
|000001f0| 74 6f 20 6b 6e 6f 77 20 | 69 66 20 74 68 65 72 65 |to know |if there|
|00000200| 20 69 73 20 61 6e 20 41 | 70 70 6c 65 2d 61 70 70 | is an A|pple-app|
|00000210| 72 6f 76 65 64 20 77 61 | 79 20 6f 66 20 64 65 74 |roved wa|y of det|
|00000220| 65 72 6d 69 6e 69 6e 67 | 20 74 68 65 20 73 61 6d |ermining| the sam|
|00000230| 65 20 74 68 69 6e 67 73 | 2e 0d 0d 09 65 72 72 6f |e things|....erro|
|00000240| 72 3d 4b 69 6c 6c 46 69 | 6c 65 53 68 61 72 69 6e |r=KillFi|leSharin|
|00000250| 67 28 29 3b 0d 0d 4b 69 | 6c 6c 73 20 74 68 65 20 |g();..Ki|lls the |
|00000260| 46 69 6c 65 20 53 68 61 | 72 69 6e 67 20 45 78 74 |File Sha|ring Ext|
|00000270| 65 6e 73 69 6f 6e 20 70 | 72 6f 63 65 73 73 20 28 |ension p|rocess (|
|00000280| 41 70 70 6c 65 27 73 20 | 22 70 65 72 73 6f 6e 61 |Apple's |"persona|
|00000290| 6c 20 66 69 6c 65 20 73 | 68 61 72 65 22 20 62 75 |l file s|hare" bu|
|000002a0| 69 6c 74 2d 69 6e 20 74 | 6f 20 53 79 73 74 65 6d |ilt-in t|o System|
|000002b0| 20 37 29 2c 20 0d 69 66 | 20 69 74 27 73 20 72 75 | 7), .if| it's ru|
|000002c0| 6e 6e 69 6e 67 2e 20 54 | 68 69 73 20 77 6f 6e 27 |nning. T|his won'|
|000002d0| 74 20 61 66 66 65 63 74 | 20 41 70 70 6c 65 53 68 |t affect| AppleSh|
|000002e0| 61 72 65 20 73 65 72 76 | 65 72 20 73 6f 66 74 77 |are serv|er softw|
|000002f0| 61 72 65 20 28 77 68 69 | 63 68 20 79 6f 75 20 62 |are (whi|ch you b|
|00000300| 75 79 20 73 65 70 61 72 | 61 74 65 6c 79 29 2e 0d |uy separ|ately)..|
|00000310| 0d 53 45 45 20 41 4c 53 | 4f 3a 0d 66 74 70 3a 2f |.SEE ALS|O:.ftp:/|
|00000320| 2f 73 75 6d 65 78 2d 61 | 69 6d 2e 73 74 61 6e 66 |/sumex-a|im.stanf|
|00000330| 6f 72 64 2e 65 64 75 2f | 69 6e 66 6f 2d 6d 61 63 |ord.edu/|info-mac|
|00000340| 2f 64 65 76 2f 69 6e 66 | 6f 2f 67 65 73 74 61 6c |/dev/inf|o/gestal|
|00000350| 74 2d 73 65 6c 65 63 74 | 6f 72 73 2d 32 39 2e 68 |t-select|ors-29.h|
|00000360| 71 78 0d 0d 48 49 53 54 | 4f 52 59 3a 0d 36 2f 32 |qx..HIST|ORY:.6/2|
|00000370| 31 2f 39 35 20 64 67 70 | 20 77 72 6f 74 65 20 69 |1/95 dgp| wrote i|
|00000380| 74 2c 20 61 66 74 65 72 | 20 64 69 73 63 75 73 73 |t, after| discuss|
|00000390| 69 6e 67 20 69 74 20 77 | 69 74 68 20 44 61 76 69 |ing it w|ith Davi|
|000003a0| 64 20 42 72 61 69 6e 61 | 72 64 2e 0d 36 2f 32 33 |d Braina|rd..6/23|
|000003b0| 2f 39 35 09 64 68 62 09 | 72 65 6d 6f 76 65 64 20 |/95.dhb.|removed |
|000003c0| 6d 61 69 6e 28 29 2e 20 | 20 41 64 64 65 64 20 4b |main(). | Added K|
|000003d0| 69 6c 6c 46 69 6c 65 53 | 68 61 72 69 6e 67 28 29 |illFileS|haring()|
|000003e0| 2e 0d 36 2f 32 34 2f 39 | 35 20 64 67 70 20 6d 6f |..6/24/9|5 dgp mo|
|000003f0| 64 69 66 69 65 64 20 4b | 69 6c 6c 46 69 6c 65 53 |dified K|illFileS|
|00000400| 68 61 72 69 6e 67 20 74 | 6f 20 64 6f 20 6e 6f 74 |haring t|o do not|
|00000410| 68 69 6e 67 20 69 66 20 | 74 68 65 20 46 49 6e 64 |hing if |the FInd|
|00000420| 65 72 20 69 73 6e 27 74 | 20 72 75 6e 6e 69 6e 67 |er isn't| running|
|00000430| 2e 0d 09 09 09 43 68 65 | 63 6b 20 67 65 73 74 61 |.....Che|ck gesta|
|00000440| 6c 74 41 70 70 6c 65 45 | 76 65 6e 74 73 50 72 65 |ltAppleE|ventsPre|
|00000450| 73 65 6e 74 2e 0d 2a 2f | 0d 23 69 6e 63 6c 75 64 |sent..*/|.#includ|
|00000460| 65 20 22 56 69 64 65 6f | 54 6f 6f 6c 62 6f 78 2e |e "Video|Toolbox.|
|00000470| 68 22 0d 23 69 6e 63 6c | 75 64 65 20 3c 50 72 6f |h".#incl|ude <Pro|
|00000480| 63 65 73 73 65 73 2e 68 | 3e 0d 23 69 6e 63 6c 75 |cesses.h|>.#inclu|
|00000490| 64 65 20 3c 41 70 70 6c | 65 45 76 65 6e 74 73 2e |de <Appl|eEvents.|
|000004a0| 68 3e 0d 65 6e 75 6d 7b | 0d 09 67 65 73 74 61 6c |h>.enum{|..gestal|
|000004b0| 74 41 53 46 69 6c 65 53 | 65 72 76 65 72 41 74 74 |tASFileS|erverAtt|
|000004c0| 72 3d 20 27 68 67 66 64 | 27 2c 0d 09 67 65 73 74 |r= 'hgfd|',..gest|
|000004d0| 61 6c 74 41 53 46 69 6c | 65 53 65 72 76 65 72 50 |altASFil|eServerP|
|000004e0| 72 65 73 65 6e 74 3d 30 | 0d 7d 3b 0d 0d 42 6f 6f |resent=0|.};..Boo|
|000004f0| 6c 65 61 6e 20 49 73 46 | 69 6c 65 53 68 61 72 69 |lean IsF|ileShari|
|00000500| 6e 67 4f 6e 28 76 6f 69 | 64 29 0d 7b 0d 09 50 72 |ngOn(voi|d).{..Pr|
|00000510| 6f 63 65 73 73 53 65 72 | 69 61 6c 4e 75 6d 62 65 |ocessSer|ialNumbe|
|00000520| 72 20 70 73 6e 3d 7b 6b | 4e 6f 50 72 6f 63 65 73 |r psn={k|NoProces|
|00000530| 73 2c 6b 4e 6f 50 72 6f | 63 65 73 73 7d 3b 0d 09 |s,kNoPro|cess};..|
|00000540| 50 72 6f 63 65 73 73 49 | 6e 66 6f 52 65 63 20 69 |ProcessI|nfoRec i|
|00000550| 6e 66 6f 52 65 63 3b 0d | 09 53 74 72 33 31 20 70 |nfoRec;.|.Str31 p|
|00000560| 72 6f 63 65 73 73 4e 61 | 6d 65 3b 0d 09 46 53 53 |rocessNa|me;..FSS|
|00000570| 70 65 63 20 70 72 6f 63 | 53 70 65 63 3b 0d 09 69 |pec proc|Spec;..i|
|00000580| 6e 74 20 65 72 72 6f 72 | 3b 0d 09 6c 6f 6e 67 20 |nt error|;..long |
|00000590| 76 61 6c 75 65 3b 0d 0d | 09 2f 2f 20 49 73 20 74 |value;..|.// Is t|
|000005a0| 68 65 20 41 70 70 6c 65 | 53 68 61 72 65 20 46 69 |he Apple|Share Fi|
|000005b0| 6c 65 20 53 65 72 76 65 | 72 20 72 75 6e 6e 69 6e |le Serve|r runnin|
|000005c0| 67 3f 0d 09 65 72 72 6f | 72 3d 47 65 73 74 61 6c |g?..erro|r=Gestal|
|000005d0| 74 28 67 65 73 74 61 6c | 74 41 53 46 69 6c 65 53 |t(gestal|tASFileS|
|000005e0| 65 72 76 65 72 41 74 74 | 72 2c 26 76 61 6c 75 65 |erverAtt|r,&value|
|000005f0| 29 3b 0d 09 69 66 28 21 | 65 72 72 6f 72 20 26 26 |);..if(!|error &&|
|00000600| 20 76 61 6c 75 65 26 28 | 31 4c 3c 3c 67 65 73 74 | value&(|1L<<gest|
|00000610| 61 6c 74 41 53 46 69 6c | 65 53 65 72 76 65 72 50 |altASFil|eServerP|
|00000620| 72 65 73 65 6e 74 29 29 | 72 65 74 75 72 6e 20 31 |resent))|return 1|
|00000630| 3b 09 2f 2f 20 59 65 73 | 0d 09 2f 2f 20 43 68 65 |;.// Yes|..// Che|
|00000640| 63 6b 20 61 6c 6c 20 70 | 72 6f 63 65 73 73 65 73 |ck all p|rocesses|
|00000650| 20 72 75 6e 6e 69 6e 67 | 20 6f 6e 20 74 68 69 73 | running| on this|
|00000660| 20 6d 61 63 68 69 6e 65 | 2e 0d 09 77 68 69 6c 65 | machine|...while|
|00000670| 28 31 29 7b 0d 09 09 65 | 72 72 6f 72 3d 47 65 74 |(1){...e|rror=Get|
|00000680| 4e 65 78 74 50 72 6f 63 | 65 73 73 28 26 70 73 6e |NextProc|ess(&psn|
|00000690| 29 3b 0d 09 09 69 66 28 | 65 72 72 6f 72 29 72 65 |);...if(|error)re|
|000006a0| 74 75 72 6e 20 30 3b 09 | 2f 2f 20 4e 6f 20 6d 6f |turn 0;.|// No mo|
|000006b0| 72 65 20 70 72 6f 63 65 | 73 73 65 73 20 74 6f 20 |re proce|sses to |
|000006c0| 63 68 65 63 6b 3a 20 67 | 6f 20 68 6f 6d 65 2e 0d |check: g|o home..|
|000006d0| 20 20 20 20 20 20 20 20 | 2f 2a 20 49 73 20 74 68 | |/* Is th|
|000006e0| 69 73 20 70 72 6f 63 65 | 73 73 20 74 68 65 20 46 |is proce|ss the F|
|000006f0| 69 6c 65 20 53 68 61 72 | 69 6e 67 20 45 78 74 65 |ile Shar|ing Exte|
|00000700| 6e 73 69 6f 6e 3f 20 2a | 2f 0d 20 20 20 20 20 20 |nsion? *|/. |
|00000710| 20 20 69 6e 66 6f 52 65 | 63 2e 70 72 6f 63 65 73 | infoRe|c.proces|
|00000720| 73 49 6e 66 6f 4c 65 6e | 67 74 68 3d 73 69 7a 65 |sInfoLen|gth=size|
|00000730| 6f 66 28 50 72 6f 63 65 | 73 73 49 6e 66 6f 52 65 |of(Proce|ssInfoRe|
|00000740| 63 29 3b 0d 20 20 20 20 | 20 20 20 20 69 6e 66 6f |c);. | info|
|00000750| 52 65 63 2e 70 72 6f 63 | 65 73 73 4e 61 6d 65 3d |Rec.proc|essName=|
|00000760| 70 72 6f 63 65 73 73 4e | 61 6d 65 3b 0d 20 20 20 |processN|ame;. |
|00000770| 20 20 20 20 20 69 6e 66 | 6f 52 65 63 2e 70 72 6f | inf|oRec.pro|
|00000780| 63 65 73 73 41 70 70 53 | 70 65 63 3d 26 70 72 6f |cessAppS|pec=&pro|
|00000790| 63 53 70 65 63 3b 0d 20 | 20 20 20 20 20 20 20 47 |cSpec;. | G|
|000007a0| 65 74 50 72 6f 63 65 73 | 73 49 6e 66 6f 72 6d 61 |etProces|sInforma|
|000007b0| 74 69 6f 6e 28 26 70 73 | 6e 2c 26 69 6e 66 6f 52 |tion(&ps|n,&infoR|
|000007c0| 65 63 29 3b 0d 09 09 69 | 66 28 69 6e 66 6f 52 65 |ec);...i|f(infoRe|
|000007d0| 63 2e 70 72 6f 63 65 73 | 73 53 69 67 6e 61 74 75 |c.proces|sSignatu|
|000007e0| 72 65 3d 3d 27 68 68 67 | 67 27 20 26 26 20 69 6e |re=='hhg|g' && in|
|000007f0| 66 6f 52 65 63 2e 70 72 | 6f 63 65 73 73 54 79 70 |foRec.pr|ocessTyp|
|00000800| 65 3d 3d 27 49 4e 49 54 | 27 29 72 65 74 75 72 6e |e=='INIT|')return|
|00000810| 20 31 3b 20 2f 2f 20 59 | 65 73 2e 0d 09 7d 0d 7d | 1; // Y|es...}.}|
|00000820| 0d 0d 4f 53 45 72 72 20 | 4b 69 6c 6c 46 69 6c 65 |..OSErr |KillFile|
|00000830| 53 68 61 72 69 6e 67 28 | 76 6f 69 64 29 0d 7b 0d |Sharing(|void).{.|
|00000840| 09 50 72 6f 63 65 73 73 | 53 65 72 69 61 6c 4e 75 |.Process|SerialNu|
|00000850| 6d 62 65 72 20 70 73 6e | 3d 7b 6b 4e 6f 50 72 6f |mber psn|={kNoPro|
|00000860| 63 65 73 73 2c 6b 4e 6f | 50 72 6f 63 65 73 73 7d |cess,kNo|Process}|
|00000870| 2c 66 69 6c 65 53 68 61 | 72 69 6e 67 50 53 4e 3b |,fileSha|ringPSN;|
|00000880| 0d 09 50 72 6f 63 65 73 | 73 49 6e 66 6f 52 65 63 |..Proces|sInfoRec|
|00000890| 20 69 6e 66 6f 52 65 63 | 3b 0d 09 53 74 72 33 31 | infoRec|;..Str31|
|000008a0| 20 70 72 6f 63 65 73 73 | 4e 61 6d 65 3b 0d 09 46 | process|Name;..F|
|000008b0| 53 53 70 65 63 20 70 72 | 6f 63 53 70 65 63 3b 0d |SSpec pr|ocSpec;.|
|000008c0| 09 41 70 70 6c 65 45 76 | 65 6e 74 20 65 76 65 6e |.AppleEv|ent even|
|000008d0| 74 3b 0d 09 41 45 44 65 | 73 63 20 61 64 64 72 65 |t;..AEDe|sc addre|
|000008e0| 73 73 3b 0d 09 69 6e 74 | 20 65 72 72 6f 72 3b 0d |ss;..int| error;.|
|000008f0| 09 42 6f 6f 6c 65 61 6e | 20 66 6f 75 6e 64 46 69 |.Boolean| foundFi|
|00000900| 6e 64 65 72 3d 30 2c 66 | 6f 75 6e 64 46 69 6c 65 |nder=0,f|oundFile|
|00000910| 53 68 61 72 69 6e 67 3d | 30 3b 0d 09 6c 6f 6e 67 |Sharing=|0;..long|
|00000920| 20 76 61 6c 75 65 3b 0d | 09 0d 09 65 72 72 6f 72 | value;.|...error|
|00000930| 3d 47 65 73 74 61 6c 74 | 28 67 65 73 74 61 6c 74 |=Gestalt|(gestalt|
|00000940| 41 70 70 6c 65 45 76 65 | 6e 74 73 41 74 74 72 2c |AppleEve|ntsAttr,|
|00000950| 26 76 61 6c 75 65 29 3b | 0d 09 69 66 28 65 72 72 |&value);|..if(err|
|00000960| 6f 72 20 7c 7c 20 21 28 | 76 61 6c 75 65 26 28 31 |or || !(|value&(1|
|00000970| 3c 3c 67 65 73 74 61 6c | 74 41 70 70 6c 65 45 76 |<<gestal|tAppleEv|
|00000980| 65 6e 74 73 50 72 65 73 | 65 6e 74 29 29 29 72 65 |entsPres|ent)))re|
|00000990| 74 75 72 6e 20 31 3b 0d | 0d 09 2f 2f 20 43 68 65 |turn 1;.|..// Che|
|000009a0| 63 6b 20 61 6c 6c 20 70 | 72 6f 63 65 73 73 65 73 |ck all p|rocesses|
|000009b0| 20 72 75 6e 6e 69 6e 67 | 20 6f 6e 20 74 68 69 73 | running| on this|
|000009c0| 20 6d 61 63 68 69 6e 65 | 2e 0d 09 77 68 69 6c 65 | machine|...while|
|000009d0| 28 31 29 7b 0d 09 09 65 | 72 72 6f 72 3d 47 65 74 |(1){...e|rror=Get|
|000009e0| 4e 65 78 74 50 72 6f 63 | 65 73 73 28 26 70 73 6e |NextProc|ess(&psn|
|000009f0| 29 3b 0d 09 09 69 66 28 | 65 72 72 6f 72 29 62 72 |);...if(|error)br|
|00000a00| 65 61 6b 3b 09 2f 2f 20 | 4e 6f 20 6d 6f 72 65 20 |eak;.// |No more |
|00000a10| 70 72 6f 63 65 73 73 65 | 73 20 74 6f 20 63 68 65 |processe|s to che|
|00000a20| 63 6b 2e 0d 20 20 20 20 | 20 20 20 20 69 6e 66 6f |ck.. | info|
|00000a30| 52 65 63 2e 70 72 6f 63 | 65 73 73 49 6e 66 6f 4c |Rec.proc|essInfoL|
|00000a40| 65 6e 67 74 68 3d 73 69 | 7a 65 6f 66 28 50 72 6f |ength=si|zeof(Pro|
|00000a50| 63 65 73 73 49 6e 66 6f | 52 65 63 29 3b 0d 20 20 |cessInfo|Rec);. |
|00000a60| 20 20 20 20 20 20 69 6e | 66 6f 52 65 63 2e 70 72 | in|foRec.pr|
|00000a70| 6f 63 65 73 73 4e 61 6d | 65 3d 70 72 6f 63 65 73 |ocessNam|e=proces|
|00000a80| 73 4e 61 6d 65 3b 0d 20 | 20 20 20 20 20 20 20 69 |sName;. | i|
|00000a90| 6e 66 6f 52 65 63 2e 70 | 72 6f 63 65 73 73 41 70 |nfoRec.p|rocessAp|
|00000aa0| 70 53 70 65 63 3d 26 70 | 72 6f 63 53 70 65 63 3b |pSpec=&p|rocSpec;|
|00000ab0| 0d 20 20 20 20 20 20 20 | 20 47 65 74 50 72 6f 63 |. | GetProc|
|00000ac0| 65 73 73 49 6e 66 6f 72 | 6d 61 74 69 6f 6e 28 26 |essInfor|mation(&|
|00000ad0| 70 73 6e 2c 26 69 6e 66 | 6f 52 65 63 29 3b 0d 09 |psn,&inf|oRec);..|
|00000ae0| 09 0d 20 20 20 20 20 20 | 20 20 2f 2a 20 49 73 20 |.. | /* Is |
|00000af0| 74 68 69 73 20 70 72 6f | 63 65 73 73 20 74 68 65 |this pro|cess the|
|00000b00| 20 46 69 6e 64 65 72 3f | 20 2a 2f 0d 09 09 69 66 | Finder?| */...if|
|00000b10| 28 69 6e 66 6f 52 65 63 | 2e 70 72 6f 63 65 73 73 |(infoRec|.process|
|00000b20| 53 69 67 6e 61 74 75 72 | 65 3d 3d 27 4d 41 43 53 |Signatur|e=='MACS|
|00000b30| 27 20 26 26 20 69 6e 66 | 6f 52 65 63 2e 70 72 6f |' && inf|oRec.pro|
|00000b40| 63 65 73 73 54 79 70 65 | 3d 3d 27 46 4e 44 52 27 |cessType|=='FNDR'|
|00000b50| 29 0d 09 09 09 66 6f 75 | 6e 64 46 69 6e 64 65 72 |)....fou|ndFinder|
|00000b60| 3d 31 3b 0d 0d 20 20 20 | 20 20 20 20 20 2f 2a 20 |=1;.. | /* |
|00000b70| 49 73 20 74 68 69 73 20 | 70 72 6f 63 65 73 73 20 |Is this |process |
|00000b80| 74 68 65 20 46 69 6c 65 | 20 53 68 61 72 69 6e 67 |the File| Sharing|
|00000b90| 20 45 78 74 65 6e 73 69 | 6f 6e 3f 20 2a 2f 0d 09 | Extensi|on? */..|
|00000ba0| 09 69 66 28 69 6e 66 6f | 52 65 63 2e 70 72 6f 63 |.if(info|Rec.proc|
|00000bb0| 65 73 73 53 69 67 6e 61 | 74 75 72 65 3d 3d 27 68 |essSigna|ture=='h|
|00000bc0| 68 67 67 27 20 26 26 20 | 69 6e 66 6f 52 65 63 2e |hgg' && |infoRec.|
|00000bd0| 70 72 6f 63 65 73 73 54 | 79 70 65 3d 3d 27 49 4e |processT|ype=='IN|
|00000be0| 49 54 27 29 7b 0d 09 09 | 09 66 69 6c 65 53 68 61 |IT'){...|.fileSha|
|00000bf0| 72 69 6e 67 50 53 4e 3d | 70 73 6e 3b 0d 09 09 09 |ringPSN=|psn;....|
|00000c00| 66 6f 75 6e 64 46 69 6c | 65 53 68 61 72 69 6e 67 |foundFil|eSharing|
|00000c10| 3d 31 3b 0d 09 09 7d 0d | 09 7d 0d 09 69 66 28 66 |=1;...}.|.}..if(f|
|00000c20| 6f 75 6e 64 46 69 6e 64 | 65 72 20 26 26 20 66 6f |oundFind|er && fo|
|00000c30| 75 6e 64 46 69 6c 65 53 | 68 61 72 69 6e 67 29 7b |undFileS|haring){|
|00000c40| 0d 09 09 2f 2f 20 41 63 | 63 6f 72 64 69 6e 67 20 |...// Ac|cording |
|00000c50| 74 6f 20 61 20 63 6f 6d | 6d 65 6e 74 20 62 79 20 |to a com|ment by |
|00000c60| 43 2e 4b 2e 48 61 75 6e | 20 69 6e 20 4b 69 6c 6c |C.K.Haun| in Kill|
|00000c70| 45 76 65 72 79 6f 6e 65 | 42 75 74 4d 65 2e 63 2c |Everyone|ButMe.c,|
|00000c80| 20 22 46 69 6c 65 53 68 | 61 72 69 6e 67 20 6d 75 | "FileSh|aring mu|
|00000c90| 73 74 0d 09 09 2f 2f 20 | 62 65 20 6b 69 6c 6c 65 |st...// |be kille|
|00000ca0| 64 20 62 65 66 6f 72 65 | 20 74 68 65 20 46 69 6e |d before| the Fin|
|00000cb0| 64 65 72 22 2e 20 49 27 | 6d 20 6e 6f 74 20 63 6c |der". I'|m not cl|
|00000cc0| 65 61 72 20 6f 6e 20 77 | 68 79 2e 20 49 73 20 69 |ear on w|hy. Is i|
|00000cd0| 74 20 62 61 64 20 74 6f | 20 6c 65 61 76 65 20 46 |t bad to| leave F|
|00000ce0| 69 6c 65 53 68 61 72 69 | 6e 67 0d 09 09 2f 2f 20 |ileShari|ng...// |
|00000cf0| 72 75 6e 6e 69 6e 67 20 | 77 69 74 68 6f 75 74 20 |running |without |
|00000d00| 61 20 46 69 6e 64 65 72 | 3f 20 4f 72 20 69 73 20 |a Finder|? Or is |
|00000d10| 69 74 20 62 61 64 20 74 | 6f 20 6b 69 6c 6c 20 46 |it bad t|o kill F|
|00000d20| 69 6c 65 53 68 61 72 69 | 6e 67 20 77 68 65 6e 20 |ileShari|ng when |
|00000d30| 74 68 65 72 65 20 69 73 | 20 6e 6f 20 46 69 6e 64 |there is| no Find|
|00000d40| 65 72 3f 0d 09 09 2f 2f | 20 54 68 65 73 65 20 64 |er?...//| These d|
|00000d50| 69 66 66 65 72 65 6e 74 | 20 69 6e 74 65 72 70 72 |ifferent| interpr|
|00000d60| 65 74 61 74 69 6f 6e 73 | 20 68 61 76 65 20 6f 70 |etations| have op|
|00000d70| 70 6f 73 69 74 65 20 69 | 6d 70 6c 69 63 61 74 69 |posite i|mplicati|
|00000d80| 6f 6e 73 20 66 6f 72 20 | 77 68 61 74 20 74 6f 20 |ons for |what to |
|00000d90| 64 6f 20 69 66 20 77 65 | 0d 09 09 2f 2f 20 64 69 |do if we|...// di|
|00000da0| 73 63 6f 76 65 72 20 74 | 68 61 74 20 46 69 6c 65 |scover t|hat File|
|00000db0| 53 68 61 72 69 6e 67 20 | 69 73 20 72 75 6e 6e 69 |Sharing |is runni|
|00000dc0| 6e 67 20 61 6e 64 20 74 | 68 65 20 46 69 6e 64 65 |ng and t|he Finde|
|00000dd0| 72 20 69 73 6e 27 74 2e | 0d 09 09 2f 2f 20 4e 6f |r isn't.|...// No|
|00000de0| 74 20 6b 6e 6f 77 69 6e | 67 20 74 68 65 20 61 6e |t knowin|g the an|
|00000df0| 73 77 65 72 2c 20 74 68 | 69 73 20 63 6f 64 65 20 |swer, th|is code |
|00000e00| 63 6f 6e 73 65 72 76 61 | 74 69 76 65 6c 79 20 6f |conserva|tively o|
|00000e10| 6e 6c 79 20 74 72 69 65 | 73 20 74 6f 20 6b 69 6c |nly trie|s to kil|
|00000e20| 6c 20 46 69 6c 65 53 68 | 61 72 69 6e 67 20 69 66 |l FileSh|aring if|
|00000e30| 0d 09 09 2f 2f 20 74 68 | 65 20 46 69 6e 64 65 72 |...// th|e Finder|
|00000e40| 20 49 53 20 72 75 6e 6e | 69 6e 67 2e 0d 09 09 65 | IS runn|ing....e|
|00000e50| 72 72 6f 72 3d 41 45 43 | 72 65 61 74 65 44 65 73 |rror=AEC|reateDes|
|00000e60| 63 28 74 79 70 65 50 72 | 6f 63 65 73 73 53 65 72 |c(typePr|ocessSer|
|00000e70| 69 61 6c 4e 75 6d 62 65 | 72 2c 28 50 74 72 29 26 |ialNumbe|r,(Ptr)&|
|00000e80| 66 69 6c 65 53 68 61 72 | 69 6e 67 50 53 4e 2c 73 |fileShar|ingPSN,s|
|00000e90| 69 7a 65 6f 66 28 70 73 | 6e 29 2c 26 61 64 64 72 |izeof(ps|n),&addr|
|00000ea0| 65 73 73 29 3b 0d 09 09 | 69 66 28 21 65 72 72 6f |ess);...|if(!erro|
|00000eb0| 72 29 7b 0d 09 09 09 65 | 72 72 6f 72 3d 41 45 43 |r){....e|rror=AEC|
|00000ec0| 72 65 61 74 65 41 70 70 | 6c 65 45 76 65 6e 74 28 |reateApp|leEvent(|
|00000ed0| 6b 43 6f 72 65 45 76 65 | 6e 74 43 6c 61 73 73 2c |kCoreEve|ntClass,|
|00000ee0| 6b 41 45 51 75 69 74 41 | 70 70 6c 69 63 61 74 69 |kAEQuitA|pplicati|
|00000ef0| 6f 6e 2c 26 61 64 64 72 | 65 73 73 0d 09 09 09 09 |on,&addr|ess.....|
|00000f00| 2c 6b 41 75 74 6f 47 65 | 6e 65 72 61 74 65 52 65 |,kAutoGe|nerateRe|
|00000f10| 74 75 72 6e 49 44 2c 6b | 41 6e 79 54 72 61 6e 73 |turnID,k|AnyTrans|
|00000f20| 61 63 74 69 6f 6e 49 44 | 2c 26 65 76 65 6e 74 29 |actionID|,&event)|
|00000f30| 3b 0d 09 09 09 41 45 44 | 69 73 70 6f 73 65 44 65 |;....AED|isposeDe|
|00000f40| 73 63 28 26 61 64 64 72 | 65 73 73 29 3b 0d 09 09 |sc(&addr|ess);...|
|00000f50| 09 69 66 28 21 65 72 72 | 6f 72 29 7b 0d 09 09 09 |.if(!err|or){....|
|00000f60| 20 20 20 20 41 45 53 65 | 6e 64 28 26 65 76 65 6e | AESe|nd(&even|
|00000f70| 74 2c 4e 55 4c 4c 2c 6b | 41 45 4e 6f 52 65 70 6c |t,NULL,k|AENoRepl|
|00000f80| 79 2b 6b 41 45 41 6c 77 | 61 79 73 49 6e 74 65 72 |y+kAEAlw|aysInter|
|00000f90| 61 63 74 2b 6b 41 45 43 | 61 6e 53 77 69 74 63 68 |act+kAEC|anSwitch|
|00000fa0| 4c 61 79 65 72 0d 09 09 | 09 20 20 20 20 09 2c 6b |Layer...|. .,k|
|00000fb0| 41 45 4e 6f 72 6d 61 6c | 50 72 69 6f 72 69 74 79 |AENormal|Priority|
|00000fc0| 2c 6b 41 45 44 65 66 61 | 75 6c 74 54 69 6d 65 6f |,kAEDefa|ultTimeo|
|00000fd0| 75 74 2c 4e 55 4c 4c 2c | 4e 55 4c 4c 29 3b 0d 09 |ut,NULL,|NULL);..|
|00000fe0| 09 09 09 41 45 44 69 73 | 70 6f 73 65 44 65 73 63 |...AEDis|poseDesc|
|00000ff0| 28 26 65 76 65 6e 74 29 | 3b 0d 09 09 09 7d 0d 09 |(&event)|;....}..|
|00001000| 09 7d 0d 09 7d 0d 09 72 | 65 74 75 72 6e 20 65 72 |.}..}..r|eturn er|
|00001010| 72 6f 72 3b 0d 7d 0d 0d | 00 00 00 00 00 00 00 00 |ror;.}..|........|
|00001020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001060| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001080| 00 00 01 00 00 00 01 76 | 00 00 00 76 00 00 00 52 |.......v|...v...R|
|00001090| 00 67 26 2f 00 42 67 20 | 6c 00 12 20 50 48 68 00 |.g&/.Bg |l.. PHh.|
|000010a0| 06 4e ad 0d d0 12 1f 20 | 1f c0 01 67 0c 20 6c 00 |.N..... |...g. l.|
|000010b0| 11 49 73 46 69 6c 65 53 | 68 61 72 69 6e 67 4f 6e |.IsFileS|haringOn|
|000010c0| 2e 63 02 00 00 00 54 45 | 58 54 43 57 49 45 01 00 |.c....TE|XTCWIE..|
|000010d0| 00 00 54 45 58 54 43 57 | 49 45 01 00 00 64 02 a0 |..TEXTCW|IE...d..|
|000010e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010f0| 00 00 ac 10 e3 03 00 00 | 0f 98 00 00 01 c8 50 2d |........|......P-|
|00001100| 48 ff fa 42 67 2f 2e 00 | 12 3f 2e 00 08 2f 2e 00 |H..Bg/..|.?.../..|
|00001110| 0e 2f 2e 00 0a 48 6e ff | ff 20 6e ff fa 48 68 00 |./...Hn.|. n..Hh.|
|00001120| 18 48 68 00 21 4e ad 0b | d0 2f 0e 4e ad 0c 90 2f |.Hh.!N..|./.N.../|
|00001130| 2e 00 12 20 5f a0 2a 4f | ee ff da 4c df 1c f8 4e |... _.*O|...L...N|
|00001140| 5e 20 5f de fc 00 0e 4e | d0 4e 56 00 00 2f 0c 28 |^ _....N|.NV../.(|
|00001150| 6e 00 08 4a 6e 00 0c 67 | 46 4a ac 00 12 56 c0 4a |n..Jn..g|FJ...V.J|
|00001160| 00 67 26 2f 00 42 67 20 | 6c 00 12 20 50 48 68 00 |.g&/.Bg |l.. PHh.|
|00001170| 22 4e ad 0d d0 12 1f 20 | 1f c0 01 67 0c 20 6c 00 |"N..... |...g. l.|
|00001180| 00 00 00 1e 00 56 00 60 | 02 38 02 fb 00 56 00 60 |.....V.`|.8...V.`|
|00001190| 02 38 02 fb 00 00 00 00 | 00 00 00 00 00 00 00 00 |.8......|........|
|000011a0| 00 00 00 00 00 48 00 09 | 4d 6f 6e 61 63 6f 00 00 |.....H..|Monaco..|
|000011b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011c0| 00 00 00 00 00 00 00 00 | 00 03 00 04 00 56 00 60 |........|.....V.`|
|000011d0| 02 66 03 07 00 56 00 60 | 02 66 03 07 ac 11 29 6e |.f...V.`|.f....)n|
|000011e0| 00 00 00 03 00 00 02 90 | 00 00 00 00 01 00 00 00 |........|........|
|000011f0| 00 04 00 01 00 01 00 00 | 01 00 00 00 01 76 00 00 |........|.....v..|
|00001200| 00 76 00 00 00 52 01 a1 | 30 98 19 b6 00 00 00 1c |.v...R..|0.......|
|00001210| 00 52 00 01 4d 50 53 52 | 00 01 00 12 4d 57 42 42 |.R..MPSR|....MWBB|
|00001220| 00 00 00 2a 03 f0 ff ff | 00 00 00 00 00 00 00 00 |...*....|........|
|00001230| 03 ed ff ff 00 00 00 22 | 00 00 00 00 03 f0 ff ff |......."|........|
|00001240| 00 00 00 6e 00 00 00 00 | 00 00 00 00 00 00 00 00 |...n....|........|
|00001250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001260| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001270| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+